pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mail/nullmailer fix the DESTDIR support by removing th...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b7d0663e23d8
branches: trunk
changeset: 400259:b7d0663e23d8
user: plunky <plunky%pkgsrc.org@localhost>
date: Wed Oct 14 21:13:41 2009 +0000
description:
fix the DESTDIR support by removing the install-root target which
would otherwise cause a chown of the trigger file. (with DESTDIR,
the "nullmail" user & group are not yet created)
Because this leaves the trigger file possibly owned by root, add
a test in the rc "start" path to [re]make it when necessary.
put this test and the daemon background and logging into a
separate script so that it can be run by the rc framework as the
nullmail user in the normal way, and add a procname argument to
allow the "status" and "stop" rc commands to work properly.
bump PKGREVISION
diffstat:
mail/nullmailer/Makefile | 12 +++++++-----
mail/nullmailer/PLIST | 3 ++-
mail/nullmailer/files/nullmailer-daemon | 13 +++++++++++++
mail/nullmailer/files/nullmailer.sh | 13 +++----------
4 files changed, 25 insertions(+), 16 deletions(-)
diffs (116 lines):
diff -r 194e69aa0029 -r b7d0663e23d8 mail/nullmailer/Makefile
--- a/mail/nullmailer/Makefile Wed Oct 14 20:06:41 2009 +0000
+++ b/mail/nullmailer/Makefile Wed Oct 14 21:13:41 2009 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.31 2009/10/13 13:55:28 plunky Exp $
+# $NetBSD: Makefile,v 1.32 2009/10/14 21:13:41 plunky Exp $
DISTNAME= nullmailer-1.04
+PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${HOMEPAGE:Q}
@@ -10,7 +11,7 @@
LICENSE= gnu-gpl-v2
-# PKG_DESTDIR_SUPPORT= user-destdir
+PKG_DESTDIR_SUPPORT= user-destdir
USE_LANGUAGES= c c++
GNU_CONFIGURE= yes
@@ -19,8 +20,6 @@
CONFIGURE_ARGS+= --bindir=${PREFIX}/libexec/nullmailer
CONFIGURE_ARGS+= --sbindir=${PREFIX}/libexec/nullmailer
-INSTALL_TARGET= install install-data-local install-root
-
.include "../../mk/bsd.prefs.mk"
NULLMAILER_GROUP?= nullmail
@@ -50,7 +49,7 @@
${NULLMAILER_USER} ${NULLMAILER_GROUP} 4555
SUBST_CLASSES+= paths
-SUBST_FILES.paths= ${WRKDIR}/mailer.conf
+SUBST_FILES.paths= ${WRKDIR}/mailer.conf ${WRKDIR}/nullmailer-daemon
SUBST_FILES.paths+= doc/nullmailer-send.8 doc/nullmailer-queue.8
SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.paths+= -e 's,@VARBASE@,${VARBASE},g'
@@ -62,11 +61,14 @@
post-extract:
${CP} ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf
+ ${CP} ${FILESDIR}/nullmailer-daemon ${WRKDIR}/nullmailer-daemon
post-install:
cd ${WRKSRC} && ${INSTALL_DATA} AUTHORS BUGS COPYING ChangeLog \
HOWTO NEWS README TODO ${DESTDIR}${PREFIX}/share/doc/nullmailer
${INSTALL_DATA} ${WRKDIR}/mailer.conf \
${DESTDIR}${PREFIX}/share/examples/nullmailer/
+ ${INSTALL_SCRIPT} ${WRKDIR}/nullmailer-daemon \
+ ${DESTDIR}${PREFIX}/libexec/nullmailer/
.include "../../mk/bsd.pkg.mk"
diff -r 194e69aa0029 -r b7d0663e23d8 mail/nullmailer/PLIST
--- a/mail/nullmailer/PLIST Wed Oct 14 20:06:41 2009 +0000
+++ b/mail/nullmailer/PLIST Wed Oct 14 21:13:41 2009 +0000
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST,v 1.9 2009/06/14 18:04:39 joerg Exp $
+@comment $NetBSD: PLIST,v 1.10 2009/10/14 21:13:41 plunky Exp $
libexec/nullmailer/mailq
+libexec/nullmailer/nullmailer-daemon
libexec/nullmailer/nullmailer-inject
libexec/nullmailer/nullmailer-queue
libexec/nullmailer/nullmailer-send
diff -r 194e69aa0029 -r b7d0663e23d8 mail/nullmailer/files/nullmailer-daemon
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/nullmailer/files/nullmailer-daemon Wed Oct 14 21:13:41 2009 +0000
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# ensure that the trigger fifo exists and we own it, then start up
+# nullmailer-send with logging and detach
+
+trigger="@VARBASE@/spool/nullmailer/trigger"
+
+if [ ! -p ${trigger} -o ! -O ${trigger} -o ! -G ${trigger} ]; then
+ rm -f ${trigger}
+ mkfifo -m 0600 ${trigger}
+fi
+
+@PREFIX@/libexec/nullmailer/nullmailer-send 2>&1 | logger -t nullmailer -p mail.info &
diff -r 194e69aa0029 -r b7d0663e23d8 mail/nullmailer/files/nullmailer.sh
--- a/mail/nullmailer/files/nullmailer.sh Wed Oct 14 20:06:41 2009 +0000
+++ b/mail/nullmailer/files/nullmailer.sh Wed Oct 14 21:13:41 2009 +0000
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: nullmailer.sh,v 1.3 2009/10/11 10:22:51 plunky Exp $
+# $NetBSD: nullmailer.sh,v 1.4 2009/10/14 21:13:41 plunky Exp $
#
# PROVIDE: mail
# REQUIRE: LOGIN
@@ -12,20 +12,13 @@
name="nullmailer"
rcvar=${name}
required_files="@PKG_SYSCONFDIR@/nullmailer/remotes"
-required_files="${required_files} @VARBASE@/spool/nullmailer/trigger"
required_dirs="@VARBASE@/spool/nullmailer/queue @VARBASE@/spool/nullmailer/tmp"
-command="@PREFIX@/libexec/nullmailer/nullmailer-send"
-start_cmd="nullmailer_start"
+command="@PREFIX@/libexec/nullmailer/nullmailer-daemon"
+procname="@PREFIX@/libexec/nullmailer/nullmailer-send"
nullmailer_user="@NULLMAILER_USER@"
nullmailer_group="@NULLMAILER_GROUP@"
-nullmailer_start()
-{
-
- ${command} 2>&1 | logger -t ${name} -p mail.info &
-}
-
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index