Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --- pkgsrc/mail/postfix/Makefile 2004/07/19 22:04:40 1.141 +++ pkgsrc/mail/postfix/Makefile 2005/04/11 21:46:22 1.161 @@ -1,22 +1,18 @@ -# $NetBSD: Makefile,v 1.141 2004/07/19 22:04:40 jlam Exp $ +# $NetBSD: Makefile,v 1.161 2005/04/11 21:46:22 tv Exp $ -DISTNAME= postfix-2.1.3 +DISTNAME= postfix-2.2.2 CATEGORIES= mail MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ -DIST_SUBDIR= postfix - -PATCHFILES+= postfix-2.1.1-canonical_classes.diff -PATCH_SITES+= ftp://ftp.gw.com/pub/people/kim/patches/ -PATCH_DIST_STRIP= -p1 MAINTAINER= martti@NetBSD.org HOMEPAGE= http://www.postfix.org/ COMMENT= Postfix SMTP server and tools -CONFLICTS+= sendmail-[0-9]* +DIST_SUBDIR= postfix + +CONFLICTS+= sendmail-[0-9]* fastforward>=0.51nb2 PKG_INSTALLATION_TYPES= overwrite pkgviews -USE_BUILDLINK3= yes .include "../../mk/bsd.prefs.mk" @@ -33,28 +29,48 @@ 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" -# Makefile.options appends to CCARGS and AUXLIBS the options needed to -# build Postfix with support for various add-on modules. It also defines -# _POSTFIX_OPTIONS, which is POSTFIX_OPTIONS filtered to only contain -# supported modules. +# options.mk appends to CCARGS and AUXLIBS the options needed to build +# Postfix with support for various add-on modules. # -.include "Makefile.options" +.include "options.mk" PKG_SYSCONFSUBDIR= postfix -LIBEXECDIR= ${PREFIX}/libexec/${PKGBASE} -DOCDIR= ${PREFIX}/share/doc/${PKGBASE} -EXAMPLEDIR= ${PREFIX}/share/examples/${PKGBASE} +LIBEXECDIR= ${PREFIX}/libexec/postfix +DOCDIR= ${PREFIX}/share/doc/postfix +EXAMPLEDIR= ${PREFIX}/share/examples/postfix FILES_SUBST+= EXAMPLEDIR=${EXAMPLEDIR} MESSAGE_SUBST+= EXAMPLEDIR=${EXAMPLEDIR} +MESSAGE_SUBST+= DOCDIR=${DOCDIR} MESSAGE_SRC+= ${PKGDIR}/MESSAGE .if exists(${PKGDIR}/MESSAGE.${OPSYS}) @@ -62,7 +78,7 @@ MESSAGE_SRC+= ${PKGDIR}/MESSAGE.${OPSYS .endif PLIST_SRC+= ${PKGDIR}/PLIST -ALL_TARGET= # empty +BUILD_TARGET= # empty MAKE_ENV= CC="${CC}" OPT="${CFLAGS}" MAKE_ENV+= AUXLIBS="${AUXLIBS}" CCARGS="${CCARGS}" @@ -84,20 +100,12 @@ CONF_FILES_PERMS+= ${EXAMPLEDIR}/${_file ${ROOT_USER} ${ROOT_GROUP} 755 .endfor .undef _file_ -.if !empty(_POSTFIX_OPTIONS:Msasl) +.if !empty(PKG_OPTIONS:Msasl) 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 +MAKE_ENV+= DEBUG= # empty do-configure: cd ${WRKSRC} && \ @@ -107,20 +115,16 @@ do-configure: post-build: @${SED} ${FILES_SUBST_SED} ${FILESDIR}/mailer.conf \ > ${WRKDIR}/mailer.conf -.if !empty(_POSTFIX_OPTIONS:Msasl) +.if !empty(PKG_OPTIONS:Msasl) ${ECHO} "pwcheck_method: ${PWCHECK_METHOD}" > ${WRKDIR}/smtpd.conf .endif -POSTFIX_EXAMPLE_FILES= LICENSE access aliases canonical header_checks \ - main.cf main.cf.default makedefs.out master.cf \ - postfix-files relocated transport virtual - do-install: ${INSTALL_DATA_DIR} ${LIBEXECDIR} ${INSTALL_DATA_DIR} ${EXAMPLEDIR} ${INSTALL_DATA_DIR} ${DOCDIR} -${RM} -f ${WRKSRC}/conf/*.orig -.if !empty(_POSTFIX_OPTIONS:Msasl) +.if !empty(PKG_OPTIONS:Msasl) ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${EXAMPLEDIR} .endif @for i in ${POSTFIX_EXAMPLE_FILES}; do \