diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-25 09:08:26 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-25 09:08:26 +0000 |
commit | bfedb7dd4996ae8ff8b9a7917e6553515f525e15 (patch) | |
tree | 9bdc5f2a6b7d2fee9456fb12f159d43b1421136d /mail/spamass-milter | |
parent | 0c07e0eef422c87d766c60dc27dd8600587e9f38 (diff) | |
download | ports-bfedb7dd4996ae8ff8b9a7917e6553515f525e15.tar.gz ports-bfedb7dd4996ae8ff8b9a7917e6553515f525e15.zip |
- Convert to rcNG
PR: ports/66851
Submitted by: Jeremy Chadwick <freebsd@jdc.parodius.com>
Approved by: maintainer
Notes
Notes:
svn path=/head/; revision=109947
Diffstat (limited to 'mail/spamass-milter')
-rw-r--r-- | mail/spamass-milter/Makefile | 16 | ||||
-rw-r--r-- | mail/spamass-milter/files/activation.txt | 6 | ||||
-rw-r--r-- | mail/spamass-milter/files/spamass-milter.sh | 50 | ||||
-rw-r--r-- | mail/spamass-milter/files/spamass-milter.sh.dist | 23 | ||||
-rw-r--r-- | mail/spamass-milter/pkg-plist | 2 |
5 files changed, 60 insertions, 37 deletions
diff --git a/mail/spamass-milter/Makefile b/mail/spamass-milter/Makefile index 7eab76faddda..017564321225 100644 --- a/mail/spamass-milter/Makefile +++ b/mail/spamass-milter/Makefile @@ -7,7 +7,7 @@ PORTNAME= spamass-milter PORTVERSION= 0.2.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SAVANNAH} MASTER_SITE_SUBDIR= spamass-milt @@ -57,17 +57,19 @@ LDFLAGS+= -L${MILTERLIB} GNU_CONFIGURE= yes CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} + MAN1= spamass-milter.1 post-patch: -.for f in spamass-milter.sh.dist activation.txt - ${SED} -e 's|/usr/local|${PREFIX}|g' \ - ${FILESDIR}/${f} > ${WRKDIR}/${f} -.endfor + @${SED} -e 's|/usr/local|${PREFIX}|g' \ + ${FILESDIR}/activation.txt > ${WRKDIR}/activation.txt + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/spamass-milter.sh > ${WRKDIR}/spamass-milter.sh post-install: - ${INSTALL_DATA} ${WRKDIR}/spamass-milter.sh.dist \ - ${PREFIX}/etc/rc.d/spamass-milter.sh.dist + @${INSTALL_SCRIPT} ${WRKDIR}/spamass-milter.sh ${PREFIX}/etc/rc.d/spamass-milter.sh .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKDIR}/activation.txt ${DOCSDIR}/activation.txt diff --git a/mail/spamass-milter/files/activation.txt b/mail/spamass-milter/files/activation.txt index 4092378d58c1..561833626be0 100644 --- a/mail/spamass-milter/files/activation.txt +++ b/mail/spamass-milter/files/activation.txt @@ -6,16 +6,10 @@ In order to activate spamass-milter, follow these steps: 2. If you didn't activate spamd (the SpamAssassin daemon), do so now: - cd /usr/local/etc/rc.d - cp -p spamd.sh-dist spamd.sh - chmod 755 spamd.sh /usr/local/etc/rc.d/spamd.sh start 3. Activate spamass-milter: - cd /usr/local/etc/rc.d - cp -p spamass-milter.sh.dist spamass-milter.sh - chmod 755 spamass-milter.sh /usr/local/etc/rc.d/spamass-milter.sh start 4. Backup your sendmail.cf (in /etc/mail). diff --git a/mail/spamass-milter/files/spamass-milter.sh b/mail/spamass-milter/files/spamass-milter.sh new file mode 100644 index 000000000000..93773c03fe8e --- /dev/null +++ b/mail/spamass-milter/files/spamass-milter.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# +# <<<Add FreeBSD CVS ID here!>>> +# + +# PROVIDE: spamass-milter +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable spamass-milter: +# +#spamass_milter_enable="YES" +# +# See spamass-milter(8) for flags. +# + +. %%RC_SUBR%% + +name=spamass_milter +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/spamass-milter +required_dirs=%%PREFIX%%/share/spamassassin + +# set defaults + +spamass_milter_enable=${spamass_milter_enable:-"NO"} +spamass_milter_socket=${spamass_milter_socket:-"/var/run/spamass-milter.sock"} +spamass_milter_flags=${spamass_milter_flags:-"-f -p ${spamass_milter_socket}"} + +start_postcmd=start_postcmd +stop_postcmd=stop_postcmd + +start_postcmd() +{ + sleep 1 + kill -HUP `head -1 /var/run/sendmail.pid` +} + +stop_postcmd() +{ + rm -f ${spamass_milter_socket} + sleep 1 + kill -HUP `head -1 /var/run/sendmail.pid` +} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/mail/spamass-milter/files/spamass-milter.sh.dist b/mail/spamass-milter/files/spamass-milter.sh.dist deleted file mode 100644 index bcb03473e123..000000000000 --- a/mail/spamass-milter/files/spamass-milter.sh.dist +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -DAEMON=/usr/local/sbin/spamass-milter -SOCKET=/var/run/spamass-milter.sock - -case "$1" in -start) - if [ -f "${DAEMON}" -a -x "${DAEMON}" ] - then - "${DAEMON}" -p "${SOCKET}" -f - sleep 1 - kill -HUP `head -1 /var/run/sendmail.pid` - echo -n ' spamass-milter' - fi -;; -stop) - killall $(basename ${DAEMON}) - rm -f "${SOCKET}" - sleep 1 - kill -HUP `head -1 /var/run/sendmail.pid` - echo -n ' spamass-milter' -;; -esac diff --git a/mail/spamass-milter/pkg-plist b/mail/spamass-milter/pkg-plist index ef50241cd4d4..7042bd14ba07 100644 --- a/mail/spamass-milter/pkg-plist +++ b/mail/spamass-milter/pkg-plist @@ -1,4 +1,4 @@ sbin/spamass-milter -etc/rc.d/spamass-milter.sh.dist +etc/rc.d/spamass-milter.sh %%PORTDOCS%%share/doc/spamass-milter/activation.txt %%PORTDOCS%%@dirrm share/doc/spamass-milter |