diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-05-25 08:12:34 +0000 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-05-25 08:12:34 +0000 |
commit | 10e7291f15e6ac9f6affac9c4d7e9a52b987ef91 (patch) | |
tree | 4cdb598f99b8f3d02b9e724b3d100d7b9da535c4 /mail | |
parent | 511f44eb8c68f8432eb30d6f102b9042708cad89 (diff) | |
download | FreeBSD-ports-10e7291f15e6ac9f6affac9c4d7e9a52b987ef91.zip FreeBSD-ports-10e7291f15e6ac9f6affac9c4d7e9a52b987ef91.tar.gz |
[1]:
- Update to 1.7.1
- Convert the startup script to rcNG
- Create a bogomilter user
Moreover:
- Use ${LOCALBASE}/bin/bogofilter rather than /usr/local/bin/bogofilter
- Fix the configuration file path in bogom.8
- Fix the packing list when NOPORTDOCS is defined
PR: ports/81417 [1]
Submitted by: maintainer [1]
Diffstat (limited to 'mail')
-rw-r--r-- | mail/milter-bogom/Makefile | 38 | ||||
-rw-r--r-- | mail/milter-bogom/distinfo | 4 | ||||
-rw-r--r-- | mail/milter-bogom/files/milter-bogom.sh | 22 | ||||
-rw-r--r-- | mail/milter-bogom/files/milter-bogom.sh.in | 42 | ||||
-rw-r--r-- | mail/milter-bogom/pkg-deinstall | 11 | ||||
-rw-r--r-- | mail/milter-bogom/pkg-install | 17 |
6 files changed, 96 insertions, 38 deletions
diff --git a/mail/milter-bogom/Makefile b/mail/milter-bogom/Makefile index cec0284..8cc211a 100644 --- a/mail/milter-bogom/Makefile +++ b/mail/milter-bogom/Makefile @@ -6,9 +6,10 @@ # PORTNAME= milter-bogom -PORTVERSION= 1.5.1 +PORTVERSION= 1.7.1 CATEGORIES= mail -MASTER_SITES= http://www.usebox.net/jjm/bogom/ +MASTER_SITES= http://www.usebox.net/jjm/bogom/ \ + http://blackshell.usebox.net/bogom/ DISTNAME= bogom-${PORTVERSION} MAINTAINER= victor@alf.dyndns.ws @@ -18,30 +19,39 @@ RUN_DEPENDS= bogofilter:${PORTSDIR}/mail/bogofilter MAN8= bogom.8 +MAKE_ARGS= CPPFLAGS="-DDEF_CONF=\\\"${PREFIX}/etc/bogom.conf\\\" ${PTHREAD_CFLAGS}" \ + LIBS="-lmilter ${PTHREAD_LIBS}" + +USE_REINPLACE= yes +USE_RC_SUBR= milter-bogom.sh + PLIST_FILES= sbin/bogom \ - etc/bogom.conf-example \ - etc/rc.d/milter-bogom.sh + etc/bogom.conf-example + +.if !defined(NOPORTDOCS) PORTDOCS= README CHANGELOG +.endif -post-extract: - @${SED} -e 's/LIBS+=-lmilter -lpthread/LIBS+=-lmilter ${PTHREAD_LIBS}/'\ - -i .bak ${WRKSRC}/Makefile - @${SED} -e 's|/etc/bogom.conf|${PREFIX}/etc/bogom.conf|' -i .bak \ - ${WRKSRC}/milter.c +post-patch: + @${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/bogom.8 + @${REINPLACE_CMD} -e \ + 's|/usr/local/bin/bogofilter|${LOCALBASE}/bin/bogofilter|g' \ + ${WRKSRC}/bogom.8 \ + ${WRKSRC}/bogom.conf-example \ + ${WRKSRC}/milter.c do-install: @${INSTALL_PROGRAM} ${WRKSRC}/bogom ${PREFIX}/sbin @${INSTALL_MAN} ${WRKSRC}/bogom.8 ${PREFIX}/man/man8 @${INSTALL_DATA} ${WRKSRC}/bogom.conf-example ${PREFIX}/etc - @${INSTALL_SCRIPT} ${FILESDIR}/milter-bogom.sh ${PREFIX}/etc/rc.d .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} - @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - @${INSTALL_DATA} ${WRKSRC}/CHANGELOG ${DOCSDIR} +.for f in ${PORTDOCS} + @${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +.endfor .endif post-install: - @${SED} -e 's|LOCALBASE|${PREFIX}|g' -i "" \ - ${PREFIX}/etc/rc.d/milter-bogom.sh + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.mk> diff --git a/mail/milter-bogom/distinfo b/mail/milter-bogom/distinfo index a8955c8..ba961d8 100644 --- a/mail/milter-bogom/distinfo +++ b/mail/milter-bogom/distinfo @@ -1,2 +1,2 @@ -MD5 (bogom-1.5.1.tar.gz) = 9dc9fc890819e22df3408b8a39837606 -SIZE (bogom-1.5.1.tar.gz) = 16868 +MD5 (bogom-1.7.1.tar.gz) = e8fa2a2c78ce866b4f23fedf6e0b8764 +SIZE (bogom-1.7.1.tar.gz) = 18862 diff --git a/mail/milter-bogom/files/milter-bogom.sh b/mail/milter-bogom/files/milter-bogom.sh deleted file mode 100644 index 6e3a96c..0000000 --- a/mail/milter-bogom/files/milter-bogom.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -case "$1" in - start) - if [ -f LOCALBASE/sbin/bogom ] - then - LOCALBASE/sbin/bogom -u root & > /dev/null - echo -n ' milter-bogom' - fi - ;; - stop) - killall bogom - sleep 3 # wait for bogom to exit - ;; - - *) - echo "" - echo "Usage: `basename $0` { start | stop }" - echo "" - ;; -esac -exit 0; diff --git a/mail/milter-bogom/files/milter-bogom.sh.in b/mail/milter-bogom/files/milter-bogom.sh.in new file mode 100644 index 0000000..0688a91 --- /dev/null +++ b/mail/milter-bogom/files/milter-bogom.sh.in @@ -0,0 +1,42 @@ +#!/bin/sh + +# PROVIDE: milterbogom +# REQUIRE: LOGIN +# BEFORE: sendmail +# KEYWORD: milterbogom + +milterbogom_enable=${milterbogom_enable-"NO"} +milterbogom_socket=${milterbogom_socket-"unix:/var/run/bogom/milter.sock"} +milterbogom_user=${milterbogom_user-"bogomilter"} +milterbogom_pid=${milterbogom_pid-"/var/run/bogom/bogom.pid"} +milterbogom_flags=${milterbogom_flags-"-u ${milterbogom_user} \ +-s ${milterbogom_socket} -p ${milterbogom_pid}"} + + +. %%RC_SUBR%% + +name=milterbogom +pidfile=${milterbogom_pid} +rcvar=`set_rcvar` +command=%%PREFIX%%/sbin/bogom +start_precmd="bogom_precmd" +stop_postcmd="bogom_postcmd" + +load_rc_config $name + +bogom_precmd() +{ + if [ -d `dirname ${milterbogom_pid}` ] + then + return; + fi + mkdir -p `dirname ${milterbogom_pid}` + chown ${milterbogom_user} `dirname ${milterbogom_pid}` +} + +bogom_postcmd() +{ + # just if the directory is empty + rmdir `dirname ${milterbogom_pid}` > /dev/null 2>&1 +} +run_rc_command "$1" diff --git a/mail/milter-bogom/pkg-deinstall b/mail/milter-bogom/pkg-deinstall new file mode 100644 index 0000000..c48dcea --- /dev/null +++ b/mail/milter-bogom/pkg-deinstall @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "$2" = "POST-DEINSTALL" ] +then + echo "***************************************************************" + echo "* The bogomilter user will not be removed by this port *" + echo "* if you are not upgrading and will not use this port anymore *" + echo "* delete the bogomilter user using: *" + echo "* pw userdel bogomilter *" + echo "***************************************************************" +fi diff --git a/mail/milter-bogom/pkg-install b/mail/milter-bogom/pkg-install new file mode 100644 index 0000000..d7da1ba --- /dev/null +++ b/mail/milter-bogom/pkg-install @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ "$2" != "POST-INSTALL" ] +then + exit 0; +fi + +# check if bogomilter user exists +pw user show bogomilter > /dev/null 2>&1 + +if [ $? != 0 ] +then + echo "===> Adding user bogomilter" + pw useradd bogomilter -u 174 -c "milter-bogom" +else + echo "===> Using existing user bogomilter" +fi |