ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/mail/postfix211/Makefile
Revision: 24951
Committed: Sat Feb 9 22:45:53 2019 UTC (5 years, 2 months ago) by laffer1
File size: 10838 byte(s)
Log Message:
update list

File Contents

# Content
1 # $MidnightBSD$
2
3 PORTNAME= postfix
4 PORTVERSION= 2.11.5
5 PORTREVISION= 1
6 CATEGORIES= mail ipv6
7 MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
8 ftp://ftp.tux.org/pub/net/postfix/official/ \
9 ftp://ftp.utoronto.ca/mirror/packages/postfix/official/ \
10 ftp://ftp.samurai.com/pub/postfix/official/
11 MASTER_SITE_SUBDIR= . old related/postfix
12 PKGNAMESUFFIX?= 211
13 DIST_SUBDIR= ${PORTNAME}
14
15 MAINTAINER= ports@MidnightBSD.org
16 COMMENT= Secure alternative to widely-used Sendmail
17
18 LICENSE= ipl1.0
19 LICENSE_NAME= IBM PUBLIC LICENSE VERSION 1.0
20 LICENSE_FILE= ${WRKSRC}/LICENSE
21 LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
22
23 FAKE_OPTS= trueprefix
24
25 VDAVERSION= 2.10.0
26 CONFLICTS= courier-0.* postfix-1.* postfix2?-* postfix21?-* \
27 postfix-current-2.* postfix-current-base-2.* sendmail-8.* \
28 sendmail+*-8.* smail-3.* zmailer-2.* opensmtpd-[0-9]*
29
30 USERS= postfix
31 GROUPS= mail maildrop postfix
32 USES= perl5
33 USE_SUBMAKE= yes
34 USE_PERL5= build
35 SCRIPTS_ENV+= POSTFIX_DEFAULT_MTA="${POSTFIX_DEFAULT_MTA}"
36
37 OPTIONS_DEFINE= PCRE SASL2 TLS BDB MYSQL PGSQL SQLITE OPENLDAP LDAP_SASL \
38 CDB NIS VDA TEST SPF
39 PCRE_DESC= Perl Compatible Regular Expressions
40 SASL2_DESC= Cyrus SASLv2 (Simple Auth. and Sec. Layer)
41 DOVECOT_DESC= Dovecot 1.x SASL authentication method
42 DOVECOT2_DESC= Dovecot 2.x SASL authentication method
43 SASLKRB5_DESC= If your SASL req. Kerberos5, select this
44 SASLKMIT_DESC= If your SASL req. MIT Kerberos5, select this
45 TLS_DESC= SSL and TLS support
46 BDB_DESC= Berkeley DB (uses WITH_BDB_VER)
47 MYSQL_DESC= MySQL maps (uses WITH_MYSQL_VER)
48 PGSQL_DESC= PostgreSQL maps (uses DEFAULT_PGSQL_VER)
49 SQLITE_DESC= SQLite maps
50 OPENLDAP_DESC= OpenLDAP maps (uses WITH_OPENLDAP_VER)
51 LDAP_SASL_DESC= OpenLDAP client-to-server SASL auth
52 CDB_DESC= CDB maps lookups
53 NIS_DESC= NIS maps lookups
54 VDA_DESC= VDA (Virtual Delivery Agent 32Bit)
55 TEST_DESC= SMTP/LMTP test server and generator
56 SPF_DESC= SPF support (via libspf2 1.2.x)
57
58 OPTIONS_RADIO= RG1 RG2
59 OPTIONS_RADIO_RG1= DOVECOT DOVECOT2
60 OPTIONS_RADIO_RG2= SASLKRB5 SASLKMIT
61 RG1_DESC= Dovecot SASL authentication methods
62 RG2_DESC= Kerberos network authentication protocol type
63
64 OPTIONS_DEFAULT= PCRE
65
66 .include <bsd.mport.options.mk>
67
68 HTML1= body_checks.5.html bounce.5.html postfix-power.png \
69 scache.8.html tlsmgr.8.html
70
71 .if !defined(BATCH) && !defined(PACKAGE_BUILDING) && exists(/etc/mail/mailer.conf)
72 OLD_MAILER!= ${GREP} -m 1 '^purgestat' /etc/mail/mailer.conf || ${ECHO_CMD}
73 .if !empty(OLD_MAILER)
74 IS_INTERACTIVE= yes
75 .endif
76 .endif
77
78 .if ${OSVERSION} >= 4015
79 KRB5_EXTR= -lhx509
80 .endif
81
82 .if !defined(DEBUG)
83 MAKEFILEFLAGS+= DEBUG=
84 .endif
85
86 MAKEFILEFLAGS+= CC="${CC}" OPT="${CFLAGS}"
87
88 POSTFIX_CCARGS+= \$$(WARN) \
89 -DDEF_CONFIG_DIR=\\\"${LOCALBASE}/${ETCDIR_REL}\\\" \
90 -DDEF_DAEMON_DIR=\\\"${DAEMONDIR}\\\" \
91 -DDEF_COMMAND_DIR=\\\"${TRUE_PREFIX}/sbin\\\" \
92 -DDEF_SENDMAIL_PATH=\\\"${TRUE_PREFIX}/sbin/sendmail\\\" \
93 -DDEF_NEWALIAS_PATH=\\\"${TRUE_PREFIX}/bin/newaliases\\\" \
94 -DDEF_MAILQ_PATH=\\\"${TRUE_PREFIX}/bin/mailq\\\" \
95 -DDEF_MANPAGE_DIR=\\\"${TRUE_PREFIX}/man\\\" \
96 -DDEF_README_DIR=\\\"${READMEDIR}\\\" \
97 -DDEF_HTML_DIR=\\\"${READMEDIR}\\\" \
98 -DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" \
99 -DDEF_DATA_DIR=\\\"/var/db/postfix\\\" \
100 -DDEF_MAIL_OWNER=\\\"postfix\\\" \
101 -DDEF_SGID_GROUP=\\\"maildrop\\\" \
102
103 # Default requirement for postfix rc script
104 _REQUIRE= LOGIN cleanvar
105
106 .if ${PORT_OPTIONS:MPCRE}
107 LIB_DEPENDS+= pcre:${PORTSDIR}/devel/pcre
108 POSTFIX_CCARGS+= -DHAS_PCRE -I${LOCALBASE}/include
109 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lpcre
110 .else
111 POSTFIX_CCARGS+= -DNO_PCRE
112 .endif
113
114 .if ${PORT_OPTIONS:MSASL2}
115 LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
116 POSTFIX_CCARGS+= -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${LOCALBASE}/include -I${LOCALBASE}/include/sasl
117 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lsasl2 -lpam -lcrypt
118 .endif
119
120 .if ${PORT_OPTIONS:MDOVECOT} || ${PORT_OPTIONS:MDOVECOT2}
121 .if ${PORT_OPTIONS:MDOVECOT}
122 RUN_DEPENDS+= dovecot:${PORTSDIR}/mail/dovecot
123 .else
124 RUN_DEPENDS+= dovecot:${PORTSDIR}/mail/dovecot2
125 .endif
126 POSTFIX_CCARGS+= -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"
127 _REQUIRE+= dovecot
128 .endif
129
130 .if ${PORT_OPTIONS:MSASLKRB5}
131 POSTFIX_AUXLIBS+= -lkrb5 ${KRB5_EXTR} -lcrypto -lcrypt -lcom_err -lasn1 -lroken
132 .endif
133
134 .if ${PORT_OPTIONS:MSASLKMIT}
135 LIB_DEPENDS+= krb5:${PORTSDIR}/security/krb5
136 POSTFIX_AUXLIBS+= -Wl,--rpath,$${KRB5_HOME:-${LOCALBASE}}/lib -lkrb5 -lcrypto -lcrypt -lcom_err
137 .endif
138
139 .if ${PORT_OPTIONS:MTLS}
140 EXTENSIONS+= openssl
141 POSTFIX_CCARGS+= -DUSE_TLS -I${OPENSSLINC}
142 POSTFIX_AUXLIBS+= -L${OPENSSLLIB} ${LDFLAGS} -lssl -lcrypto
143 .endif
144
145 .if ${PORT_OPTIONS:MSPF}
146 LIB_DEPENDS+= spf2:${PORTSDIR}/mail/libspf2
147 PATCH_SITES+= ${MASTER_SITE_LOCAL}
148 PATCH_SITE_SUBDIR= mm
149 PATCHFILES+= postfix-2.8.0-libspf2-1.2.x-0.patch.gz
150 PATCH_DIST_STRIP= -p1
151 POSTFIX_CCARGS+= -DHAVE_NS_TYPE -DHAS_SPF -I${LOCALBASE}/include
152 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lspf2
153 PLIST_SUB+= SPF=""
154 .else
155 PLIST_SUB+= SPF="@comment "
156 .endif
157
158 .if ${PORT_OPTIONS:MBDB}
159 USE_BDB= yes
160 INVALID_BDB_VER= 6
161 POSTFIX_CCARGS+= -I${BDB_INCLUDE_DIR}
162 POSTFIX_AUXLIBS+= -L${BDB_LIB_DIR} -l${BDB_LIB_NAME}
163 .endif
164
165 .if ${PORT_OPTIONS:MMYSQL}
166 USE_MYSQL= yes
167 POSTFIX_CCARGS+= -DHAS_MYSQL -I${LOCALBASE}/include/mysql
168 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib/mysql -lmysqlclient -lz -lcrypt -lm
169 _REQUIRE+= mysql
170 .endif
171
172 .if ${PORT_OPTIONS:MPGSQL}
173 USE_PGSQL= yes
174 POSTFIX_CCARGS+= -DHAS_PGSQL -I${LOCALBASE}/include -I${LOCALBASE}/pgsql/include
175 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -L${LOCALBASE}/pgsql/lib -lpq -lcrypt
176 _REQUIRE+= postgresql
177 .endif
178
179 .if ${PORT_OPTIONS:MSQLITE}
180 USE_SQLITE= yes
181 POSTFIX_CCARGS+= -DHAS_SQLITE -I${LOCALBASE}/include
182 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lsqlite3
183 .endif
184
185 .if ${PORT_OPTIONS:MOPENLDAP}
186 USE_OPENLDAP= yes
187 .if ${PORT_OPTIONS:MOPENLDAP_VER}
188 WANT_OPENLDAP_VER= ${WITH_OPENLDAP_VER}
189 .endif
190 POSTFIX_CCARGS+= -DHAS_LDAP -I${LOCALBASE}/include
191 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lldap -llber
192 _REQUIRE+= slapd
193 .if ${PORT_OPTIONS:MLDAP_SASL}
194 .if ! ${PORT_OPTIONS:MSASL2}
195 LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
196 .endif
197 POSTFIX_CCARGS+= -I${LOCALBASE}/include/sasl -DUSE_LDAP_SASL
198 .endif
199 .endif
200
201 .if ${PORT_OPTIONS:MCDB}
202 LIB_DEPENDS+= cdb:${PORTSDIR}/databases/tinycdb
203 POSTFIX_CCARGS+= -DHAS_CDB -I${LOCALBASE}/include
204 POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lcdb
205 .endif
206
207 .if ${PORT_OPTIONS:MNIS}
208 POSTFIX_CCARGS+= -DHAS_NIS
209 _REQUIRE+= ypserv
210 .endif
211
212 .if ${PORT_OPTIONS:MVDA}
213 PATCH_SITES+= http://vda.sourceforge.net/VDA/:vda
214 PATCHFILES+= postfix-vda-v13-${VDAVERSION}.patch:vda
215 PATCH_DIST_STRIP= -p1
216 PLIST_SUB+= VDA=""
217 .else
218 PLIST_SUB+= VDA="@comment "
219 .endif
220
221 .if ${PORT_OPTIONS:MTEST}
222 BINTEST= qmqp-sink qmqp-source smtp-sink smtp-source
223 MANTEST= qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1
224 MAN1+= ${MANTEST}
225 PLIST_SUB+= TEST=""
226 .else
227 PLIST_SUB+= TEST="@comment "
228 .endif
229
230 USE_RC_SUBR= postfix
231 PLIST_SUB+= BASE="@comment "
232
233 PLIST_SUB+= PFETC=${ETCDIR}
234
235 .if ${PORT_OPTIONS:MDOCS}
236 READMEDIR= ${TRUE_PREFIX}/${DOCSDIR_REL}
237 .else
238 READMEDIR= no
239 .endif
240
241 DAEMONDIR= ${TRUE_PREFIX}/libexec/postfix
242
243 SUB_LIST+= REQUIRE="${_REQUIRE}" READMEDIR="${READMEDIR}" DAEMONDIR="${DAEMONDIR}"
244 SUB_FILES+= pkg-install pkg-message
245
246 # sed script for files in ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man
247 REINPLACE= s!^PATH=.*!PATH=/bin:/sbin:/usr/bin:/usr/sbin:${TRUE_PREFIX}/bin:${TRUE_PREFIX}/sbin!;\
248 s!(_directory = )/usr/!\1${TRUE_PREFIX}/!g;\
249 s!^(data_directory = /var/)lib/!\1db/!g;\
250 s!^\#(mynetworks_style = host)!\1!g;\
251 s!^(sendmail_path =)!\1 ${TRUE_PREFIX}/sbin/sendmail!g;\
252 s!^(newaliases_path =)!\1 ${TRUE_PREFIX}/bin/newaliases!g;\
253 s!^(mailq_path =)!\1 ${TRUE_PREFIX}/bin/mailq!g;\
254 s!^(setgid_group =)!\1 maildrop!g;\
255 s!^(manpage_directory =)!\1 ${MANPREFIX}/man!g;\
256 s!^((html|readme)_directory =)!\1 ${READMEDIR}!g;\
257 \!^\#alias_database = dbm:/etc/mail/aliases$$!d;\
258 s!(:|= )/etc/postfix!\1$$config_directory!g;\
259 s!/etc/postfix!${ETCDIR}!g;\
260 s!^(sample_directory =)!\1 ${ETCDIR}!g;\
261 s!($config_directory/(access|aliases|canonical|generic|header_checks|relocated|transport|virtual):f:root:-:644:)p1!\1o!;
262
263 pre-patch:
264 .if ${PORT_OPTIONS:MSASL2} && ! ${PORT_OPTIONS:MMYSQL} && exists(${LOCALBASE}/lib/libsasl2.a)
265 @if /usr/bin/nm ${LOCALBASE}/lib/libsasl2.a | ${GREP} -wq "mysql_init"; then \
266 ${ECHO_MSG}; \
267 ${ECHO_MSG} "Your SASL2 library it's compiled with MYSQL"; \
268 ${ECHO_MSG} "If you use MYSQL in ${PORTNAME} consider CTRL+C and"; \
269 ${ECHO_MSG} "select MYSQL OPTION in config menu."; \
270 ${ECHO_MSG} "# make clean config"; \
271 ${ECHO_MSG}; \
272 sleep 5; \
273 fi
274 .endif
275
276 @${ECHO} '<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>' \
277 > ${WRKSRC}/html/body_checks.5.html
278 @${REINPLACE_CMD} -E -e 's![[:<:]]perl[[:>:]]!${PERL}!' \
279 ${WRKSRC}/src/bounce/Makefile.in
280 @${REINPLACE_CMD} -E -e 's!^(#define DEF_SGID_GROUP[^"]+)"postdrop"$$!\1"maildrop"!' \
281 ${WRKSRC}/src/global/mail_params.h
282 @${FIND} -X ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man \
283 -type f -a ! \( -name INSTALL -o -name aliases \) | ${XARGS} \
284 ${REINPLACE_CMD} -E -e '${REINPLACE}'
285
286 post-patch:
287 .for f in ${HTML1}
288 @${ECHO} '$$html_directory/$f:f:root:-:644' \
289 >> ${WRKSRC}/conf/postfix-files
290 .endfor
291 .if ${PORT_OPTIONS:MSPF}
292 @${ECHO} '$$readme_directory/SPF_README:f:root:-:644' \
293 >> ${WRKSRC}/conf/postfix-files
294 @${REINPLACE_CMD} -E -e '${REINPLACE}' \
295 ${WRKSRC}/README_FILES/SPF_README
296 .endif
297 .if ${PORT_OPTIONS:MVDA}
298 @${ECHO} '$$readme_directory/VDA_README:f:root:-:644' \
299 >> ${WRKSRC}/conf/postfix-files
300 @${REINPLACE_CMD} -E -e '${REINPLACE}' \
301 ${WRKSRC}/README_FILES/VDA_README
302 .endif
303
304 do-configure:
305 (cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
306 CCARGS="${POSTFIX_CCARGS}" AUXLIBS="${POSTFIX_AUXLIBS}" && \
307 ${ECHO} "all: default" >> Makefile)
308
309 do-install:
310 @cd ${WRKSRC} && ${SH} postfix-install -non-interactive install_root=${FAKE_DESTDIR} tempdir=/tmp \
311 config_directory=${TRUE_PREFIX}/${ETCDIR_REL} \
312 command_directory=${TRUE_PREFIX}/sbin \
313 daemon_directory=${DAEMONDIR} \
314 html_directory=${READMEDIR} \
315 mailq_path=${TRUE_PREFIX}/bin/mailq \
316 manpage_directory=${TRUE_PREFIX}/man \
317 newaliases_path=${TRUE_PREFIX}/bin/newaliases \
318 readme_directory=${READMEDIR} \
319 sendmail_path=${TRUE_PREFIX}/sbin/sendmail
320 ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${PREFIX}/bin/rmail
321 ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape
322 ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MAN1PREFIX}/man/man1
323 .for f in ${BINTEST}
324 ${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin
325 .endfor
326 .for f in ${MANTEST}
327 ${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MAN1PREFIX}/man/man1
328 .endfor
329
330 post-install:
331 @${REINPLACE_CMD} -i '' -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${FAKE_DESTDIR}${DAEMONDIR}/postfix-files
332
333 .include <bsd.port.mk>

Properties

Name Value
svn:keywords MidnightBSD=%H