diff options
author | grant <grant@pkgsrc.org> | 2004-03-07 10:13:46 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2004-03-07 10:13:46 +0000 |
commit | 5bab0492f1cbde021f865269ad68b9f52a30737c (patch) | |
tree | b54e6f9d4a74a018d74df659cd65d0afccc3bfe8 /mail/postfix | |
parent | 5f2459f81d699a473e83926718a4a4f6ab74a6b4 (diff) | |
download | pkgsrc-5bab0492f1cbde021f865269ad68b9f52a30737c.tar.gz |
install rc.subr-style script on all platforms but NetBSD-1.5 and above
(which already has a suitable /etc/rc.d/postfix).
Diffstat (limited to 'mail/postfix')
-rw-r--r-- | mail/postfix/Makefile | 8 | ||||
-rw-r--r-- | mail/postfix/files/postfix.sh | 41 |
2 files changed, 48 insertions, 1 deletions
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index a1d96e4594a..bbb49fa305d 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -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 @@ CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\" .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 --git a/mail/postfix/files/postfix.sh b/mail/postfix/files/postfix.sh new file mode 100644 index 00000000000..a91f7104503 --- /dev/null +++ b/mail/postfix/files/postfix.sh @@ -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" |