summaryrefslogtreecommitdiff
path: root/mail/postfix/Makefile
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-08-07 07:58:32 +0000
committerjlam <jlam@pkgsrc.org>2004-08-07 07:58:32 +0000
commit0c0e5e112b93a53f8fd49062d63a04a01a6bbb1d (patch)
tree0d1d144fbc4f089d65a4b505c4153c884ddc3c61 /mail/postfix/Makefile
parentc889eeb7cb24a2fe8663cbc1e85058d9c3607956 (diff)
downloadpkgsrc-0c0e5e112b93a53f8fd49062d63a04a01a6bbb1d.tar.gz
Reduce the number of patches needed by Postfix by using the subst
framework and also by explicitly specifying more default values for Postfix parameters. Also pass -I/usr/pkg/include/sasl to the compiler when building using Cyrus SASLv2, which allows me to remove the patches that added an unnecessary USE_SASL2_AUTH check.
Diffstat (limited to 'mail/postfix/Makefile')
-rw-r--r--mail/postfix/Makefile37
1 files changed, 24 insertions, 13 deletions
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
index 60f848e91ed..2dc81534dd8 100644
--- a/mail/postfix/Makefile
+++ b/mail/postfix/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.147 2004/08/05 03:04:33 jlam Exp $
+# $NetBSD: Makefile,v 1.148 2004/08/07 07:58:32 jlam Exp $
DISTNAME= postfix-2.1.4
CATEGORIES= mail
@@ -33,13 +33,34 @@ CCARGS= # empty
AUXLIBS= # empty
FIX_RPATH+= AUXLIBS
-CCARGS+= -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
+# Set some default paths to override ${WRKSRC}/src/global/mail_params.h.
CCARGS+= -DDEF_QUEUE_DIR=\"${POSTFIX_QUEUE_DIR}\"
-CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
+CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
+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_MANPAGE_DIR=\"${PREFIX}/man\"
+CCARGS+= -DDEF_SAMPLE_DIR=\"${EXAMPLEDIR}\"
+CCARGS+= -DDEF_README_DIR=\"${DOCDIR}\"
+
+# Override those same default paths in the installed example main.cf.
+SUBST_CLASSES+= postfix
+SUBST_STAGE.postfix= post-configure
+SUBST_FILES.postfix= conf/main.cf src/global/mail_params.h
+SUBST_SED.postfix= \
+ -e "s|^\(queue_directory\) =.*|\1 = ${POSTFIX_QUEUE_DIR}|" \
+ -e "s|^\(command_directory\) =.*|\1 = ${PREFIX}/sbin|" \
+ -e "s|^\(daemon_directory\) =.*|\1 = ${LIBEXECDIR}|" \
+ -e "s|^\(sendmail_path\) =.*|\1 = ${PREFIX}/sbin/sendmail|" \
+ -e "s|^\(newaliases_path\) =.*|\1 = ${PREFIX}/bin/newaliases|" \
+ -e "s|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|" \
+ -e "s|^\(setgid_group\) =.*|\1 = maildrop|" \
+ -e "s|^\(manpage_directory\) =.*|\1 = ${PREFIX}/man|" \
+ -e "s|^\(sample_directory\) =.*|\1 = ${EXAMPLEDIR}|" \
+ -e "s|^\(readme_directory\) =.*|\1 = ${DOCDIR}|" \
+ -e "/^\#define DEF_SGID_GROUP[ ]/s,postdrop,maildrop,g"
# options.mk appends to CCARGS and AUXLIBS the options needed to build
# Postfix with support for various add-on modules.
@@ -88,16 +109,6 @@ MAKE_DIRS+= ${SASLLIBDIR}
CONF_FILES+= ${EXAMPLEDIR}/smtpd.conf ${SASLLIBDIR}/smtpd.conf
.endif
-POSTFIX_CONF_FILES= conf/main.cf src/util/sys_defs.h \
- src/global/mail_params.h postfix-install
-
-pre-configure:
- @for i in ${POSTFIX_CONF_FILES}; do \
- ${CP} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.dist; \
- ${SED} ${FILES_SUBST_SED} ${WRKSRC}/$${i}.dist \
- > ${WRKSRC}/$${i}; \
- done
-
do-configure:
cd ${WRKSRC} && \
${SETENV} ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles \