diff options
author | dinoex <dinoex@FreeBSD.org> | 2009-01-17 03:54:13 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2009-01-17 03:54:13 +0800 |
commit | 2729eeda67b7c43a3639bf01cb0934c25c3841fa (patch) | |
tree | 2efbc6a7315f5b1ab587f0003edbe9be4aea420c /mail/spamilter | |
parent | 0ae37dbfb624ab2c131d076360e03a4d7d0c9866 (diff) | |
download | freebsd-ports-gnome-2729eeda67b7c43a3639bf01cb0934c25c3841fa.tar.gz freebsd-ports-gnome-2729eeda67b7c43a3639bf01cb0934c25c3841fa.tar.zst freebsd-ports-gnome-2729eeda67b7c43a3639bf01cb0934c25c3841fa.zip |
- use RC_SUBR
Diffstat (limited to 'mail/spamilter')
-rw-r--r-- | mail/spamilter/Makefile | 12 | ||||
-rw-r--r-- | mail/spamilter/files/spamilter.sh | 36 | ||||
-rw-r--r-- | mail/spamilter/files/spamilter.sh.in | 49 |
3 files changed, 54 insertions, 43 deletions
diff --git a/mail/spamilter/Makefile b/mail/spamilter/Makefile index 9f935120bd81..42b9df582fb9 100644 --- a/mail/spamilter/Makefile +++ b/mail/spamilter/Makefile @@ -7,6 +7,7 @@ PORTNAME= spamilter PORTVERSION= 0.60 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.wanlink.com/spamilter/download/ MASTER_SITE_SUBDIR= dinoex @@ -15,8 +16,10 @@ EXTRACT_SUFX= .tgz MAINTAINER= dinoex@FreeBSD.org COMMENT= A Sendmail LibMilter filter to block spam -WRKSRC= ${WRKDIR}/${PORTNAME} HAS_CONFIGURE= yes +USE_RC_SUBR= spamilter.sh + +WRKSRC= ${WRKDIR}/${PORTNAME} CFLAGS+= ${PTHREAD_CFLAGS:S=""==} LDFLAGS+= ${PTHREAD_LIBS} MAKE_ENV+= __MAKE_CONF=/dev/null @@ -50,14 +53,11 @@ CONFIGURE_ARGS+= --have-resn PLIST_FILES+= bin/dnsblchk bin/dnsblupd bin/ipfwmtad bin/mxlookup \ bin/spamilter \ - bin/spamilter-system-report bin/spamilter-user-report \ - etc/rc.d/milter-spamilter.sh.sample + bin/spamilter-system-report bin/spamilter-user-report PORTDOCS= Changelog INSTALL LICENSE docs.html docs.txt db.rcpt \ db.rdnsbl db.sndr policy.html spamilter.rc pre-configure: - @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/spamilter.sh \ - > ${WRKSRC}/spamilter.sh ${REINPLACE_CMD} \ -e "s=/etc/spamilter.rc=${PREFIX}/etc/spamilter.rc=" \ ${WRKSRC}/spamilter.c \ @@ -69,8 +69,6 @@ xpost-configure: ${WRKSRC}/Makefile post-install: - ${INSTALL_SCRIPT} ${WRKSRC}/spamilter.sh \ - ${PREFIX}/etc/rc.d/milter-spamilter.sh.sample .for i in ${BINFILES} ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${PREFIX}/bin/ .endfor diff --git a/mail/spamilter/files/spamilter.sh b/mail/spamilter/files/spamilter.sh deleted file mode 100644 index db0c3f1df62e..000000000000 --- a/mail/spamilter/files/spamilter.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -if ! test -x %%PREFIX%%/bin/spamilter -then - exit 0 -fi -case "$1" in -start) - rm -f /tmp/Spamilter.pid - %%PREFIX%%/bin/spamilter && - echo -n ' spamilter' - ;; -stop) - if test -r /tmp/Spamilter.pid - then - kill `head -1 /tmp/Spamilter.pid` - else - echo " spamilter: not running" 2>&1 - fi - rm -f /tmp/Spamilter.pid - ;; -reload) - if test -r /tmp/Spamilter.pid - then - kill -USR1 `head -1 /tmp/Spamilter.pid` - else - echo " spamilter: not running" 2>&1 - fi - ;; -*) - echo "Usage: ${0##*/}: { start | stop | reload }" >&2 - exit 64 - ;; -esac diff --git a/mail/spamilter/files/spamilter.sh.in b/mail/spamilter/files/spamilter.sh.in new file mode 100644 index 000000000000..d1247ce5ea33 --- /dev/null +++ b/mail/spamilter/files/spamilter.sh.in @@ -0,0 +1,49 @@ +#!/bin/sh + +# $FreeBSD$ + +# Start or stop spamilter + +# PROVIDE: spamilter +# REQUIRE: DAEMON +# BEFORE: mail +# KEYWORD: shutdown +# + +prefix=%%PREFIX%% + +# Define these spamilter_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/spamilter +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +spamilter_enable=${spamilter_enable:-"NO"} # Enable spamilter-milter +spamilter_flags=${spamilter_flags:-""} # Flags to spamilter + +. /etc/rc.subr + +name="spamilter" +rcvar=`set_rcvar` +command="${prefix}/bin/spamilter" +pidfile="/tmp/Spamilter.pid" +required_files="${prefix}/etc/spamilter.rc" +start_precmd="spamilter_prestart" +stop_postcmd="spamilter_poststop" + +spamilter_prestart() { + /bin/rm -f "${pidfile}" +} + +spamilter_poststop() { + /bin/rm -f "${pidfile}" +} + +load_rc_config $name + +command_args="${spamilter_flags}" + +run_rc_command "$1" + +# eof |