2003-04-21 08:25:50 +02:00
|
|
|
# $NetBSD: Makefile,v 1.92 2003/04/21 06:25:50 martti Exp $
|
2001-03-20 14:02:04 +01:00
|
|
|
|
2003-04-21 08:25:50 +02:00
|
|
|
DISTNAME= postfix-2.0.9
|
2001-03-20 14:02:04 +01:00
|
|
|
CATEGORIES= mail
|
2002-05-15 09:09:23 +02:00
|
|
|
MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/
|
2001-03-20 14:02:04 +01:00
|
|
|
|
|
|
|
MAINTAINER= packages@netbsd.org
|
|
|
|
HOMEPAGE= http://www.postfix.org/
|
2001-12-01 13:24:23 +01:00
|
|
|
COMMENT= Postfix SMTP server and tools
|
2001-03-20 14:02:04 +01:00
|
|
|
|
|
|
|
DIST_SUBDIR= postfix
|
|
|
|
|
|
|
|
POSTFIX_SPOOL= /var/spool/postfix
|
|
|
|
|
2002-10-25 14:04:07 +02:00
|
|
|
USE_BUILDLINK2= yes
|
2003-01-28 23:03:00 +01:00
|
|
|
USE_PKGINSTALL= yes
|
2002-10-25 14:04:07 +02:00
|
|
|
|
2003-02-01 00:53:04 +01:00
|
|
|
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}\"
|
|
|
|
|
2001-03-20 14:02:04 +01:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2003-03-14 20:37:30 +01:00
|
|
|
FIX_RPATH+= AUXLIBS
|
|
|
|
|
2003-01-14 14:05:14 +01:00
|
|
|
#.if defined(POSTFIX_USE_INET6) && ${POSTFIX_USE_INET6} == "YES"
|
2003-03-21 06:21:23 +01:00
|
|
|
#PATCHFILES+= tls+ipv6-1.13-pf-2.0.7.patch.gz
|
2003-02-23 05:31:26 +01:00
|
|
|
#PATCH_SITES+= ftp://ftp.stack.nl/pub/postfix/tls+ipv6/1.13/
|
2003-01-14 14:05:14 +01:00
|
|
|
#PATCH_DIST_STRIP= -p1
|
|
|
|
#BUILD_DEFS+= POSTFIX_USE_INET6
|
|
|
|
#
|
|
|
|
#CCARGS+= -DHAS_SSL
|
|
|
|
#AUXLIBS+= -L${BUILDLINK_PREFIX.openssl}/lib \
|
2003-03-14 20:37:30 +01:00
|
|
|
# -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib \
|
2003-01-14 14:05:14 +01:00
|
|
|
# -lssl -lcrypto
|
|
|
|
#BUILD_DEFS+= POSTFIX_USE_TLS
|
|
|
|
#
|
|
|
|
#PLIST_SRC+= ${PKGDIR}/PLIST.tls
|
|
|
|
#MESSAGE_SRC+= ${PKGDIR}/MESSAGE.tls
|
|
|
|
#.endif
|
|
|
|
|
2001-12-01 13:24:23 +01:00
|
|
|
.if defined(POSTFIX_USE_PCRE) && ${POSTFIX_USE_PCRE} == "YES"
|
2002-10-25 14:04:07 +02:00
|
|
|
.include "../../devel/pcre/buildlink2.mk"
|
2001-12-03 05:47:41 +01:00
|
|
|
CCARGS+= -DHAS_PCRE
|
2002-11-26 08:20:06 +01:00
|
|
|
AUXLIBS+= -L${BUILDLINK_PREFIX.pcre}/lib \
|
2003-03-14 20:37:30 +01:00
|
|
|
-Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.pcre}/lib \
|
2002-11-26 08:20:06 +01:00
|
|
|
-lpcre
|
2001-12-01 13:24:23 +01:00
|
|
|
BUILD_DEFS+= POSTFIX_USE_PCRE
|
2003-01-25 08:22:19 +01:00
|
|
|
.else
|
|
|
|
CCARGS+= -DNO_PCRE
|
2001-03-20 14:02:04 +01:00
|
|
|
.endif
|
|
|
|
|
2002-11-26 08:20:06 +01:00
|
|
|
.if defined(POSTFIX_USE_LDAP) && ${POSTFIX_USE_LDAP} == "YES"
|
|
|
|
.include "../../databases/openldap/buildlink2.mk"
|
|
|
|
CCARGS+= -DHAS_LDAP
|
|
|
|
AUXLIBS+= -L${BUILDLINK_PREFIX.openldap}/lib \
|
2003-03-14 20:37:30 +01:00
|
|
|
-Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openldap}/lib \
|
2002-11-26 08:20:06 +01:00
|
|
|
-lldap -llber
|
|
|
|
BUILD_DEFS+= POSTFIX_USE_LDAP
|
|
|
|
.endif
|
|
|
|
|
2002-03-22 10:01:10 +01:00
|
|
|
.if defined(POSTFIX_USE_MYSQL) && ${POSTFIX_USE_MYSQL} == "YES"
|
2002-10-25 14:04:07 +02:00
|
|
|
.include "../../databases/mysql-client/buildlink2.mk"
|
|
|
|
CCARGS+= -DHAS_MYSQL -I${BUILDLINK_PREFIX.mysql-client}/include/mysql
|
2002-11-26 08:20:06 +01:00
|
|
|
AUXLIBS+= -L${BUILDLINK_PREFIX.mysql-client}/lib/mysql \
|
2003-03-14 20:37:30 +01:00
|
|
|
-Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.mysql-client}/lib/mysql \
|
2002-11-26 08:20:06 +01:00
|
|
|
-lmysqlclient -lz -lm
|
2002-03-22 10:01:10 +01:00
|
|
|
BUILD_DEFS+= POSTFIX_USE_MYSQL
|
|
|
|
.endif
|
|
|
|
|
2003-01-26 14:20:08 +01:00
|
|
|
#.if defined(POSTFIX_USE_TLS) && ${POSTFIX_USE_TLS} == "YES"
|
|
|
|
#.include "../../security/openssl/buildlink2.mk"
|
|
|
|
#PATCH_SITES+= http://people.arhea.net/dawszy/NetBSD/postfix_tls/
|
|
|
|
#PATCHFILES+= pfixtls-1.1.11.diff.gz
|
|
|
|
#PATCH_DIST_STRIP= -p1
|
|
|
|
#
|
|
|
|
#CCARGS+= -DHAS_SSL
|
|
|
|
#AUXLIBS+= -L${BUILDLINK_PREFIX.openssl}/lib \
|
2003-03-14 20:37:30 +01:00
|
|
|
# -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib \
|
2003-01-26 14:20:08 +01:00
|
|
|
# -lssl -lcrypto
|
|
|
|
#BUILD_DEFS+= POSTFIX_USE_TLS
|
|
|
|
#
|
|
|
|
#PLIST_SRC+= ${PKGDIR}/PLIST.tls
|
|
|
|
#MESSAGE_SRC+= ${PKGDIR}/MESSAGE.tls
|
|
|
|
#.endif
|
2002-11-26 08:20:06 +01:00
|
|
|
|
|
|
|
.if defined(USE_SASL) && ${USE_SASL} == "YES"
|
|
|
|
.include "../../security/cyrus-sasl/buildlink2.mk"
|
|
|
|
CCARGS+= -DUSE_SASL_AUTH
|
|
|
|
AUXLIBS+= -L${BUILDLINK_PREFIX.cyrus-sasl}/lib \
|
2003-03-14 20:37:30 +01:00
|
|
|
-Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib \
|
2002-11-26 08:20:06 +01:00
|
|
|
-lsasl
|
|
|
|
BUILD_DEFS+= USE_SASL
|
|
|
|
|
|
|
|
PLIST_SRC+= ${WRKDIR}/PLIST.sasl
|
|
|
|
MESSAGE_SRC+= ${PKGDIR}/MESSAGE.sasl
|
|
|
|
MESSAGE_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
|
2002-07-22 12:39:26 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
MESSAGE_SRC+= ${PKGDIR}/MESSAGE
|
2001-12-03 05:47:41 +01:00
|
|
|
PLIST_SRC+= ${PKGDIR}/PLIST
|
2001-03-20 14:02:04 +01:00
|
|
|
ALL_TARGET= #empty
|
2002-06-17 21:42:08 +02:00
|
|
|
MAKE_ENV= CC="${CC}" OPT="${CFLAGS}"
|
2003-01-25 08:22:19 +01:00
|
|
|
MAKE_ENV+= AUXLIBS="${AUXLIBS}" CCARGS="${CCARGS}"
|
2001-03-20 14:02:04 +01:00
|
|
|
|
2003-02-01 00:53:04 +01:00
|
|
|
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
|
|
|
|
|
2001-03-20 14:02:04 +01:00
|
|
|
pre-configure:
|
2003-02-01 00:53:04 +01:00
|
|
|
@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
|
2001-03-20 14:02:04 +01:00
|
|
|
|
|
|
|
do-configure:
|
2003-01-25 08:22:19 +01:00
|
|
|
(cd ${WRKSRC} && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles \
|
|
|
|
'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}')
|
2001-03-20 14:02:04 +01:00
|
|
|
|
|
|
|
post-build:
|
|
|
|
${SED} -e 's#@@PREFIX@@#${PREFIX}#g' \
|
|
|
|
<${FILESDIR}/mailer.conf >${WRKDIR}/mailer.conf.postfix
|
|
|
|
|
|
|
|
pre-install:
|
2003-02-01 00:53:04 +01:00
|
|
|
${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}
|
|
|
|
${INSTALL_DATA_DIR} ${SHAREDIR}
|
2002-05-14 08:57:23 +02:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
|
2003-02-01 00:53:04 +01:00
|
|
|
${INSTALL_DATA_DIR} ${LIBEXECDIR}
|
|
|
|
${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${SHAREDIR} ${LIBEXECDIR}
|
|
|
|
${CHMOD} 755 ${SHAREDIR} ${LIBEXECDIR}
|
2001-03-20 14:02:04 +01:00
|
|
|
-${RM} -f ${WRKSRC}/conf/*.orig
|
2002-01-31 22:18:37 +01:00
|
|
|
.if defined(USE_SASL) && ${USE_SASL} == "YES"
|
2002-05-14 08:57:23 +02:00
|
|
|
${ECHO} "pwcheck_method: sasldb" > ${WRKDIR}/smtpd.conf
|
2001-12-03 05:47:41 +01:00
|
|
|
${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${PREFIX}/lib/sasl
|
2002-05-14 08:57:23 +02:00
|
|
|
${ECHO} lib/sasl/smtpd.conf > ${WRKDIR}/PLIST.sasl
|
2001-12-03 05:47:41 +01:00
|
|
|
.endif
|
2003-02-01 00:53:04 +01:00
|
|
|
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
|
2002-03-06 16:07:54 +01:00
|
|
|
|
|
|
|
do-install:
|
|
|
|
(cd ${WRKSRC} && ${SH} postfix-install -non-interactive)
|
2001-03-20 14:02:04 +01:00
|
|
|
|
|
|
|
post-install:
|
2003-02-01 00:53:04 +01:00
|
|
|
${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}
|
2001-03-20 14:02:04 +01:00
|
|
|
${INSTALL_DATA} ${WRKDIR}/mailer.conf.postfix ${PREFIX}/etc
|
2003-02-01 00:53:04 +01:00
|
|
|
${LN} -sf ${SHAREDIR}/post-install ${PKG_SYSCONFDIR}
|
|
|
|
${LN} -sf ${SHAREDIR}/postfix-files ${PKG_SYSCONFDIR}
|
|
|
|
${LN} -sf ${SHAREDIR}/postfix-script ${PKG_SYSCONFDIR}
|
2001-04-09 13:45:33 +02:00
|
|
|
${INSTALL_DATA_DIR} ${POSTFIX_SPOOL}
|
2001-03-20 14:02:04 +01:00
|
|
|
${CHMOD} 755 ${POSTFIX_SPOOL}
|
|
|
|
|
|
|
|
.include "../../mk/bsd.pkg.mk"
|