diff options
-rw-r--r-- | mail/nullmailer/Makefile | 42 | ||||
-rw-r--r-- | mail/nullmailer/distinfo | 2 | ||||
-rw-r--r-- | mail/nullmailer/files/nullmail.sh | 7 | ||||
-rw-r--r-- | mail/nullmailer/files/patch-src-Makefile.in | 33 | ||||
-rw-r--r-- | mail/nullmailer/files/pkg-install.proto (renamed from mail/nullmailer/pkg-install) | 10 | ||||
-rw-r--r-- | mail/nullmailer/files/pkg-message.proto (renamed from mail/nullmailer/pkg-message) | 2 | ||||
-rw-r--r-- | mail/nullmailer/pkg-plist | 29 |
7 files changed, 67 insertions, 58 deletions
diff --git a/mail/nullmailer/Makefile b/mail/nullmailer/Makefile index 37b345654ced..46007142a38b 100644 --- a/mail/nullmailer/Makefile +++ b/mail/nullmailer/Makefile @@ -6,21 +6,22 @@ # PORTNAME= nullmailer -# PORTVERSION= 1.00RC5 -PORTVERSION= 1.00r5 -PORTREVISION= 2 +# PORTVERSION= 1.00RC7 +PORTVERSION= 1.00r7 +PORTREVISION= 0 CATEGORIES= mail MASTER_SITES= http://untroubled.org/nullmailer/ \ ftp://mirrors.dataloss.nl/mirrors/bgware/nullmailer/%SUBDIR%/ # MASTER_SITE_SUBDIR= ${PORTVERSION} -MASTER_SITE_SUBDIR= 1.00RC5 -DISTNAME= ${PORTNAME}-1.00RC5 +MASTER_SITE_SUBDIR= 1.00RC7 +DISTNAME= ${PORTNAME}-1.00RC7 MAINTAINER= clive@FreeBSD.org COMMENT= MTA for hosts which relay to a fixed set of smart relays HAS_CONFIGURE= yes +USE_SUBMAKE= yes CXXFLAGS+= -lstdc++ MAN1= nullmailer-inject.1 sendmail.1 MAN7= nullmailer.7 @@ -28,31 +29,28 @@ MAN8= nullmailer-queue.8 nullmailer-send.8 PKGMESSAGE= ${WRKDIR}/pkg-message -.if defined(BATCH) -PLIST_SUB= LOCALSTATEDIR="${PREFIX}" -PLIST_SUB+= LOCALSTATEDIR_RM="@dirrm " -PLIST_SUB+= SPOOL="" -NMH_PREFIX= ${PREFIX} -SPOOL= spool/ -.else -PLIST_SUB= LOCALSTATEDIR="" -PLIST_SUB+= LOCALSTATEDIR_RM="@comment " -PLIST_SUB+= SPOOL="spool/" -CONFIGURE_ARGS+= --localstatedir=/var/spool -#CONFIGURE_ARGS+= --localstatedir=/var/spool --bindir='$${libexecdir}'/${PORTNAME} --sbindir='$${libexecdir}'/${PORTNAME} -.endif +LOCALSTATEDIR= /var/spool + +CONFIGURE_ARGS+= --localstatedir=${LOCALSTATEDIR} +PLIST_SUB= LOCALSTATEDIR=${LOCALSTATEDIR} +PKGINSTALL= ${WRKDIR}/pkg-install + +post-extract: + @${CAT} ${FILESDIR}/pkg-install.proto | ${SED} -e 's,%%LOCALSTATEDIR%%,${LOCALSTATEDIR},g' > ${WRKDIR}/pkg-install + @${CAT} ${FILESDIR}/pkg-message.proto | ${SED} -e 's,%%PREFIX%%,${PREFIX},' > ${PKGMESSAGE} # Pass BATCH to pkg-install for Evil Things(tm) +# Pass LOCALSTATEDIR to pkg-install for creating home directory correctly pre-install: - @BATCH="${BATCH}" NMH_PREFIX="${NMH_PREFIX}" PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @BATCH="${BATCH}" LOCALSTATEDIR="${LOCALSTATEDIR}" PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: @cd ${WRKSRC} && make install && make install-root post-install: - @${INSTALL_SCRIPT} -c files/nullmail.sh ${PREFIX}/etc/rc.d/ - @${INSTALL_DATA} -c files/remotes.sample ${PREFIX}/etc/nullmailer/ - @${CAT} ${.CURDIR}/pkg-message | ${SED} -e 's,%%PREFIX%%,${PREFIX},' > ${PKGMESSAGE} + @${INSTALL_SCRIPT} -c ${FILESDIR}/nullmail.sh ${PREFIX}/etc/rc.d/ + @${INSTALL_DATA} -c ${FILESDIR}/remotes.sample ${PREFIX}/etc/nullmailer/ + @BATCH="${BATCH}" NMH_PREFIX="${NMH_PREFIX}" PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/mail/nullmailer/distinfo b/mail/nullmailer/distinfo index c3dd25a021aa..5f608dd5ef34 100644 --- a/mail/nullmailer/distinfo +++ b/mail/nullmailer/distinfo @@ -1 +1 @@ -MD5 (nullmailer-1.00RC5.tar.gz) = 61041ff5b1e41f9280d63a04c3383144 +MD5 (nullmailer-1.00RC7.tar.gz) = 4a0bbe04ca8cf53987b7b1c27087aefe diff --git a/mail/nullmailer/files/nullmail.sh b/mail/nullmailer/files/nullmail.sh index adf6705c7890..15f5d5270e6a 100644 --- a/mail/nullmailer/files/nullmail.sh +++ b/mail/nullmailer/files/nullmail.sh @@ -24,9 +24,9 @@ case "$1" in start) echo -n ' nullmailer' if [ ! -r ${PIDFILE} ] ; then - [ -x ${PREFIX}/sbin/nullmailer-send ] && su -l ${NULLMAILUSER} -c "${PREFIX}/sbin/nullmailer-send | ${LOGGER} -p ${PRIORITY} -t ${TAG} 2>&1 &" + [ -x ${PREFIX}/sbin/nullmailer-send ] && su -l ${NULLMAILUSER} -c "${PREFIX}/sbin/nullmailer-send 2>&1 | ${LOGGER} -i -p ${PRIORITY} -t ${TAG} &" JUNK=`${PS} -ax` - PID=`${PS} -ax | ${GREP} -e nullmailer-send$ | ${AWK} '{print $1}'` + PID=`${PS} awx | ${GREP} -v awk | ${AWK} '/nullmailer-send/ {print $1}'` echo $PID > ${PIDFILE} else echo ' already running' @@ -35,8 +35,7 @@ start) stop) echo -n ' nullmailer' if [ -r ${PIDFILE} ] ; then -# ${KILL} -15 `${CAT} ${PIDFILE}` > /dev/null - ${KILLALL} -15 nullmailer-send > /dev/null + ${KILL} `${CAT} ${PIDFILE}` > /dev/null ${RM} -f ${PIDFILE} fi ;; diff --git a/mail/nullmailer/files/patch-src-Makefile.in b/mail/nullmailer/files/patch-src-Makefile.in index 15f670c33ab2..d760f0647072 100644 --- a/mail/nullmailer/files/patch-src-Makefile.in +++ b/mail/nullmailer/files/patch-src-Makefile.in @@ -1,20 +1,24 @@ ---- src/Makefile.in Sat Dec 30 07:22:57 2000 -+++ src/Makefile.in Sat Nov 9 09:34:23 2002 -@@ -68,9 +68,11 @@ - STRIP = @STRIP@ +--- src/Makefile.in~ Sat Mar 1 17:13:21 2003 ++++ src/Makefile.in Sat Mar 1 17:18:54 2003 +@@ -68,14 +68,15 @@ VERSION = @VERSION@ --bin_PROGRAMS = mailq nullmailer-inject + bin_PROGRAMS = \ +- mailq \ + nullmailer-inject + +libexecdir = @libexecdir@/nullmailer ++ + sbin_PROGRAMS = \ + nullmailer-queue \ + nullmailer-send \ +- sendmail --sbin_PROGRAMS = nullmailer-queue nullmailer-send sendmail -+bin_PROGRAMS = nullmailer-inject +libexec_PROGRAMS = mailq sendmail -+sbin_PROGRAMS = nullmailer-queue nullmailer-send - #noinst_PROGRAMS = address -@@ -95,7 +97,7 @@ + +@@ -98,7 +99,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = @@ -23,10 +27,10 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.. -@@ -192,6 +194,31 @@ +@@ -195,6 +196,30 @@ + list='$(sbin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done - +mostlyclean-libexecPROGRAMS: + +clean-libexecPROGRAMS: @@ -51,11 +55,10 @@ + list='$(libexec_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done -+ + .c.o: $(COMPILE) -c $< - -@@ -308,7 +335,7 @@ +@@ -313,7 +338,7 @@ check: check-am installcheck-am: installcheck: installcheck-am diff --git a/mail/nullmailer/pkg-install b/mail/nullmailer/files/pkg-install.proto index b2e938295af1..bee52a796ffd 100644 --- a/mail/nullmailer/pkg-install +++ b/mail/nullmailer/files/pkg-install.proto @@ -48,10 +48,11 @@ if [ x"$2" = xPRE-INSTALL ]; then if /usr/sbin/pw user show "${user}" 2>/dev/null; then echo "You already have a user \"${user}\", so I will use it." + pw usermod "${user}" -d %%LOCALSTATEDIR%%/nullmailer else echo "You need a user \"${user}\"." if ([ -n "$BATCH" ] || yesno "Would you like me to create it" y); then - /usr/sbin/pw useradd ${user} -u 522 -g ${group} -h - -d ${NMH_PREFIX}/var/${SPOOL}nullmailer \ + /usr/sbin/pw useradd ${user} -u 522 -g ${group} -h - -d %%LOCALSTATEDIR%%/nullmailer \ -s /bin/sh -c "Nullmailer Mail System" || exit echo "Done." else @@ -95,3 +96,10 @@ EOF fi fi + +if [ x"$2" = xPOST-INSTALL ]; then + if [ ! -f ${PKG_PREFIX}/etc/nullmailer/me.sample ]; then + echo "Creating \"${PKG_PREFIX}/etc/nullmailer/me.sample\"." + echo `/bin/hostname` > ${PKG_PREFIX}/etc/nullmailer/me.sample + fi +fi diff --git a/mail/nullmailer/pkg-message b/mail/nullmailer/files/pkg-message.proto index 2753ea858214..31cd29851229 100644 --- a/mail/nullmailer/pkg-message +++ b/mail/nullmailer/files/pkg-message.proto @@ -10,7 +10,7 @@ sendmail %%PREFIX%%/libexec/nullmailer/sendmail send-mail %%PREFIX%%/libexec/nullmailer/sendmail mailq %%PREFIX%%/libexec/nullmailer/mailq -WARNING! It will couse problem in case delivering to local recipients. +WARNING! It will cause problem in case delivering to local recipients. Also man nullmailer-send(8) for more details ================================================================== diff --git a/mail/nullmailer/pkg-plist b/mail/nullmailer/pkg-plist index 5d049d68bc88..7198ee0fc2f4 100644 --- a/mail/nullmailer/pkg-plist +++ b/mail/nullmailer/pkg-plist @@ -5,24 +5,25 @@ libexec/nullmailer/sendmail bin/nullmailer-inject sbin/nullmailer-queue sbin/nullmailer-send +etc/nullmailer/me.sample etc/nullmailer/remotes.sample etc/rc.d/nullmail.sh -@exec mkdir -p %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/queue -@exec chmod 700 %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/queue -@exec mkdir -p %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/tmp -@exec chmod 700 %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/tmp -@exec rm -f %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/trigger -@exec mkfifo %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/trigger -@exec chmod 600 %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/trigger -@exec chown -R nullmail %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/* +@exec mkdir -p %%LOCALSTATEDIR%%/nullmailer/queue +@exec chmod 700 %%LOCALSTATEDIR%%/nullmailer/queue +@exec mkdir -p %%LOCALSTATEDIR%%/nullmailer/tmp +@exec chmod 700 %%LOCALSTATEDIR%%/nullmailer/tmp +@exec rm -f %%LOCALSTATEDIR%%/nullmailer/trigger +@exec mkfifo %%LOCALSTATEDIR%%/nullmailer/trigger +@exec chmod 600 %%LOCALSTATEDIR%%/nullmailer/trigger +@exec chown -R nullmail %%LOCALSTATEDIR%%/nullmailer/* @exec chown nullmail %D/sbin/nullmailer-queue @exec chmod u+s %D/sbin/nullmailer-queue @exec chown nullmail %D/libexec/nullmailer/mailq @exec chmod u+s %D/libexec/nullmailer/mailq -%%LOCALSTATEDIR_RM%%var/%%SPOOL%%nullmailer/queue -%%LOCALSTATEDIR_RM%%var/%%SPOOL%%nullmailer/tmp -@unexec rm -f %%LOCALSTATEDIR%%/var/%%SPOOL%%nullmailer/trigger -@dirrm etc/nullmailer +@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer/queue ]; then rmdir %%LOCALSTATEDIR%%/nullmailer/queue; fi; +@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer/tmp ]; then rmdir %%LOCALSTATEDIR%%/nullmailer/tmp; fi; +@unexec if [ -p %%LOCALSTATEDIR%%/nullmailer/trigger ]; then rm -f %%LOCALSTATEDIR%%/nullmailer/trigger; fi; @dirrm libexec/nullmailer -%%LOCALSTATEDIR_RM%%var/%%SPOOL%%nullmailer -@unexec if [ -n "$BATCH" ]; then echo "Warning: In batch mode, I will do 'rmuser -y nullmail'"; rmuser -y nullmail; fi +@unexec t=`/bin/ls %D/etc/nullmailer`; if [ -z "$t" ]; then echo "Configuration directory is empty, remove it."; rmdir %D/etc/nullmailer; fi; +@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer ]; then rmdir %%LOCALSTATEDIR%%/nullmailer; fi +@unexec if [ -n "$BATCH" ]; then echo "Warning: In batch mode, I will do 'rmuser -y nullmail'"; rmuser -y nullmail; fi; |