summaryrefslogtreecommitdiff
path: root/mail/postfix
diff options
context:
space:
mode:
authorlukem <lukem@pkgsrc.org>2003-01-31 23:53:04 +0000
committerlukem <lukem@pkgsrc.org>2003-01-31 23:53:04 +0000
commit383904a80b74885e86c87868b63e9589a61c332f (patch)
tree909ad17e7ef7e72c75924096ade204ce01411c8f /mail/postfix
parent5d1a5a5fda898b67613b81c9e9ffd6e2c73d3b61 (diff)
downloadpkgsrc-383904a80b74885e86c87868b63e9589a61c332f.tar.gz
+ Use PKG_SYSCONFDIR (/usr/pkg/etc/postfix) instead of /etc/postfix for
configuration. + Document how to use /etc/rc.conf.d/postfix on NetBSD 1.5 and newer to start /usr/pkg/sbin/postfix instead of /usr/sbin/postfix + Ensure that the postfix user and the postfix & maildrop groups exist. Adds Darwin support, and prevents a working NetBSD postfix setup from being broken on a "make install" of this package because the package used to change /etc/postfix/{post-install,postfix-files,postfix-script}. These changes are mostly from Amitai Schlair <schmonz@netbsd.org>, with some tweaks by me. (Thanks Amitai!)
Diffstat (limited to 'mail/postfix')
-rw-r--r--mail/postfix/MESSAGE14
-rw-r--r--mail/postfix/Makefile98
-rw-r--r--mail/postfix/PLIST19
-rw-r--r--mail/postfix/distinfo5
-rw-r--r--mail/postfix/patches/patch-ab21
-rw-r--r--mail/postfix/patches/patch-af4
6 files changed, 74 insertions, 87 deletions
diff --git a/mail/postfix/MESSAGE b/mail/postfix/MESSAGE
index 5f2800efb5d..46573ea6943 100644
--- a/mail/postfix/MESSAGE
+++ b/mail/postfix/MESSAGE
@@ -1,9 +1,19 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1 2002/05/14 06:57:23 martti Exp $
+$NetBSD: MESSAGE,v 1.2 2003/01/31 23:53:04 lukem Exp $
To activate postfix:
-- Check the configuration files in /etc/postfix (see ${PREFIX}/share/postfix)
+- Check the configuration files in ${PKG_SYSCONFDIR}
+ (see ${PREFIX}/share/postfix)
- Modify /etc/mailer.conf (see ${PREFIX}/etc/mailer.conf.postfix)
- Set postfix=YES in /etc/rc.conf
+
+If you are running NetBSD 1.5 (or newer), the existing /etc/rc.d/postfix
+can be forced to start ${PREFIX}/sbin/postfix instead of /usr/sbin/postfix,
+by adding the following lines to /etc/rc.conf.d/postfix:
+ required_files='${PREFIX}/etc/postfix/main.cf'
+ start_cmd='${PREFIX}/sbin/postfix start'
+ stop_cmd='${PREFIX}/sbin/postfix stop'
+ reload_cmd='${PREFIX}/sbin/postfix reload'
+
===========================================================================
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
index f22a22507cf..dbd0c81e7ef 100644
--- a/mail/postfix/Makefile
+++ b/mail/postfix/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.78 2003/01/28 22:03:36 jlam Exp $
+# $NetBSD: Makefile,v 1.79 2003/01/31 23:53:04 lukem Exp $
DISTNAME= postfix-2.0.3
+PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/
@@ -15,6 +16,15 @@ POSTFIX_SPOOL= /var/spool/postfix
USE_BUILDLINK2= yes
USE_PKGINSTALL= yes
+PKG_SYSCONFSUBDIR= postfix
+
+CCARGS+= -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
+CCARGS+= -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\"
+CCARGS+= -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\"
+CCARGS+= -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
+CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
+CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
+
.include "../../mk/bsd.prefs.mk"
#.if defined(POSTFIX_USE_INET6) && ${POSTFIX_USE_INET6} == "YES"
@@ -97,28 +107,29 @@ ALL_TARGET= #empty
MAKE_ENV= CC="${CC}" OPT="${CFLAGS}"
MAKE_ENV+= AUXLIBS="${AUXLIBS}" CCARGS="${CCARGS}"
+POSTFIX_CONF_FILES= conf/main.cf src/util/sys_defs.h postfix-install
+POSTFIX_CONF_FILES+= conf/sample-misc.cf src/global/mail_params.h
+
+PLIST_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
+PLIST_SUBST+= POSTFIX_SPOOL=${POSTFIX_SPOOL}
+
+PKG_GROUPS?= postfix maildrop
+PKG_USERS?= postfix:postfix::Postfix\\ User:${POSTFIX_SPOOL}
+
+LIBEXECDIR= ${PREFIX}/libexec/${PKGBASE}
+SHAREDIR= ${PREFIX}/share/${PKGBASE}
+
+CONF_FILES+= ${SHAREDIR}/main.cf ${PKG_SYSCONFDIR}/main.cf
+CONF_FILES+= ${SHAREDIR}/master.cf ${PKG_SYSCONFDIR}/master.cf
+
pre-configure:
- ${CP} ${WRKSRC}/conf/main.cf ${WRKSRC}/conf/main.cf.dist
- ${SED} -e 's:__PREFIX:'${PREFIX}':g' \
- < ${WRKSRC}/conf/main.cf.dist \
- > ${WRKSRC}/conf/main.cf
- ${CP} ${WRKSRC}/src/util/sys_defs.h ${WRKSRC}/src/util/sys_defs.h.dist
- ${SED} -e 's:__PREFIX:'${PREFIX}':g' \
- < ${WRKSRC}/src/util/sys_defs.h.dist \
- > ${WRKSRC}/src/util/sys_defs.h
- ${CP} ${WRKSRC}/postfix-install ${WRKSRC}/postfix-install.dist
- ${SED} -e 's:__PREFIX:'${PREFIX}':g' \
- < ${WRKSRC}/postfix-install.dist \
- > ${WRKSRC}/postfix-install
- ${CP} ${WRKSRC}/conf/sample-misc.cf ${WRKSRC}/conf/sample-misc.cf.dist
- ${SED} -e 's:__PREFIX:'${PREFIX}':g' \
- < ${WRKSRC}/conf/sample-misc.cf.dist \
- > ${WRKSRC}/conf/sample-misc.cf
- ${CP} ${WRKSRC}/src/global/mail_params.h \
- ${WRKSRC}/src/global/mail_params.h.dist
- ${SED} -e 's:__PREFIX:'${PREFIX}':g' \
- < ${WRKSRC}/src/global/mail_params.h.dist \
- > ${WRKSRC}/src/global/mail_params.h
+ @for i in ${POSTFIX_CONF_FILES}; do \
+ ${CP} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.dist; \
+ ${SED} -e 's|__PREFIX|'${PREFIX}'|g' \
+ -e 's|__PKG_SYSCONFDIR|'${PKG_SYSCONFDIR}'|g' \
+ < ${WRKSRC}/$${i}.dist \
+ > ${WRKSRC}/$${i}; \
+ done
do-configure:
(cd ${WRKSRC} && \
@@ -130,46 +141,37 @@ post-build:
<${FILESDIR}/mailer.conf >${WRKDIR}/mailer.conf.postfix
pre-install:
- ${INSTALL_DATA_DIR} /etc/postfix
- ${INSTALL_DATA_DIR} ${PREFIX}/share/postfix
+ ${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}
+ ${INSTALL_DATA_DIR} ${SHAREDIR}
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
- ${INSTALL_DATA_DIR} ${PREFIX}/libexec/postfix
- ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${PREFIX}/share/postfix \
- ${PREFIX}/libexec/postfix
- ${CHMOD} 755 ${PREFIX}/share/postfix ${PREFIX}/libexec/postfix
+ ${INSTALL_DATA_DIR} ${LIBEXECDIR}
+ ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${SHAREDIR} ${LIBEXECDIR}
+ ${CHMOD} 755 ${SHAREDIR} ${LIBEXECDIR}
-${RM} -f ${WRKSRC}/conf/*.orig
.if defined(USE_SASL) && ${USE_SASL} == "YES"
${ECHO} "pwcheck_method: sasldb" > ${WRKDIR}/smtpd.conf
${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${PREFIX}/lib/sasl
${ECHO} lib/sasl/smtpd.conf > ${WRKDIR}/PLIST.sasl
.endif
- ${TEST} -f /etc/postfix/postfix-files || \
- ${INSTALL_DATA} ${WRKSRC}/conf/postfix-files /etc/postfix
- ${TEST} -f /etc/postfix/postfix-script || \
- ${INSTALL_DATA} ${WRKSRC}/conf/postfix-script /etc/postfix
- ${TEST} -f /etc/postfix/main.cf || \
- ${INSTALL_DATA} ${WRKSRC}/conf/main.cf /etc/postfix
- ${TEST} -f /etc/postfix/master.cf || \
- ${INSTALL_DATA} ${WRKSRC}/conf/master.cf /etc/postfix
+ for pf in postfix-files postfix-script main.cf master.cf; do \
+ ${TEST} -f ${PKG_SYSCONFDIR}/$$pf || \
+ ${INSTALL_DATA} ${WRKSRC}/conf/$$pf ${PKG_SYSCONFDIR}; \
+ done
do-install:
(cd ${WRKSRC} && ${SH} postfix-install -non-interactive)
post-install:
- ${INSTALL_DATA} ${WRKSRC}/conf/main.cf ${PREFIX}/share/postfix
- ${INSTALL_DATA} ${WRKSRC}/conf/master.cf ${PREFIX}/share/postfix
- ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${PREFIX}/share/postfix
- ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-files ${PREFIX}/share/postfix
- ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${PREFIX}/share/postfix
+ ${INSTALL_DATA} ${WRKSRC}/conf/main.cf ${SHAREDIR}
+ ${INSTALL_DATA} ${WRKSRC}/conf/master.cf ${SHAREDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${SHAREDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-files ${SHAREDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${SHAREDIR}
${INSTALL_DATA} ${WRKDIR}/mailer.conf.postfix ${PREFIX}/etc
- ${LN} -sf ${PREFIX}/share/postfix/post-install /etc/postfix
- ${LN} -sf ${PREFIX}/share/postfix/postfix-files /etc/postfix
- ${LN} -sf ${PREFIX}/share/postfix/postfix-script /etc/postfix
+ ${LN} -sf ${SHAREDIR}/post-install ${PKG_SYSCONFDIR}
+ ${LN} -sf ${SHAREDIR}/postfix-files ${PKG_SYSCONFDIR}
+ ${LN} -sf ${SHAREDIR}/postfix-script ${PKG_SYSCONFDIR}
${INSTALL_DATA_DIR} ${POSTFIX_SPOOL}
${CHMOD} 755 ${POSTFIX_SPOOL}
- ${TEST} -f /etc/postfix/main.cf || \
- ${INSTALL_DATA} ${PREFIX}/share/postfix/main.cf /etc/postfix
- ${TEST} -f /etc/postfix/master.cf || \
- ${INSTALL_DATA} ${PREFIX}/share/postfix/master.cf /etc/postfix
.include "../../mk/bsd.pkg.mk"
diff --git a/mail/postfix/PLIST b/mail/postfix/PLIST
index 114ae68ad5e..389b92c72a8 100644
--- a/mail/postfix/PLIST
+++ b/mail/postfix/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.6 2003/01/15 17:15:04 martti Exp $
+@comment $NetBSD: PLIST,v 1.7 2003/01/31 23:53:05 lukem Exp $
bin/mailq
bin/newaliases
etc/mailer.conf.postfix
@@ -131,16 +131,13 @@ share/postfix/sample-smtp.cf
share/postfix/sample-smtpd.cf
share/postfix/sample-transport.cf
share/postfix/sample-virtual.cf
-@exec ${MKDIR} /etc/postfix
-@exec if [ ! -f /etc/postfix/main.cf ]; then cp %D/share/postfix/main.cf /etc/postfix ; fi
-@exec if [ ! -f /etc/postfix/master.cf ]; then cp %D/share/postfix/master.cf /etc/postfix ; fi
-@exec if [ ! -d /var/spool/postfix ]; then ${MKDIR} /var/spool/postfix; ${CHMOD} 755 /var/spool/postfix ; fi
-@exec ln -sf %D/share/postfix/post-install /etc/postfix
-@unexec ${RM} -f /etc/postfix/post-install
-@exec ln -sf %D/share/postfix/postfix-files /etc/postfix
-@unexec ${RM} -f /etc/postfix/postfix-files
-@exec ln -sf %D/share/postfix/postfix-script /etc/postfix
-@unexec ${RM} -f /etc/postfix/postfix-script
+@exec if [ ! -d ${POSTFIX_SPOOL} ]; then ${MKDIR} ${POSTFIX_SPOOL}; ${CHMOD} 755 ${POSTFIX_SPOOL} ; fi
+@exec ${LN} -sf %D/share/postfix/post-install ${PKG_SYSCONFDIR}
+@unexec ${RM} -f ${PKG_SYSCONFDIR}/post-install
+@exec ${LN} -sf %D/share/postfix/postfix-files ${PKG_SYSCONFDIR}
+@unexec ${RM} -f ${PKG_SYSCONFDIR}/postfix-files
+@exec ${LN} -sf %D/share/postfix/postfix-script ${PKG_SYSCONFDIR}
+@unexec ${RM} -f ${PKG_SYSCONFDIR}/postfix-script
@dirrm libexec/postfix
@dirrm share/doc/postfix
@dirrm share/postfix
diff --git a/mail/postfix/distinfo b/mail/postfix/distinfo
index c4dc8c3ac84..6ebf6dd2731 100644
--- a/mail/postfix/distinfo
+++ b/mail/postfix/distinfo
@@ -1,11 +1,10 @@
-$NetBSD: distinfo,v 1.29 2003/01/26 13:20:08 taca Exp $
+$NetBSD: distinfo,v 1.30 2003/01/31 23:53:05 lukem Exp $
SHA1 (postfix/postfix-2.0.3.tar.gz) = 6b0f06a64c3aeda1fe6a3f808fca886fd95fb1e2
Size (postfix/postfix-2.0.3.tar.gz) = 1339919 bytes
SHA1 (postfix/tls+ipv6-1.12-pf-2.0.3.patch.gz) = 2b79fc0062e56feb19c29c9f7a3a428c3691e1c6
Size (postfix/tls+ipv6-1.12-pf-2.0.3.patch.gz) = 95350 bytes
SHA1 (patch-aa) = 5bc8f2d888bea92cfa88ef154c852b63990ae03e
-SHA1 (patch-ab) = b414e4350e9004c3f45f591bc86663d9bf38464a
SHA1 (patch-ad) = d4e536f5f0d482a759da0016ea79f78b0a87455c
SHA1 (patch-ae) = daa160ef54d725ca156f29322d45efcf4af6c02a
-SHA1 (patch-af) = 7d51fa19b577bd2a2bdfe61e9b69a09ebca97593
+SHA1 (patch-af) = 0d0d57a4534141fa803a50697a34b93ef3c43689
diff --git a/mail/postfix/patches/patch-ab b/mail/postfix/patches/patch-ab
index 386583ff3b1..e69de29bb2d 100644
--- a/mail/postfix/patches/patch-ab
+++ b/mail/postfix/patches/patch-ab
@@ -1,21 +0,0 @@
-$NetBSD: patch-ab,v 1.5 2003/01/06 09:15:50 martti Exp $
-
---- src/util/sys_defs.h.orig Sun Oct 13 17:00:52 2002
-+++ src/util/sys_defs.h Sat Dec 28 08:51:26 2002
-@@ -52,11 +52,11 @@
- #define STATFS_IN_SYS_MOUNT_H
- #define HAS_POSIX_REGEXP
- #define HAS_ST_GEN /* struct stat contains inode generation number */
--#define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
--#define NATIVE_MAILQ_PATH "/usr/bin/mailq"
--#define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
--#define NATIVE_COMMAND_DIR "/usr/sbin"
--#define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
-+#define NATIVE_SENDMAIL_PATH "__PREFIX/sbin/sendmail"
-+#define NATIVE_MAILQ_PATH "__PREFIX/bin/mailq"
-+#define NATIVE_NEWALIAS_PATH "__PREFIX/bin/newaliases"
-+#define NATIVE_COMMAND_DIR "__PREFIX/sbin"
-+#define NATIVE_DAEMON_DIR "__PREFIX/libexec/postfix"
- #endif
-
- #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4)
diff --git a/mail/postfix/patches/patch-af b/mail/postfix/patches/patch-af
index b37c0e5649c..5a623678862 100644
--- a/mail/postfix/patches/patch-af
+++ b/mail/postfix/patches/patch-af
@@ -1,4 +1,4 @@
-$NetBSD: patch-af,v 1.14 2003/01/25 07:22:20 martti Exp $
+$NetBSD: patch-af,v 1.15 2003/01/31 23:53:06 lukem Exp $
--- conf/main.cf.orig Fri Jan 24 01:42:20 2003
+++ conf/main.cf Sat Jan 25 08:04:54 2003
@@ -17,7 +17,7 @@ $NetBSD: patch-af,v 1.14 2003/01/25 07:22:20 martti Exp $
+daemon_directory = __PREFIX/libexec/postfix
+
+# Shared files and etc directory
-+etc_directory = /etc/postfix
++etc_directory = __PKG_SYSCONFDIR
+share_directory = __PREFIX/share/postfix
+man_directory = __PREFIX/man