diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2009-01-16 19:54:13 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2009-01-16 19:54:13 +0000 |
commit | eaa578daf7f1e17db9fe71a18f78c537e6af63cf (patch) | |
tree | 4dff2188dfa64b41b97c0d4a0c044617fd361deb /mail/noattach | |
parent | b34b48fdee7091976fe10c546c5b62ef417a1649 (diff) | |
download | ports-eaa578daf7f1e17db9fe71a18f78c537e6af63cf.tar.gz ports-eaa578daf7f1e17db9fe71a18f78c537e6af63cf.zip |
Notes
Diffstat (limited to 'mail/noattach')
-rw-r--r-- | mail/noattach/Makefile | 9 | ||||
-rw-r--r-- | mail/noattach/files/noattach.sh | 36 | ||||
-rw-r--r-- | mail/noattach/files/noattach.sh.in | 56 | ||||
-rw-r--r-- | mail/noattach/pkg-plist | 1 |
4 files changed, 60 insertions, 42 deletions
diff --git a/mail/noattach/Makefile b/mail/noattach/Makefile index c40667b5c231..669a7e31a4f5 100644 --- a/mail/noattach/Makefile +++ b/mail/noattach/Makefile @@ -7,14 +7,17 @@ PORTNAME= noattach PORTVERSION= 1.2 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ftp://ftp.rhnet.is/pub/noattach/ MAINTAINER= dinoex@FreeBSD.org COMMENT= An attachment filter for Sendmail Milter -CFLAGS+= ${PTHREAD_CFLAGS:S=""==} GNU_CONFIGURE= yes +USE_RC_SUBR= noattach.sh + +CFLAGS+= ${PTHREAD_CFLAGS:S=""==} MAN8= noattach.8 DOCSFILES= AUTHORS THANKS INSTALL NEWS README TODO ChangeLog SAMPLEFILES= README noattach.patterns noattach.patterns.johncon @@ -32,15 +35,11 @@ MAKE_ENV+= MILTER_INCLUDES="${MILTERINC}" .endif pre-configure: - @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/noattach.sh \ - > ${WRKSRC}/noattach.sh ${REINPLACE_CMD} -e 's=-pthread=${PTHREAD_LIBS}=' \ ${WRKSRC}/configure do-install: ${INSTALL_PROGRAM} ${WRKSRC}/noattach ${PREFIX}/libexec/noattach - ${INSTALL_SCRIPT} ${WRKSRC}/noattach.sh \ - ${PREFIX}/etc/rc.d/noattach.sh.sample ${INSTALL_DATA} ${WRKSRC}/examples/noattach.patterns \ ${PREFIX}/etc/noattach.patterns-dist ${INSTALL_MAN} ${WRKSRC}/noattach.8 ${PREFIX}/man/man8/ diff --git a/mail/noattach/files/noattach.sh b/mail/noattach/files/noattach.sh deleted file mode 100644 index 0e1e57103b49..000000000000 --- a/mail/noattach/files/noattach.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -if ! test -x %%PREFIX%%/libexec/noattach -then - exit 0 -fi -case "$1" in -start) - rm -f /var/run/noattach.pid /var/run/noattach - %%PREFIX%%/libexec/noattach -p local:/var/run/noattach && - echo -n ' noattach' - ;; -stop) - if test -r /var/run/noattach.pid - then - kill `head -1 /var/run/noattach.pid` - else - echo " noattach: not running" 2>&1 - fi - rm -f /var/run/noattach.pid - ;; -reload) - if test -r /var/run/noattach.pid - then - kill -USR1 `head -1 /var/run/noattach.pid` - else - echo " noattach: not running" 2>&1 - fi - ;; -*) - echo "Usage: ${0##*/}: { start | stop | reload }" >&2 - exit 64 - ;; -esac diff --git a/mail/noattach/files/noattach.sh.in b/mail/noattach/files/noattach.sh.in new file mode 100644 index 000000000000..5bccc1f557b7 --- /dev/null +++ b/mail/noattach/files/noattach.sh.in @@ -0,0 +1,56 @@ +#!/bin/sh + +# $FreeBSD$ + +# Start or stop noattach + +# PROVIDE: noattach +# REQUIRE: DAEMON +# BEFORE: mail +# KEYWORD: shutdown +# + +prefix=%%PREFIX%% + +# Define these noattach_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/noattach +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +noattach_enable=${noattach_enable:-"NO"} # Enable noattach +noattach_pidfile=${noattach_pidfile:-"/var/run/noattach.pid"} # Path to pidfile +noattach_socket=${noattach_socket:-"/var/run/noattach"} # Path to socket +noattach_flags=${noattach_flags:-""} # Flags to noattach + +. /etc/rc.subr + +name="noattach" +rcvar=`set_rcvar` +command="${prefix}/libexec/${name}" +required_files="${prefix}/etc/noattach.patterns" +start_precmd="noattach_prestart" +stop_postcmd="noattach_poststop" +reload_cmd="noattach_reload" +extra_commands="reload" + +noattach_prestart() { + /bin/rm -f "${pidfile}" "${noattach_socket}" +} + +noattach_poststop() { + /bin/rm -f "${pidfile}" "${noattach_socket}" +} + +noattach_reload() { + kill -USR1 `head -1 "${pidfile}"` +} + +load_rc_config $name +pidfile="${noattach_pidfile}" +command_args="-p local:${noattach_socket} ${noattach_flags}" + +run_rc_command "$1" + +# eof diff --git a/mail/noattach/pkg-plist b/mail/noattach/pkg-plist index 20ad03d18dae..105eea249351 100644 --- a/mail/noattach/pkg-plist +++ b/mail/noattach/pkg-plist @@ -1,5 +1,4 @@ libexec/noattach -etc/rc.d/noattach.sh.sample etc/noattach.patterns-dist %%PORTDOCS%%%%DOCSDIR%%/AUTHORS %%PORTDOCS%%%%DOCSDIR%%/INSTALL |