1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

[PATCH] mail/p5-Mail-SpamAssassin 2.60

This patch adds rc_subr support to spamd daemon
	of the spamassassin port.

PR:		ports/57384
Submitted by:	Martin Matuska <martin@tradex.sk>
This commit is contained in:
Edwin Groothuis 2004-01-13 08:29:28 +00:00
parent 8757ec9174
commit ae88725e1a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=98047
3 changed files with 54 additions and 17 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= Mail-SpamAssassin
PORTVERSION= 2.61
PORTREVISION= 1
CATEGORIES= mail perl5
MASTER_SITES= http://spamassassin.org/released/ \
${MASTER_SITE_PERL_CPAN}
@ -51,6 +52,17 @@ MAN1= spamd.1 spamassassin.1 spamc.1 sa-learn.1
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
@ -59,9 +71,12 @@ post-patch:
${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}

View File

@ -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
# PROVIDE: spamd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: FreeBSD shutdown
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
#
# Add the following lines to /etc/rc.conf to enable spamd:
#
#spamd_enable="YES"
#
# See spamd(8) for flags
#
exit 0
. %%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"

View File

@ -3,7 +3,7 @@ bin/spamassassin
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