Subject: pkg/15326: patch for mail/qmail, including rc startup script
To: None <gnats-bugs@gnats.netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: netbsd-bugs
Date: 01/21/2002 22:39:32
>Number: 15326
>Category: pkg
>Synopsis: patch for mail/qmail, including rc startup script
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jan 21 14:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Lubomir Sedlacik
>Release: NetBSD 1.5ZA
>Organization:
>Environment:
>Description:
this patch introduces the rc subsystem script for qmail and according
add-ons in Makefile and small addition to MESSAGE.
>How-To-Repeat:
>Fix:
Index: MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/MESSAGE,v
retrieving revision 1.3
diff -u -r1.3 MESSAGE
--- MESSAGE 2002/01/21 16:00:51 1.3
+++ MESSAGE 2002/01/21 22:37:21
@@ -5,4 +5,6 @@
_default line in /etc/man.conf or specify this directory in
MANPATH variable in your environment.
+ To start qmail at startup set qmail=YES in /etc/rc.conf.
+
======================================================================
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile 2002/01/21 18:45:03 1.6
+++ Makefile 2002/01/21 22:37:21
@@ -39,11 +39,16 @@
DEINSTALL_EXTRA_TMPL= ${PKGDIR}/DEINSTALL
+FILES_SUBST+= QMAILDIR=${QMAILDIR}
+FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/-e s!@/}
+
pre-build:
${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail
post-install:
+ @${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail.sh > ${WRKDIR}/qmail.sh
+ ${INSTALL_SCRIPT} ${WRKDIR}/qmail.sh ${PKG_SYSCONFBASE}/rc.d/qmail
${MKDIR} ${QMAILDIR}/alias
cd ${QMAILDIR}/alias && \
${TOUCH} .qmail-postmaster .qmail-mailer-daemon .qmail-root
NEW FILE, files/qmail.sh:
^^^^^^^^^^^^^^^^^^^^^^^^^
--- /dev/null Mon Jan 21 23:34:37 2002
+++ files/qmail.sh Mon Jan 21 22:50:23 2002
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $NetBSD$
+#
+
+# PROVIDE: mail
+# REQUIRE: LOGIN
+
+# we could do this, but make mail start late, so that things like
+# .qmail's and Mailbox'es or Maildir's are not processed until
+# the system is fully operational
+## REQUIRE: DAEMON
+
+# To start qmail at startup, copy this script to /etc/rc.d and set
+# qmail=YES in /etc/rc.conf.
+
+. /etc/rc.subr
+
+name="qmail"
+rcvar=$name
+required_files="@QMAILDIR@/rc @QMAILDIR@/control/me"
+command="@QMAILDIR@/bin/qmail-send"
+start_precmd="qmail_precmd"
+
+qmail_precmd () {
+ command="@QMAILDIR@/rc"
+ command_args="&"
+}
+
+load_rc_config $name
+run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted: