Annotation of pkgsrc/mail/postfix/Makefile, revision 1.117
1.117 ! martti 1: # $NetBSD: Makefile,v 1.116 2004/01/28 16:03:02 martti Exp $
1.1 christos 2:
1.114 martti 3: DISTNAME= postfix-2.0.18
1.1 christos 4: CATEGORIES= mail
1.63 martti 5: MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/
1.1 christos 6:
1.105 martti 7: MAINTAINER= [email protected]
1.5 tron 8: HOMEPAGE= http://www.postfix.org/
1.48 martti 9: COMMENT= Postfix SMTP server and tools
1.1 christos 10:
1.115 martti 11: DIST_SUBDIR= postfix
12:
1.112 jlam 13: PKG_INSTALLATION_TYPES= overwrite pkgviews
14:
15: USE_BUILDLINK3= yes
1.78 jlam 16: USE_PKGINSTALL= yes
1.69 wiz 17:
1.79 lukem 18: PKG_SYSCONFSUBDIR= postfix
1.108 jlam 19: POSTFIX_SPOOL= /var/spool/postfix
1.79 lukem 20:
1.93 jmmv 21: OWN_DIRS= ${POSTFIX_SPOOL}
22:
1.79 lukem 23: CCARGS+= -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
24: CCARGS+= -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\"
25: CCARGS+= -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\"
26: CCARGS+= -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
27: CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
28: CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
29:
1.28 hubertf 30: .include "../../mk/bsd.prefs.mk"
31:
1.86 jlam 32: FIX_RPATH+= AUXLIBS
33:
1.95 martti 34: .if defined(POSTFIX_USE_INET6) && ${POSTFIX_USE_INET6} == "YES"
1.112 jlam 35: . include "../../security/openssl/buildlink3.mk"
1.116 martti 36: PATCHFILES+= tls+ipv6-1.21-pf-2.0.18.patch.gz
37: PATCH_SITES+= ftp://ftp.stack.nl/pub/postfix/tls+ipv6/1.21/
1.95 martti 38: PATCH_DIST_STRIP= -p1
39: BUILD_DEFS+= POSTFIX_USE_INET6
40:
1.108 jlam 41: CCARGS+= -DHAS_SSL
42: AUXLIBS+= -L${BUILDLINK_PREFIX.openssl}/lib \
43: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib \
44: -lssl -lcrypto
45: BUILD_DEFS+= POSTFIX_USE_TLS
1.95 martti 46:
1.108 jlam 47: PLIST_SRC+= ${PKGDIR}/PLIST.tls
48: MESSAGE_SRC+= ${PKGDIR}/MESSAGE.tls
1.95 martti 49: .endif
1.50 kent 50:
1.48 martti 51: .if defined(POSTFIX_USE_PCRE) && ${POSTFIX_USE_PCRE} == "YES"
1.112 jlam 52: . include "../../devel/pcre/buildlink3.mk"
1.50 kent 53: CCARGS+= -DHAS_PCRE
1.108 jlam 54: AUXLIBS+= -L${BUILDLINK_PREFIX.pcre}/lib \
55: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.pcre}/lib \
1.71 martti 56: -lpcre
1.48 martti 57: BUILD_DEFS+= POSTFIX_USE_PCRE
1.76 martti 58: .else
59: CCARGS+= -DNO_PCRE
1.57 martti 60: .endif
61:
1.71 martti 62: .if defined(POSTFIX_USE_LDAP) && ${POSTFIX_USE_LDAP} == "YES"
1.112 jlam 63: . include "../../databases/openldap/buildlink3.mk"
1.71 martti 64: CCARGS+= -DHAS_LDAP
1.108 jlam 65: AUXLIBS+= -L${BUILDLINK_PREFIX.openldap}/lib \
1.86 jlam 66: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openldap}/lib \
1.71 martti 67: -lldap -llber
68: BUILD_DEFS+= POSTFIX_USE_LDAP
69: .endif
70:
1.57 martti 71: .if defined(POSTFIX_USE_MYSQL) && ${POSTFIX_USE_MYSQL} == "YES"
1.112 jlam 72: . include "../../databases/mysql-client/buildlink3.mk"
1.69 wiz 73: CCARGS+= -DHAS_MYSQL -I${BUILDLINK_PREFIX.mysql-client}/include/mysql
1.71 martti 74: AUXLIBS+= -L${BUILDLINK_PREFIX.mysql-client}/lib/mysql \
1.86 jlam 75: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.mysql-client}/lib/mysql \
1.71 martti 76: -lmysqlclient -lz -lm
1.57 martti 77: BUILD_DEFS+= POSTFIX_USE_MYSQL
1.19 kim 78: .endif
1.71 martti 79:
1.117 ! martti 80: .if defined(POSTFIX_USE_PGSQL) && ${POSTFIX_USE_PGSQL} == "YES"
! 81: . include "../../databases/postgresql-lib/buildlink3.mk"
! 82: . include "../../security/openssl/buildlink3.mk"
! 83: PATCHFILES+= postfix-pg.postfix-2.0.0.2.patch
! 84: PATCH_SITES+= http://www.mat.cc/postfix/
! 85: PATCH_DIST_STRIP= -p1
! 86:
! 87: CCARGS+= -DHAS_PGSQL -I${BUILDLINK_PREFIX.postgresql-lib}/include/pgsql
! 88: AUXLIBS+= -L${BUILDLINK_PREFIX.postgresql-lib}/lib -lpq \
! 89: -L${BUILDLINK_PREFIX.openssl}/lib -lcrypt
! 90: BUILD_DEFS+= POSTFIX_USE_PGSQL
! 91: .endif
! 92:
1.104 christos 93: .if defined(USE_SASL2) && ${USE_SASL2} == "YES"
94: USING_SASL=YES
1.112 jlam 95: . include "../../security/cyrus-sasl2/buildlink3.mk"
1.104 christos 96: CCARGS+= -DUSE_SASL2_AUTH
1.108 jlam 97: AUXLIBS+= -L${BUILDLINK_PREFIX.cyrus-sasl}/lib \
1.106 kleink 98: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib \
1.104 christos 99: -lsasl2
100: BUILD_DEFS+= USE_SASL2
1.107 jlam 101: .elif defined(USE_SASL) && ${USE_SASL} == "YES"
102: USING_SASL=YES
1.112 jlam 103: . include "../../security/cyrus-sasl/buildlink3.mk"
1.107 jlam 104: CCARGS+= -DUSE_SASL_AUTH
1.108 jlam 105: AUXLIBS+= -L${BUILDLINK_PREFIX.cyrus-sasl}/lib \
1.107 jlam 106: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib \
107: -lsasl
108: BUILD_DEFS+= USE_SASL
1.104 christos 109: .endif
1.71 martti 110:
1.104 christos 111: .if defined(USING_SASL)
1.107 jlam 112: PLIST_SRC+= ${PKGDIR}/PLIST.sasl
1.71 martti 113: MESSAGE_SRC+= ${PKGDIR}/MESSAGE.sasl
114: MESSAGE_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
1.67 martti 115: .endif
116:
117: MESSAGE_SRC+= ${PKGDIR}/MESSAGE
1.50 kent 118: PLIST_SRC+= ${PKGDIR}/PLIST
1.28 hubertf 119: ALL_TARGET= #empty
1.65 tron 120: MAKE_ENV= CC="${CC}" OPT="${CFLAGS}"
1.76 martti 121: MAKE_ENV+= AUXLIBS="${AUXLIBS}" CCARGS="${CCARGS}"
1.1 christos 122:
1.79 lukem 123: POSTFIX_CONF_FILES= conf/main.cf src/util/sys_defs.h postfix-install
124: POSTFIX_CONF_FILES+= conf/sample-misc.cf src/global/mail_params.h
125:
1.93 jmmv 126: FILES_SUBST+= SHAREDIR=${SHAREDIR}
127: MESSAGE_SUBST+= SHAREDIR=${SHAREDIR}
1.79 lukem 128: PLIST_SUBST+= POSTFIX_SPOOL=${POSTFIX_SPOOL}
129:
130: PKG_GROUPS?= postfix maildrop
131: PKG_USERS?= postfix:postfix::Postfix\\ User:${POSTFIX_SPOOL}
132:
133: LIBEXECDIR= ${PREFIX}/libexec/${PKGBASE}
1.93 jmmv 134: SHAREDIR= ${PREFIX}/share/examples/${PKGBASE}
1.79 lukem 135:
1.93 jmmv 136: CONF_FILES= ${SHAREDIR}/main.cf ${PKG_SYSCONFDIR}/main.cf
1.79 lukem 137: CONF_FILES+= ${SHAREDIR}/master.cf ${PKG_SYSCONFDIR}/master.cf
1.107 jlam 138: .if defined(USING_SASL)
1.109 jlam 139: . if defined(USE_SASL2)
1.112 jlam 140: MAKE_DIRS+= ${PREFIX}/lib/sasl2
1.107 jlam 141: CONF_FILES+= ${SHAREDIR}/smtpd.conf ${PREFIX}/lib/sasl2/smtpd.conf
1.109 jlam 142: . else
1.112 jlam 143: MAKE_DIRS+= ${PREFIX}/lib/sasl
1.107 jlam 144: CONF_FILES+= ${SHAREDIR}/smtpd.conf ${PREFIX}/lib/sasl/smtpd.conf
1.109 jlam 145: . endif
1.107 jlam 146: .endif
1.108 jlam 147: CONF_FILES_PERMS= # empty
1.93 jmmv 148: .for confscr in post-install postfix-files postfix-script
149: CONF_FILES_PERMS+= ${SHAREDIR}/${confscr} ${PKG_SYSCONFDIR}/${confscr} \
150: ${ROOT_USER} ${ROOT_GROUP} 755
151: .endfor
152: .undef confscr
153:
1.108 jlam 154: INSTALL_EXTRA_TMPL+= ${PKGDIR}/INSTALL
1.79 lukem 155:
1.1 christos 156: pre-configure:
1.79 lukem 157: @for i in ${POSTFIX_CONF_FILES}; do \
158: ${CP} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.dist; \
159: ${SED} -e 's|__PREFIX|'${PREFIX}'|g' \
160: -e 's|__PKG_SYSCONFDIR|'${PKG_SYSCONFDIR}'|g' \
161: < ${WRKSRC}/$${i}.dist \
162: > ${WRKSRC}/$${i}; \
163: done
1.28 hubertf 164:
165: do-configure:
1.108 jlam 166: cd ${WRKSRC} && \
167: ${SETENV} ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles \
168: 'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}'
1.1 christos 169:
1.5 tron 170: post-build:
171: ${SED} -e 's#@@PREFIX@@#${PREFIX}#g' \
1.28 hubertf 172: <${FILESDIR}/mailer.conf >${WRKDIR}/mailer.conf.postfix
1.5 tron 173:
1.1 christos 174: pre-install:
1.79 lukem 175: ${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}
176: ${INSTALL_DATA_DIR} ${SHAREDIR}
1.62 martti 177: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
1.79 lukem 178: ${INSTALL_DATA_DIR} ${LIBEXECDIR}
179: ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${SHAREDIR} ${LIBEXECDIR}
180: ${CHMOD} 755 ${SHAREDIR} ${LIBEXECDIR}
1.28 hubertf 181: -${RM} -f ${WRKSRC}/conf/*.orig
1.104 christos 182: .if defined(USING_SASL)
1.109 jlam 183: . if defined(USE_SASL2)
1.107 jlam 184: ${ECHO} "pwcheck_method: auxprop" > ${WRKDIR}/smtpd.conf
1.109 jlam 185: . else
1.107 jlam 186: ${ECHO} "pwcheck_method: sasldb" > ${WRKDIR}/smtpd.conf
1.109 jlam 187: . endif
1.110 jlam 188: ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${SHAREDIR}
1.50 kent 189: .endif
1.79 lukem 190: ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${SHAREDIR}
191: ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-files ${SHAREDIR}
192: ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${SHAREDIR}
1.93 jmmv 193: ${INSTALL_DATA} ${WRKSRC}/conf/main.cf ${SHAREDIR}
194: ${INSTALL_DATA} ${WRKSRC}/conf/master.cf ${SHAREDIR}
195: ${INSTALL_DATA} ${WRKDIR}/mailer.conf.postfix ${SHAREDIR}/mailer.conf
196:
197: do-install:
1.108 jlam 198: cd ${WRKSRC} && ${SETENV} config_directory="${SHAREDIR}" \
199: ${SH} postfix-install -non-interactive
1.1 christos 200:
1.115 martti 201: .if ${OPSYS} == "Linux"
202: .include "../../databases/db/buildlink3.mk"
203: CCARGS+= -I${BUILDLINK_PREFIX.db}/include/db2
204: AUXLIBS+= -L${BUILDLINK_PREFIX.db}/lib \
205: -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.db}/lib \
206: -ldb2
207: .endif
208:
1.1 christos 209: .include "../../mk/bsd.pkg.mk"
CVSweb <[email protected]>