pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/security/smtpd Kill the post-install script. The examp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7c9b0334ba43
branches:  trunk
changeset: 501825:7c9b0334ba43
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Oct 29 19:49:40 2005 +0000

description:
Kill the post-install script. The example files are installed under
${PREFIX}/share/examples/smtpd, the spool setup moved into a newly added
rc script. This also handles missing configurations files better, since
the old post-install would fail e.g. if no local time was configured.

Bump revision.

diffstat:

 security/smtpd/MESSAGE           |   5 +++--
 security/smtpd/Makefile          |  25 ++++++++++---------------
 security/smtpd/PLIST             |   7 ++++++-
 security/smtpd/files/smtpfwdd.sh |  30 ++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 18 deletions(-)

diffs (119 lines):

diff -r 13e07e8872cd -r 7c9b0334ba43 security/smtpd/MESSAGE
--- a/security/smtpd/MESSAGE    Sat Oct 29 19:44:51 2005 +0000
+++ b/security/smtpd/MESSAGE    Sat Oct 29 19:49:40 2005 +0000
@@ -1,11 +1,12 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.2 2002/09/24 12:30:35 wiz Exp $
+$NetBSD: MESSAGE,v 1.3 2005/10/29 19:49:40 joerg Exp $
 
 The necessary spool and configuration directories were created
 under /var/spool/smtpd. Please edit /var/spool/smtpd/etc/smtp_check_rules
 according to your taste.
 
-You will want to start smtpfwdd in rc.local, and add a line like
+You will want to start smtpfwdd with the provided rc script,
+and add a line like
 
 smtp   stream  tcp     nowait  root    ${PREFIX}/sbin/smtpd    smtpd
 
diff -r 13e07e8872cd -r 7c9b0334ba43 security/smtpd/Makefile
--- a/security/smtpd/Makefile   Sat Oct 29 19:44:51 2005 +0000
+++ b/security/smtpd/Makefile   Sat Oct 29 19:49:40 2005 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2005/06/17 03:50:32 jlam Exp $
+# $NetBSD: Makefile,v 1.13 2005/10/29 19:49:40 joerg Exp $
 #
 
 DISTNAME=      smtpd-2.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    mail security
 MASTER_SITES=  ftp://ftp.obtuse.com/pub/smtpd/
 
@@ -14,8 +14,13 @@
 
 SPOOL=         /var/spool/smtpd
 
+USE_PKGINSTALL=        yes
+RCD_SCRIPTS=   smtpfwdd
+FILES_SUBST+=  SPOOL=${SPOOL:Q}
+
 # taken directly from the Makefile.
 CFLAGS.NetBSD= -DUSE_FLOCK -DUSE_MKSTEMP
+CFLAGS.DragonFly=      -DUSE_FLOCK -DUSE_MKSTEMP
 CFLAGS.SunOS=  -DUSE_LOCKF -DNEEDS_FCNTL_H -DNEEDS_STRINGS_H -DBROKEN_SUN_INCLUDES
 CFLAGS.IRIX=   -DGETOPT_EOF -DUSE_FLOCK -DNEEDS_FCNTL_H -DNEEDS_BSTRING_H -DIRIX_BROKEN_INCLUDES
 CFLAGS.AIX=    -DGETOPT_EOF -DUSE_LOCKF -DNEEDS_FCNTL_H -DNEEDS_LOCKF_H -DNEEDS_STRINGS_H -DNEEDS_SELECT_H
@@ -34,20 +39,10 @@
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/smtpd
        ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/smtpd
        ${INSTALL_DATA} ${WRKSRC}/INSTALL ${PREFIX}/share/doc/smtpd
-
-post-install:
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/smtpd
 .for f in antirelay_check_rules_example antispam_check_rules.example \
-       smtpd_check_rules.example
-       ${INSTALL_DATA} ${WRKSRC}/${f} ${SPOOL}/etc
+           smtpd_check_rules.example
+               ${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/share/examples/smtpd
 .endfor
-       ${CHOWN} -R uucp ${SPOOL}
-       ${CHGRP} -R mail ${SPOOL}
-       ${CHMOD} -R g=,o= ${SPOOL}
-       ${CP} /etc/resolv.conf ${SPOOL}/etc
-.if ${OPSYS} == "SunOS"
-       ${CP} /etc/TIMEZONE ${SPOOL}/etc
-.else
-       ${CP} /etc/localtime ${SPOOL}/etc
-.endif
 
 .include "../../mk/bsd.pkg.mk"
diff -r 13e07e8872cd -r 7c9b0334ba43 security/smtpd/PLIST
--- a/security/smtpd/PLIST      Sat Oct 29 19:44:51 2005 +0000
+++ b/security/smtpd/PLIST      Sat Oct 29 19:49:40 2005 +0000
@@ -1,5 +1,10 @@
-@comment $NetBSD: PLIST,v 1.1 2001/11/01 01:17:48 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2005/10/29 19:49:40 joerg Exp $
 sbin/smtpd
 sbin/smtpfwdd
 share/doc/smtpd/INSTALL
 share/doc/smtpd/README
+share/examples/smtpd/antirelay_check_rules_example
+share/examples/smtpd/antispam_check_rules.example
+share/examples/smtpd/smtpd_check_rules.example
+share/examples/rc.d/smtpfwdd
+@dirrm share/examples/smtpd
diff -r 13e07e8872cd -r 7c9b0334ba43 security/smtpd/files/smtpfwdd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/smtpd/files/smtpfwdd.sh  Sat Oct 29 19:49:40 2005 +0000
@@ -0,0 +1,30 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: smtpfwdd.sh,v 1.1 2005/10/29 19:49:40 joerg Exp $
+#
+# PROVIDE: smtpfwdd
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name=smtpfwdd
+rcvar=$name
+start_precmd=smtpd_precmd
+command="@PREFIX@/sbin/smtpfwdd"
+
+SPOOL="@SPOOL@"
+
+smtpd_precmd()
+{
+       (umask 077 && mkdir -p ${SPOOL}/etc)
+
+       for f in TIMEZONE localtime resolv.conf; do
+               if [ -f /etc/$f ]; then
+                       cmp -s /etc/$f ${SPOOL}/etc/$f ||
+                           cp -p /etc/$f ${SPOOL}/etc/$f
+               fi
+       done
+}
+
+load_rc_config $name
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index