aboutsummaryrefslogtreecommitdiffstats
path: root/mail/spampd
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2006-10-07 19:47:19 +0800
committerpav <pav@FreeBSD.org>2006-10-07 19:47:19 +0800
commit2b185509615c1e78176aa6f75d44819f1248b571 (patch)
tree7f4d89cbc574059d432295ddc56455703a3f61f3 /mail/spampd
parent7331485d3e4bcac78e4fb7a5593d7ed83b916255 (diff)
downloadfreebsd-ports-gnome-2b185509615c1e78176aa6f75d44819f1248b571.tar.gz
freebsd-ports-gnome-2b185509615c1e78176aa6f75d44819f1248b571.tar.zst
freebsd-ports-gnome-2b185509615c1e78176aa6f75d44819f1248b571.zip
- Switch to rc_subr startup script. The app will now run under spamd user by
default PR: ports/99794 Submitted by: Marshal Newrock <marshal@idealso.com> Approved by: maintainer timeout (3 months)
Diffstat (limited to 'mail/spampd')
-rw-r--r--mail/spampd/Makefile4
-rw-r--r--mail/spampd/files/spampd.in47
-rw-r--r--mail/spampd/files/spampd.sh.sample21
-rw-r--r--mail/spampd/pkg-plist2
4 files changed, 50 insertions, 24 deletions
diff --git a/mail/spampd/Makefile b/mail/spampd/Makefile
index ad050045728a..cb49cfe4c8a3 100644
--- a/mail/spampd/Makefile
+++ b/mail/spampd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= spampd
PORTVERSION= 2.30
+PORTREVISION= 1
CATEGORIES= mail perl5
MASTER_SITES= http://www.worlddesign.com/Content/rd/mta/spampd/
@@ -17,10 +18,11 @@ RUN_DEPENDS= spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin \
${SITE_PERL}/Net/Server/PreForkSimple.pm:${PORTSDIR}/net/p5-Net-Server
NO_BUILD= yes
+PLIST_FILES= sbin/spampd
+USE_RC_SUBR= spampd
do-install:
@${INSTALL_SCRIPT} ${WRKSRC}/spampd ${PREFIX}/sbin
- @${INSTALL_SCRIPT} ${FILESDIR}/spampd.sh.sample ${PREFIX}/etc/rc.d
.include <bsd.port.pre.mk>
diff --git a/mail/spampd/files/spampd.in b/mail/spampd/files/spampd.in
new file mode 100644
index 000000000000..6bda0f1c0db5
--- /dev/null
+++ b/mail/spampd/files/spampd.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# PROVIDE: spampd
+#
+# Add the fellowing line to /etc/rc.conf to enable spampd:
+#
+# spampd_enable (bool): Set it to "YES" to enable spampd
+# Default is "NO"
+# spampd_flags
+
+. %%RC_SUBR%%
+
+name="spampd"
+rcvar=`set_rcvar`
+
+: ${spampd_enable="NO"}
+: ${spampd_pidfile="/var/run/spamd/spampd.pid"}
+: ${spampd_flags="--user=spamd --group=spamd --host 127.0.0.1:10024 --relayhost=127.0.0.1:10025 --dose --tagall --auto-whitelist"}
+
+load_rc_config $name
+
+command="%%PREFIX%%/sbin/$name"
+command_args="${spampd_flags} --pid=${spampd_pidfile}"
+pidfile="${spampd_pidfile}"
+sig_stop="-KILL"
+stop_cmd="stop_cmd"
+status_cmd="status_cmd"
+
+stop_cmd()
+{
+ if [ -f "$pidfile" ]; then
+ kill `cat $pidfile`
+ rm -f $pidfile
+ echo -n " spampd"
+ fi
+}
+
+status_cmd()
+{
+ if [ -f "$pidfile" ]; then
+ echo "${name} is running as pid `cat $pidfile`."
+ else
+ echo "${name} is not running."
+ fi
+}
+
+run_rc_command $1
diff --git a/mail/spampd/files/spampd.sh.sample b/mail/spampd/files/spampd.sh.sample
deleted file mode 100644
index c9ee609a7a55..000000000000
--- a/mail/spampd/files/spampd.sh.sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-start)
- if [ -x /usr/local/sbin/spampd ]; then
- /usr/local/sbin/spampd --user=uucp --group=uucp --host 127.0.0.1:10024 --relayhost=127.0.0.1:10025 --dose --tagall --auto-whitelist
- echo -n ' spampd'
- fi
- ;;
-stop)
- if [ -f /var/run/spampd.pid ]; then
- kill `cat /var/run/spampd.pid`
- rm -f /var/run/spampd.pid
- echo -n ' spampd'
- fi
- ;;
-restart)
- $0 stop
- $0 start
- ;;
-esac
diff --git a/mail/spampd/pkg-plist b/mail/spampd/pkg-plist
deleted file mode 100644
index 79736cd025aa..000000000000
--- a/mail/spampd/pkg-plist
+++ /dev/null
@@ -1,2 +0,0 @@
-sbin/spampd
-etc/rc.d/spampd.sh.sample