- use DOCSDIR

- new option STANDALONE_POP3
Submitted by:   osa

- USE_REINPLACE for all options
- cleanup targets
Submitted by:   dinoex
This commit is contained in:
Dirk Meyer 2003-12-04 03:28:54 +00:00
parent 12fc4ace75
commit bb8719d37f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=94864
3 changed files with 48 additions and 14 deletions

View file

@ -13,10 +13,14 @@ MASTER_SITES= http://www.openwall.com/popa3d/ \
.if defined(SMTP_AFTER_POP3) .if defined(SMTP_AFTER_POP3)
PKGNAMESUFFIX?= -before-sendmail PKGNAMESUFFIX?= -before-sendmail
.endif .endif
.if defined(STANDALONE_POP3)
PKGNAMESUFFIX?= -standalone
.endif
MAINTAINER= dinoex@FreeBSD.org MAINTAINER= dinoex@FreeBSD.org
COMMENT= Secure, performance, tiny POP3 daemon COMMENT= Secure, performance, tiny POP3 daemon
USE_REINPLACE= yes
ALL_TARGET= popa3d ALL_TARGET= popa3d
MAN8= popa3d.8 MAN8= popa3d.8
PLIST= ${WRKDIR}/.PLIST.more PLIST= ${WRKDIR}/.PLIST.more
@ -27,10 +31,23 @@ PLIST_SUB+= SMTP_AFTER_POP3=""
.else .else
PLIST_SUB+= SMTP_AFTER_POP3="@comment " PLIST_SUB+= SMTP_AFTER_POP3="@comment "
.endif .endif
.if defined(STANDALONE_POP3)
PLIST_SUB+= STANDALONE_POP3=""
.else
PLIST_SUB+= STANDALONE_POP3="@comment "
.endif
.if defined(STANDALONE_POP3)
post-extract:
@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/popa3d.sh \
> ${WRKSRC}/popa3d.sh
.endif
pre-configure: pre-configure:
@${CAT} ${PKGDIR}/pkg-plist >${PLIST} @${CAT} ${PKGDIR}/pkg-plist >${PLIST}
.if !exists(/var/empty) .if !exists(/var/empty)
@${REINPLACE_CMD} -e "s=/var/empty=${PREFIX}/empty=" \
${WRKSRC}/params.h
@${ECHO_CMD} "@exec ${MKDIR} %D/empty" >>${PLIST} @${ECHO_CMD} "@exec ${MKDIR} %D/empty" >>${PLIST}
@${ECHO_CMD} "@dirrm empty" >>${PLIST} @${ECHO_CMD} "@dirrm empty" >>${PLIST}
.endif .endif
@ -38,12 +55,9 @@ pre-configure:
@${ECHO_CMD} "@cwd ${CFDIR}" >>${PLIST} @${ECHO_CMD} "@cwd ${CFDIR}" >>${PLIST}
@${ECHO_CMD} "hack/popauth.m4" >>${PLIST} @${ECHO_CMD} "hack/popauth.m4" >>${PLIST}
.endif .endif
.if defined(STANDALONE_POP3)
.if !exists(/var/empty) @${REINPLACE_CMD} -e 's|^\(#define POP_STANDALONE\).*|\1 1|' \
pre-patch: ${WRKSRC}/params.h
@${MV} ${WRKSRC}/params.h ${WRKSRC}/params.h.sed
${SED} -e "s=/var/empty=${PREFIX}/empty=" \
${WRKSRC}/params.h.sed > ${WRKSRC}/params.h
.endif .endif
pre-install: pre-install:
@ -59,12 +73,15 @@ do-install:
.if defined(SMTP_AFTER_POP3) .if defined(SMTP_AFTER_POP3)
${INSTALL_DATA} ${FILESDIR}/popauth.m4 ${CFDIR}/hack/ ${INSTALL_DATA} ${FILESDIR}/popauth.m4 ${CFDIR}/hack/
.endif .endif
.if defined(STANDALONE_POP3)
${INSTALL_DATA} ${WRKSRC}/popa3d.sh ${PREFIX}/etc/rc.d/popa3d.sh-dist
.endif
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/doc/popa3d ${MKDIR} ${DOCSDIR}
${INSTALL_MAN} ${WRKSRC}/DESIGN ${PREFIX}/share/doc/popa3d ${INSTALL_MAN} ${WRKSRC}/DESIGN ${DOCSDIR}/
${INSTALL_MAN} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/popa3d ${INSTALL_MAN} ${WRKSRC}/LICENSE ${DOCSDIR}/
.if defined(SMTP_AFTER_POP3) .if defined(SMTP_AFTER_POP3)
${INSTALL_DATA} ${FILESDIR}/POPAUTH ${PREFIX}/share/doc/popa3d ${INSTALL_DATA} ${FILESDIR}/POPAUTH ${DOCSDIR}/
.endif .endif
.endif .endif

View file

@ -0,0 +1,16 @@
#!/bin/sh
case "$1" in
start)
[ -x %%PREFIX%%/libexec/popa3d ] && %%PREFIX%%/libexec/popa3d -D && echo -n ' popa3d'
;;
stop)
killall popa3d
;;
*)
echo "Usage: ${0##*/}: { start | stop }" >&2
exit 64
;;
esac
exit 0

View file

@ -1,6 +1,7 @@
@comment $FreeBSD$ @comment $FreeBSD$
%%STANDALONE_POP3%%etc/rc.d/popa3d.sh-dist
libexec/popa3d libexec/popa3d
%%PORTDOCS%%share/doc/popa3d/DESIGN %%PORTDOCS%%%%DOCSDIR%%/DESIGN
%%PORTDOCS%%share/doc/popa3d/LICENSE %%PORTDOCS%%%%DOCSDIR%%/LICENSE
%%SMTP_AFTER_POP3%%%%PORTDOCS%%share/doc/popa3d/POPAUTH %%SMTP_AFTER_POP3%%%%PORTDOCS%%%%DOCSDIR%%/POPAUTH
%%PORTDOCS%%@dirrm share/doc/popa3d %%PORTDOCS%%@dirrm %%DOCSDIR%%