pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/postfix install rc.subr-style script on all platf...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b7fadb384ed3
branches:  trunk
changeset: 470217:b7fadb384ed3
user:      grant <grant%pkgsrc.org@localhost>
date:      Sun Mar 07 10:13:46 2004 +0000

description:
install rc.subr-style script on all platforms but NetBSD-1.5 and above
(which already has a suitable /etc/rc.d/postfix).

diffstat:

 mail/postfix/Makefile         |   8 +++++++-
 mail/postfix/files/postfix.sh |  41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletions(-)

diffs (67 lines):

diff -r fecf7882cf78 -r b7fadb384ed3 mail/postfix/Makefile
--- a/mail/postfix/Makefile     Sun Mar 07 09:31:16 2004 +0000
+++ b/mail/postfix/Makefile     Sun Mar 07 10:13:46 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.120 2004/03/06 06:52:43 grant Exp $
+# $NetBSD: Makefile,v 1.121 2004/03/07 10:13:46 grant Exp $
 
 DISTNAME=      postfix-2.0.18
 PKGREVISION=   1
@@ -30,6 +30,12 @@
 
 .include "../../mk/bsd.prefs.mk"
 
+# NetBSD 1.5 and above has /etc/rc.d/postfix already which is
+# suitable.
+.if empty(MACHINE_PLATFORM:MNetBSD-1.[5-9]*-*)
+RCD_SCRIPTS=   postfix
+.endif
+
 FIX_RPATH+=    AUXLIBS
 
 BUILD_DEFS+=   POSTFIX_USE_INET6
diff -r fecf7882cf78 -r b7fadb384ed3 mail/postfix/files/postfix.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/postfix/files/postfix.sh     Sun Mar 07 10:13:46 2004 +0000
@@ -0,0 +1,41 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: postfix.sh,v 1.1 2004/03/07 10:13:46 grant Exp $
+#
+
+# PROVIDE: mail
+# REQUIRE: LOGIN
+#      we make mail start late, so that things like .forward's are not
+#      processed until the system is fully operational
+
+. /etc/rc.subr
+
+name="postfix"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/main.cf"
+start_precmd="postfix_precmd"
+start_cmd="${name} "'${rc_arg}'
+stop_cmd=$start_cmd
+reload_cmd=$start_cmd
+extra_commands="reload"
+spooletcdir="/var/spool/${name}/etc"
+required_dirs=$spooletcdir
+
+postfix_precmd()
+{
+       # As this is called after the is_running and required_dir checks
+       # are made in run_rc_command(), we can safely assume ${spooletcdir}
+       # exists and postfix isn't running at this point (unless forcestart
+       # is used).
+       #
+
+       for f in localtime resolv.conf services; do
+               if [ -f /etc/$f ]; then
+                       cmp -s /etc/$f ${spooletcdir}/$f || \
+                           cp -p /etc/$f ${spooletcdir}/$f
+               fi
+       done
+}
+
+load_rc_config $name
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index