ports/57384: [PATCH] mail/p5-Mail-SpamAssassin 2.60
Martin Matuska
martin at tradex.sk
Tue Sep 30 01:20:11 UTC 2003
>Number: 57384
>Category: ports
>Synopsis: [PATCH] mail/p5-Mail-SpamAssassin 2.60
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Sep 29 18:20:08 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Martin Matuska
>Release: FreeBSD 4.8-RELEASE-p10 i386
>Organization:
>Environment:
FreeBSD 4.8-RELEASE-p10 i386
>Description:
This patch adds rc_subr support to spamd daemon
of the spamassassin port.
>How-To-Repeat:
>Fix:
--- Makefile.orig Tue Sep 30 03:00:54 2003
+++ Makefile Tue Sep 30 03:08:07 2003
@@ -7,6 +7,7 @@
PORTNAME= Mail-SpamAssassin
PORTVERSION= 2.60
+PORTREVISION= 1
CATEGORIES= mail perl5
MASTER_SITES= http://spamassassin.org/released/ \
${MASTER_SITE_PERL_CPAN}
@@ -52,6 +53,17 @@
DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
+SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g'
+
+USE_RC_SUBR= yes
+RC_DIR= ${PREFIX}/etc/rc.d
+RC_SUFX= .sh
+SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
+ -e 's|%%RC_DIR%%|${RC_DIR}|g' \
+ -e 's|%%RC_SUFX%%|${RC_SUFX}|g'
+PLIST_SUB+= RC_DIR=${RC_DIR} \
+ RC_SUFX=${RC_SUFX}
+
post-patch:
@${FIND} ${WRKSRC} -name \*.orig -delete
@@ -60,9 +72,12 @@
${WRKSRC}/Makefile.PL > ${WRKSRC}/Makefile.PL.sed
@${MV} ${WRKSRC}/Makefile.PL.sed ${WRKSRC}/Makefile.PL
+post-build:
+ @${SED} ${SED_SCRIPT} ${FILESDIR}/spamd.sh > ${WRKSRC}/spamd.sh
+
post-install:
@${STRIP_CMD} ${PREFIX}/bin/spamc
- ${INSTALL_SCRIPT} ${FILESDIR}/spamd.sh ${PREFIX}/etc/rc.d/spamd.sh-dist
+ ${INSTALL_SCRIPT} ${WRKSRC}/spamd.sh ${PREFIX}/etc/rc.d/spamd${RC_SUFX}
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
--- files/spamd.sh.orig Tue Sep 30 02:54:33 2003
+++ files/spamd.sh Tue Sep 30 03:12:07 2003
@@ -1,19 +1,41 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/bin/spamd ] && ${PREFIX}/bin/spamd -a -c -d && echo -n ' spamd'
- ;;
-stop)
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
+# PROVIDE: spamd
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: FreeBSD shutdown
-exit 0
+#
+# Add the following lines to /etc/rc.conf to enable spamd:
+#
+#spamd_enable="YES"
+#
+# See spamd(8) for flags
+#
+
+. %%RC_SUBR%%
+
+name=spamd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/spamd
+pidfile=/var/run/spamd.pid
+required_dirs=%%PREFIX%%/share/spamassassin
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+# set defaults
+
+spamd_enable=${spamd_enable:-"NO"}
+spamd_flags=${spamd_flags:-"-a -c -d -r ${pidfile}"}
+
+load_rc_config $name
+run_rc_command "$1"
--- pkg-plist.orig Tue Sep 30 03:05:15 2003
+++ pkg-plist Tue Sep 30 03:05:36 2003
@@ -3,7 +3,7 @@
bin/spamc
bin/spamd
etc/mail/spamassassin/local.cf.sample
-etc/rc.d/spamd.sh-dist
+etc/rc.d/spamd%%RC_SUFX%%
%%SITE_PERL%%/Mail/SpamAssassin.pm
%%SITE_PERL%%/Mail/SpamAssassin/ArchiveIterator.pm
%%SITE_PERL%%/Mail/SpamAssassin/AuditMessage.pm
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list