aboutsummaryrefslogtreecommitdiff
path: root/mail/dk-milter
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2006-01-15 09:11:04 +0000
committerPav Lucistnik <pav@FreeBSD.org>2006-01-15 09:11:04 +0000
commit853594a45b15f5eb55d6bb39a140fc978010dc03 (patch)
tree6b079c487ec18fb9ccac62c414020ee55d34ce0c /mail/dk-milter
parent1068fca2cf10ed0964e2012275b60f63b170a24d (diff)
downloadports-853594a45b15f5eb55d6bb39a140fc978010dc03.tar.gz
ports-853594a45b15f5eb55d6bb39a140fc978010dc03.zip
Notes
Diffstat (limited to 'mail/dk-milter')
-rw-r--r--mail/dk-milter/Makefile5
-rw-r--r--mail/dk-milter/files/milter-dk.sh.in91
-rw-r--r--mail/dk-milter/pkg-plist1
3 files changed, 46 insertions, 51 deletions
diff --git a/mail/dk-milter/Makefile b/mail/dk-milter/Makefile
index ecd24679c9e8..369d81467ec3 100644
--- a/mail/dk-milter/Makefile
+++ b/mail/dk-milter/Makefile
@@ -7,6 +7,7 @@
PORTNAME= dk-milter
PORTVERSION= 0.3.2
+PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= dk-milter
@@ -14,6 +15,8 @@ MASTER_SITE_SUBDIR= dk-milter
MAINTAINER= ports@FreeBSD.org
COMMENT= Domainkeys milter for Sendmail
+USE_RC_SUBR= milter-dk.sh
+
.if !defined(SENDMAIL_MILTER_IN_BASE)
.if defined(SENDMAIL_WITH_SHARED_MILTER)
LIB_DEPENDS+= milter.3:${PORTSDIR}/mail/${SENDMAIL_MILTER_PORT}
@@ -59,8 +62,6 @@ post-install:
-${STRIP_CMD} ${PREFIX}/libexec/dk-filter
${INSTALL_SCRIPT} ${WRKSRC}/dk-filter/gentxt.csh \
${PREFIX}/sbin/gentxt
- ${INSTALL_DATA} ${WRKDIR}/milter-dk.sh \
- ${PREFIX}/etc/rc.d/milter-dk.sh.sample
.for i in ${MAN8}
@${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8/
diff --git a/mail/dk-milter/files/milter-dk.sh.in b/mail/dk-milter/files/milter-dk.sh.in
index 702efab14bde..d6eb86a11494 100644
--- a/mail/dk-milter/files/milter-dk.sh.in
+++ b/mail/dk-milter/files/milter-dk.sh.in
@@ -1,51 +1,46 @@
#!/bin/sh
#
# $FreeBSD$
-#
-if ! test -x %%PREFIX%%/libexec/dk-filter
-then
- exit 0
-fi
-dk_filter_args="-d example.com -c nofws -H -m MSA -s /var/db/domainkeys/default.key.pem -S default"
-case "$1" in
-start)
- sh "${0}" wait
- rm -f /var/run/dk-filter.pid /var/run/dk-filter
- %%PREFIX%%/libexec/dk-filter -l -p local:/var/run/dk-filter \
- -P /var/run/dk-filter.pid ${dk_filter_args}
- echo -n ' dk-filter'
- ;;
-stop)
- if test -r /var/run/dk-filter.pid
- then
- kill `head -1 /var/run/dk-filter.pid`
- else
- echo " dk-filter: not running" 2>&1
- fi
- sh "${0}" wait
- rm -f /var/run/dk-filter.pid
- ;;
-wait)
- while ps -axw -o pid,command | egrep "^[0-9]+ %%PREFIX%%/libexec/dk-filter "
- do
- echo "please wait"
- sleep 1
- done
- ;;
-restart)
- "$0" stop
- "$0" start
- ;;
-status)
- if [ -z "$(ps -axw -o pid,command | egrep "^[0-9]+ %%PREFIX%%/libexec/dk-filter ")" ]
- then
- echo "FAILED dk-filter is not running!"
- else
- echo "OK dk-filter is running!"
- fi
- ;;
-*)
- echo "Usage: ${0##*/}: {start|stop|restart|status}" >&2
- exit 64
- ;;
-esac
+#
+
+# PROVIDE: milterdk
+# REQUIRE: DAEMON
+# BEFORE: sendmail
+# KEYWORD: shutdown
+
+# Define these milterdk_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/milterdk
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+milterdk_enable=${milterdk_enable:-"NO"}
+milterdk_socket=${milterdk_socket:-"local:/var/run/dk-filter"}
+milterdk_pid=${milterdk_pid:-"/var/run/dk-filter.pid"}
+milterdk_domain=${milterdk_domain:-"example.com"}
+milterdk_key=${milterdk_key:-"/var/db/domainkeys/default.key.pem"}
+milterdk_flags=${milterdk_flags:-"-d ${milterdk_domain} -c nofws -H -m MSA \
+-s ${milterdk_key} -S default"}
+
+. %%RC_SUBR%%
+
+name="milterdk"
+pidfile=${milterdk_pid}
+rcvar=`set_rcvar`
+command="%%PREFIX%%/libexec/dk-filter"
+command_args="-l -p ${milterdk_socket} -P ${milterdk_pid}"
+stop_postcmd="dk_postcmd"
+
+load_rc_config $name
+
+dk_postcmd ()
+{
+ if [ -S ${milterdk_socket##local:} ] ; then
+ rm -f ${milterdk_socket##local:}
+ elif [ -S ${milterdk_socket##unix:} ] ; then
+ rm -f ${milterdk_socket##unix:}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/mail/dk-milter/pkg-plist b/mail/dk-milter/pkg-plist
index 941bc55da47c..7dad930eefde 100644
--- a/mail/dk-milter/pkg-plist
+++ b/mail/dk-milter/pkg-plist
@@ -1,4 +1,3 @@
-etc/rc.d/milter-dk.sh.sample
libexec/dk-filter
sbin/gentxt
%%PORTDOCS%%%%DOCSDIR%%/FEATURES