diff options
author | Yen-Ming Lee <leeym@FreeBSD.org> | 2005-04-13 12:13:41 +0000 |
---|---|---|
committer | Yen-Ming Lee <leeym@FreeBSD.org> | 2005-04-13 12:13:41 +0000 |
commit | 3e3e1721b2c9a3e092b6e4cdae14551b40c1d67b (patch) | |
tree | 8698b4a1a4ae39f19b24afc226817c005d11afc4 /mail | |
parent | b8109f036babc25045e11f3fd63f97e0216d238f (diff) | |
download | ports-3e3e1721b2c9a3e092b6e4cdae14551b40c1d67b.tar.gz ports-3e3e1721b2c9a3e092b6e4cdae14551b40c1d67b.zip |
Notes
Diffstat (limited to 'mail')
-rw-r--r-- | mail/spamd/Makefile | 22 | ||||
-rw-r--r-- | mail/spamd/distinfo | 4 | ||||
-rw-r--r-- | mail/spamd/files/pfspamd.sh | 39 | ||||
-rw-r--r-- | mail/spamd/files/spamd.sh.sample | 40 | ||||
-rw-r--r-- | mail/spamd/pkg-plist | 2 |
5 files changed, 53 insertions, 54 deletions
diff --git a/mail/spamd/Makefile b/mail/spamd/Makefile index 1fe30cf23eef..5b1c27437e97 100644 --- a/mail/spamd/Makefile +++ b/mail/spamd/Makefile @@ -6,13 +6,13 @@ # PORTNAME= spamd -PORTVERSION= 3.5 -PORTREVISION= 2 +PORTVERSION= 3.7 CATEGORIES= mail -MASTER_SITES= http://resources.delphij.net/pf/ +MASTER_SITES= ${MASTER_SITE_LOCAL} +MASTER_SITE_SUBDIR= delphij DISTNAME= ${PORTNAME}_${PORTVERSION} -MAINTAINER= delphij@FreeBSD.org.cn +MAINTAINER= delphij@FreeBSD.org COMMENT= Traps spammers with a very slow smtp-login and return 4xx error USE_BZIP2= yes @@ -20,11 +20,14 @@ USE_BZIP2= yes .include <bsd.port.pre.mk> .if ${OSVERSION} < 502117 -IGNORE= "OpenBSD 3.5 pf/pfctl is necessary for this port to function properly." +IGNORE= OpenBSD 3.5 pf/pfctl is necessary for this port to function properly. .else LOCAL_PFCTL= /sbin/pfctl .endif +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} + USE_REINPLACE= yes .if !defined(BATCH) && !defined(PACKAGE_BUILDING) @@ -35,7 +38,6 @@ MAN5= spamd.conf.5 MAN8= spamd.8 spamd-setup.8 spamdb.8 spamlogd.8 SAMPLE_SPAMD_CONF= ${PREFIX}/etc/spamd.conf.sample -SAMPLE_SPAMD_RC= ${PREFIX}/etc/rc.d/pf-spamd.sh post-patch: @${REINPLACE_CMD} -e 's|%%LOCAL_PFCTL%%|${LOCAL_PFCTL}|; \ @@ -43,6 +45,8 @@ post-patch: ${WRKSRC}/spamd-setup/spamd-setup.c @${REINPLACE_CMD} -e 's|/etc/spamd.conf|${PREFIX}/etc/spamd.conf|' \ ${WRKSRC}/spamd/spamd.8 ${WRKSRC}/spamd-setup/spamd-setup.8 + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/pfspamd.sh > ${WRKDIR}/pfspamd.sh pre-su-install: .if !defined(BATCH) && !defined(PACKAGE_BUILDING) @@ -59,11 +63,7 @@ do-install: ${INSTALL_MAN} ${WRKSRC}/spamd-setup/spamd-setup.8 ${PREFIX}/man/man8 ${INSTALL_MAN} ${WRKSRC}/spamdb/spamdb.8 ${PREFIX}/man/man8 ${INSTALL_MAN} ${WRKSRC}/spamlogd/spamlogd.8 ${PREFIX}/man/man8 - @if [ ! -f ${SAMPLE_SPAMD_RC} ]; then \ - ${ECHO_MSG} "Installing ${SAMPLE_SPAMD_RC} startup file."; \ - ${INSTALL_SCRIPT} ${FILESDIR}/spamd.sh.sample \ - ${SAMPLE_SPAMD_RC}; \ - fi + @${INSTALL_SCRIPT} -m 555 ${WRKDIR}/pfspamd.sh ${PREFIX}/etc/rc.d/pfspamd.sh @if [ ! -f ${SAMPLE_SPAMD_CONF} ]; then \ ${ECHO_MSG} "Installing ${SAMPLE_SPAMD_CONF} file."; \ ${INSTALL_DATA} ${WRKSRC}/doc/spamd.conf \ diff --git a/mail/spamd/distinfo b/mail/spamd/distinfo index 7ccaee2423a9..a297b739796a 100644 --- a/mail/spamd/distinfo +++ b/mail/spamd/distinfo @@ -1,2 +1,2 @@ -MD5 (spamd_3.5.tar.bz2) = e30f1ee8212b31fb4d71b6a8fd7f1204 -SIZE (spamd_3.5.tar.bz2) = 26427 +MD5 (spamd_3.7.tar.bz2) = e1d96b9d7b1d4189dca510ff0000383f +SIZE (spamd_3.7.tar.bz2) = 28066 diff --git a/mail/spamd/files/pfspamd.sh b/mail/spamd/files/pfspamd.sh new file mode 100644 index 000000000000..5f82af096862 --- /dev/null +++ b/mail/spamd/files/pfspamd.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: pfspamd +# REQUIRE: NETWORKING +# BEFORE: mail +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable spamd: +# pfspamd_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable spamd +# pfspamd_flags (str): Set to "" by default. +# Extra flags passed to start command. + +. %%RC_SUBR%% + +name="pfspamd" +rcvar=`set_rcvar` + +command="%%PREFIX%%/libexec/spamd" +start_postcmd="pfspamd_postcmd" +restart_postcmd="pfspamd_postcmd" + +[ -z "$pfspamd_enable" ] && pfspamd_enable="NO" +[ -z "$pfspamd_flags" ] && pfspamd_flags="" + +load_rc_config $name + +pfspamd_postcmd() +{ + if [ -x %%PREFIX%%/sbin/spamd-setup ]; then + %%PREFIX%%/sbin/spamd-setup + fi +} + +run_rc_command "$1" diff --git a/mail/spamd/files/spamd.sh.sample b/mail/spamd/files/spamd.sh.sample deleted file mode 100644 index d393e1d00385..000000000000 --- a/mail/spamd/files/spamd.sh.sample +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: /tmp/pcvs/ports/mail/spamd/files/Attic/spamd.sh.sample,v 1.1 2003-09-29 23:01:21 edwin Exp $ - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - echo "Please use the complete pathname." >&2 - exit 1 -fi - -if [ -z "${source_rc_confs_defined}" ]; then - if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs - elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf - fi -fi - -case "$1" in -start) - case "${spamd_enable}" in - [Yy][Ee][Ss]) - echo -n ' spamd' - ${PREFIX}/libexec/spamd ${spamd_flags} - if [ -x ${PREFIX}/sbin/spamd-setup ]; then - ${PREFIX}/sbin/spamd-setup - fi - ;; - esac - ;; -stop) - killall spamd - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/mail/spamd/pkg-plist b/mail/spamd/pkg-plist index f452ab2be787..ff60384603b5 100644 --- a/mail/spamd/pkg-plist +++ b/mail/spamd/pkg-plist @@ -2,5 +2,5 @@ libexec/spamd libexec/spamlogd sbin/spamd-setup sbin/spamdb -etc/rc.d/pf-spamd.sh +etc/rc.d/pfspamd.sh etc/spamd.conf.sample |