aboutsummaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2006-10-07 11:47:19 +0000
committerPav Lucistnik <pav@FreeBSD.org>2006-10-07 11:47:19 +0000
commite372d6015353d011b84283f3174e54df4bb72408 (patch)
treee5e080c86501ba1bd8c80ec0b19f70bd45e6c63c /mail
parentb86a7a3ba91769b5259ac3bcd6dbadbc5e9d1c36 (diff)
Notes
Diffstat (limited to 'mail')
-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