ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/mail/sendmail/Makefile
Revision: 23512
Committed: Sat May 12 14:35:03 2018 UTC (4 years ago) by laffer1
File size: 13266 byte(s)
Log Message:
bump after openssl switch

File Contents

# Content
1 # $MidnightBSD$
2
3 PORTNAME= sendmail
4 PORTVERSION= 8.15.2
5 PORTREVISION= 2
6 CATEGORIES= mail ipv6
7 MASTER_SITES= ftp://ftp.sendmail.org/pub/sendmail/
8 DISTNAME= ${PORTNAME}.${PORTVERSION}
9
10 MAINTAINER= ports@MidnightBSD.org
11 COMMENT= Reliable, highly configurable mail transfer agent with utilities
12
13 LICENSE= agg
14
15 CONFLICTS?= courier-0.* postfix-1.* postfix-2.* smail-3.* zmailer-2.* opensmtpd-*
16
17 FAKE_OPTS+= trueprefix
18
19 USERS= smmsp
20 GROUPS= smmsp
21
22 USES= cpe
23 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
24 WCONF= ${WRKSRC}/devtools/Site
25 SITE= ${FILESDIR}/site.config.m4.pre4
26 PLIST= ${WRKDIR}/.PLIST.more
27 DOCS= KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \
28 sendmail/TRACEFLAGS sendmail/SECURITY sendmail/TUNING
29 LMAN1= mailq.1 newaliases.1 vacation.1
30 LMAN5= aliases.5
31 LMAN8= sendmail.8 mailstats.8 makemap.8 praliases.8 smrsh.8 \
32 mail.local.8 rmail.8 editmap.8
33 SENDMAIL= ${PREFIX}/sbin/sendmail
34 BASEMAIL= /usr/libexec/sendmail/sendmail
35 PLIST_SUB+= PREFIX=${PREFIX:S=${PREFIX}/==} MANPREFIX=${MANPREFIX:S=$=/=:S=${PREFIX}==:S=^/==}
36 PKGMESSAGE= ${WRKSRC}/pkg-message
37 MILTER_SOVER?= 6
38
39 OPTIONS_DEFINE?= SHMEM SEM LA NIS IPV6 TLS SASL SASLAUTHD LDAP BDB SOCKETMAP CYRUSLOOKUP PICKY_HELO_CHECK MILTER MILTER_SHARED MILTER_POOL TLSEXT_PADDING DOCS
40 OPTIONS_DEFAULT?= SHMEM SEM LA NIS IPV6 TLS SASL SASLAUTHD PICKY_HELO_CHECK MILTER MILTER_SHARED MILTER_POOL
41 NO_OPTIONS_SORT=yes
42 SHMEM_DESC= System V shared memory support
43 LA_DESC= load averages support
44 TLS_DESC= SMTP-TLS and SMTPS support
45 SASLAUTHD_DESC= SASLAUTHD support
46 BDB_DESC= Berkeley DB version 4 support
47 SOCKETMAP_DESC= Enable socketmap feature
48 CYRUSLOOKUP_DESC= Enable cyruslookup feature
49 PICKY_HELO_CHECK_DESC= Enable picky HELO check
50 MILTER_DESC= Build libmilter
51 MILTER_SHARED_DESC= Build shared libmilter
52 MILTER_POOL_DESC= Enable milter thread pools
53 TLSEXT_PADDING_DESC= Enable TLSEXT padding
54
55 BDB_USE= BDB=yes
56 LDAP_USE= OPENLDAP=yes
57 SASL_LIB_DEPENDS= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
58 SASLAUTHD_RUN_DEPENDS= ${LOCALBASE}/sbin/saslauthd:${PORTSDIR}/security/cyrus-sasl2-saslauthd
59
60 .include <bsd.mport.options.mk>
61 .if ${PORT_OPTIONS:MSHMEM} && !defined(BUILDING_INDEX)
62 IPCCHECK!= ipcrm -q 0 2>&1 || true
63 .if ${IPCCHECK:Mimplemented}
64 IGNORE= your system does not support sysvipc
65 .endif
66 .endif
67
68 .if ${PORT_OPTIONS:MBDB}
69 BDB_SUFFIX= +${BDB_INCLUDE_DIR:S,^${LOCALBASE}/include/,,}
70 CONFLICTS+= sendmail-ldap-8.* sendmail-sasl-8.* sendmail-sasl2-8.* sendmail-tls-8.*
71 .endif
72 .if ${PORT_OPTIONS:MLDAP}
73 LDAP_SUFFIX?= +ldap
74 CONFLICTS+= sendmail-sasl-8.* sendmail-sasl2-8.* sendmail-tls-8.*
75 .endif
76 .if ${PORT_OPTIONS:MSASL}
77 SASL_SUFFIX?= +sasl2
78 CONFLICTS+= sendmail-ldap-8.* sendmail-sasl-8.* sendmail-tls-8.*
79 .endif
80 .if ${PORT_OPTIONS:MCYRUSLOOKUP}
81 .if ! ${PORT_OPTIONS:MSOCKETMAP}
82 IGNORE= option CYRUSLOOKUP requires option SOCKETMAP
83 .else
84 EXTRA_PATCHES+= ${FILESDIR}/cyruslookup.patch
85 .endif
86 .endif
87 .if ${PORT_OPTIONS:MTLS}
88 TLS_SUFFIX?= +tls
89 CONFLICTS+= sendmail-ldap-8.* sendmail-sasl-8.* sendmail-sasl2-8.*
90 .endif
91
92 MAKE_PKGNAMES= for i in "" +tls; do \
93 for j in "" +sasl +sasl1 +sasl2; do \
94 for k in "" +ldap; do \
95 for l in "" +db2 +db3 +db4 +db41 +db42 +db43 +db44 +db45 +db46 +db47 +db48 +db49; do \
96 echo "sendmail$${i}$${j}$${k}$${l}-8.*" ;\
97 done done done done
98
99 ALL_PKGNAMES!= ${MAKE_PKGNAMES}
100 CONFLICTS2!= ${MAKE_PKGNAMES} | grep -v "${PORTNAME}${PKGNAMESUFFIX:S|${PKGNAMESUFFIX2}||}-8."
101 CONFLICTS+= ${CONFLICTS2}
102
103 # Build site.config.m4
104 .if exists(${DESTDIR}/etc/mail/mailer.conf)
105 SITE+= ${FILESDIR}/site.config.m4
106 .endif
107 .if ${PORT_OPTIONS:MIPV6}
108 SITE+= ${FILESDIR}/site.config.m4.ipv6
109 .endif
110 .if ${PORT_OPTIONS:MSASL}
111 SITE+= ${FILESDIR}/site.config.m4.sasl2
112 .endif
113 .if ${PORT_OPTIONS:MLDAP}
114 SITE+= ${FILESDIR}/site.config.m4.ldap
115 .endif
116 .if ${PORT_OPTIONS:MMILTER}
117 SITE+= ${FILESDIR}/site.config.m4.milter
118 .endif
119 .if ${PORT_OPTIONS:MTLS}
120 USES+= ssl
121 .endif
122
123 # install directly if no mailwrapper support
124 .if ! exists(${DESTDIR}/etc/mail/mailer.conf)
125 PREFIX?= ${DESTDIR}/usr
126 MANPREFIX?= ${DESTDIR}/usr/share
127 PLIST_SUB+= ETCPORT="@comment "
128 .else
129 PLIST_SUB+= ETCPORT=""
130 .endif
131
132 .if ${PORT_OPTIONS:MMILTER}
133 .if ${PORT_OPTIONS:MMILTER_SHARED}
134 PLIST_SUB+= MILTER_SHARED=""
135 PLIST_SUB+= MILTER_SOVER=${MILTER_SOVER}
136 MAKE_ENV+= MILTER_SOVER=${MILTER_SOVER}
137 .else
138 PLIST_SUB+= MILTER_SHARED="@comment "
139 .endif
140 .endif
141
142 SED_SCRIPT= -e "s|\`-pthread\'|\`${PTHREAD_LIBS}\'|" \
143 -e "s|\`-O\'|\`${CFLAGS}\'|" \
144 -e 's|%%CC%%|${CC}|' -e 's|%%LD%%|${LD}|'
145
146 .if ! ${PORT_OPTIONS:MNIS}
147 SED_SCRIPT+= -e "s;-DNIS ;;"
148 .endif
149
150 post-patch:
151 @${SED} -e "s=%%PREFIX%%=${PREFIX}=g" \
152 -e "s=%%LOCALBASE%%=${LOCALBASE}=g" \
153 -e "s=%%PORTSDIR%%=${PORTSDIR}=g" \
154 ${PKGDIR}/pkg-message > ${WRKSRC}/pkg-message
155 .if ${PORT_OPTIONS:MMILTER} && ${PORT_OPTIONS:MMILTER_SHARED}
156 @${CP} -pR ${WRKSRC}/libmilter ${WRKSRC}/libsharedmilter
157 ${CP} ${FILESDIR}/sharedlibrary.m4 \
158 ${WRKSRC}/devtools/M4/UNIX/sharedlibrary.m4
159 ${REINPLACE_CMD} -e 's=`library=`sharedlibrary=' \
160 ${WRKSRC}/libsharedmilter/Makefile.m4
161 .endif
162
163 do-configure:
164 ${REINPLACE_CMD} ${SED_SCRIPT} ${WRKSRC}/devtools/OS/FreeBSD
165 ${SED} -e "s=%%PREFIX%%=${PREFIX}=g" \
166 -e "s=%%LOCALBASE%%=${LOCALBASE}=g" \
167 ${SITE} > ${WCONF}/site.config.m4
168 .if ${PORT_OPTIONS:MBDB}
169 ${ECHO_CMD} \
170 'APPENDDEF(`confENVDEF'\'', `-I${BDB_INCLUDE_DIR}'\'')' \
171 >> ${WCONF}/site.config.m4
172 ${ECHO_CMD} \
173 'APPENDDEF(`confLIBDIRS'\'', `-L${LOCALBASE}/lib'\'')' \
174 >> ${WCONF}/site.config.m4
175 .for i in sendmail editmap makemap praliases vacation
176 ${ECHO_CMD} \
177 'APPENDDEF(`conf_${i}_LIBS'\'', `-l${BDB_LIB_NAME}'\'')' \
178 >> ${WCONF}/site.config.m4
179 .endfor
180 .endif
181 .if ${PORT_OPTIONS:MSOCKETMAP}
182 ${ECHO_CMD} \
183 'APPENDDEF(`conf_sendmail_ENVDEF'\'', `-DSOCKETMAP'\'')' \
184 >> ${WCONF}/site.config.m4
185 .endif
186 .if ${PORT_OPTIONS:MPICKY_HELO_CHECK}
187 ${ECHO_CMD} \
188 'APPENDDEF(`conf_sendmail_ENVDEF'\'', `-DPICKY_HELO_CHECK'\'')' \
189 >> ${WCONF}/site.config.m4
190 .endif
191 .if ! ${PORT_OPTIONS:MSHMEM}
192 ${ECHO_CMD} \
193 'APPENDDEF(`confENVDEF'\'', `-DSM_CONF_SHM=0'\'')' \
194 >> ${WCONF}/site.config.m4
195 .endif
196 .if ! ${PORT_OPTIONS:MSEM}
197 ${ECHO_CMD} \
198 'APPENDDEF(`confENVDEF'\'', `-DSM_CONF_SEM=0'\'')' \
199 >> ${WCONF}/site.config.m4
200 .endif
201 .if ! ${PORT_OPTIONS:MLA}
202 ${ECHO_CMD} \
203 'APPENDDEF(`confENVDEF'\'', `-DLA_TYPE=LA_ZERO'\'')' \
204 >> ${WCONF}/site.config.m4
205 .endif
206 .if ${PORT_OPTIONS:MMILTER} && ${PORT_OPTIONS:MMILTER_POOL}
207 ${ECHO_CMD} \
208 'APPENDDEF(`conf_libmilter_ENVDEF'\'', `-DSM_CONF_POLL=1'\'')' \
209 >> ${WCONF}/site.config.m4
210 ${ECHO_CMD} \
211 'APPENDDEF(`conf_libmilter_ENVDEF'\'', `-D_FFR_WORKERS_POOL=1'\'')' \
212 >> ${WCONF}/site.config.m4
213 .endif
214
215 post-build:
216 (cd ${WRKSRC}/doc/op && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} op.txt)
217 .if ${PORT_OPTIONS:MMILTER}
218 (cd ${BUILD_WRKSRC}/libmilter; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
219 .if ${PORT_OPTIONS:MMILTER_SHARED}
220 (cd ${BUILD_WRKSRC}/libsharedmilter; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
221 .endif
222 .endif
223 ${MKDIR} ${WRKDIR}/${FAKE_INSTALLDIR}/etc/mail
224
225 pre-install:
226 @${CAT} ${PKGDIR}/pkg-plist >${PLIST}
227 .if ${PORT_OPTIONS:MMILTER}
228 @${CAT} ${FILESDIR}/pkg-milter >>${PLIST}
229 .endif
230 if ! pw groupshow smmsp; then pw groupadd smmsp -g 25; fi
231 if ! pw usershow smmsp; then pw useradd smmsp -g smmsp -u 25 \
232 -h - -d /nonexistent -s /nonexistent -c "Sendmail Queue"; fi
233 @cd ${WRKSRC} && ${FIND} cf -type f | \
234 ${AWK} '{print "share/sendmail/" $$1}' >>${PLIST}
235 .if ${PORT_OPTIONS:MDOCS}
236 .for i in ${DOCS}
237 @${ECHO_CMD} `${BASENAME} ${i}` | \
238 ${AWK} '{print "%%DOCSDIR%%/" $$1}' >>${PLIST}
239 .endfor
240 .if ${PORT_OPTIONS:MCYRUSLOOKUP}
241 @${ECHO_CMD} "share/doc/sendmail/CYRUS_LOOKUP" >>${PLIST}
242 .endif
243 .endif
244
245 # We want mail.local and rmail for our system.
246 # the build install catmans only, we have to fix this.
247 post-install:
248 (cd ${WRKSRC}/mail.local && \
249 ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} force-install)
250 (cd ${WRKSRC}/rmail && \
251 ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} force-install)
252 .if ${PORT_OPTIONS:MMILTER}
253 ${MKDIR} ${PREFIX}/include/libmilter
254 ${INSTALL_DATA} ${WRKSRC}/include/libmilter/mfapi.h \
255 ${WRKSRC}/include/libmilter/mfdef.h \
256 ${PREFIX}/include/libmilter/
257 ${INSTALL_DATA} \
258 ${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libmilter/libmilter.a \
259 ${PREFIX}/lib/
260 .if ${PORT_OPTIONS:MMILTER_SHARED}
261 ${INSTALL_SCRIPT} \
262 ${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libsharedmilter/libmilter.so \
263 ${PREFIX}/lib/libmilter.so.${MILTER_SOVER}
264 ${LN} -sf libmilter.so.${MILTER_SOVER} ${PREFIX}/lib/libmilter.so
265 .endif
266 .endif
267 .for i in ${LMAN8}
268 @${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
269 ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8
270 .endfor
271 .for i in ${LMAN5}
272 @${RM} -f ${MANPREFIX}/man/cat5/${i} ${MANPREFIX}/man/cat5/${i}.gz
273 ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man5
274 .endfor
275 .for i in ${LMAN1}
276 @${RM} -f ${MANPREFIX}/man/cat1/${i} ${MANPREFIX}/man/cat1/${i}.gz
277 ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man1
278 .endfor
279 ${MKDIR} ${PREFIX}/share/sendmail
280 @${TAR} -C ${WRKSRC} -cf - cf | \
281 ${TAR} -C ${PREFIX}/share/sendmail -xf -
282 .if ${PORT_OPTIONS:MDOCS}
283 ${MKDIR} ${DOCSDIR}
284 @cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}/
285 ${INSTALL_DATA} ${WRKSRC}/doc/op/op.ps ${DOCSDIR}/op.ps
286 ${INSTALL_DATA} ${WRKSRC}/doc/op/op.txt ${DOCSDIR}/op.txt
287 ${INSTALL_DATA} ${WRKSRC}/devtools/README ${DOCSDIR}/DEVTOOLS
288 ${INSTALL_DATA} ${WRKSRC}/sendmail/README ${DOCSDIR}/SENDMAIL
289 ${INSTALL_DATA} ${WRKSRC}/mail.local/README ${DOCSDIR}/MAIL.LOCAL
290 ${INSTALL_DATA} ${WRKSRC}/smrsh/README ${DOCSDIR}/SMRSH
291 .if ${PORT_OPTIONS:MMILTER}
292 ${INSTALL_DATA} ${WRKSRC}/libmilter/README ${DOCSDIR}/MILTER
293 ${MKDIR} ${DOCSDIR}/libmilter
294 @${TAR} -C ${WRKSRC}/libmilter/docs -cf - . | \
295 ${TAR} -C ${DOCSDIR}/libmilter -xf -
296 .endif
297 .if ${PORT_OPTIONS:MCYRUSLOOKUP}
298 ${INSTALL_DATA} ${FILESDIR}/CYRUS_LOOKUP ${DOCSDIR}/CYRUS_LOOKUP
299 .endif
300 .endif
301 ${STRIP_CMD} ${PREFIX}/bin/vacation
302 ${STRIP_CMD} ${PREFIX}/bin/rmail
303 ${STRIP_CMD} ${PREFIX}/sbin/*
304 ${STRIP_CMD} ${PREFIX}/libexec/*
305 .if exists(${DESTDIR}/etc/mail/mailer.conf)
306
307 mailer.base:
308 @${SED} \
309 -e "s=^sendmail[ ]*/.*$$=sendmail ${BASEMAIL}=" \
310 -e "s=^send-mail[ ]*/.*$$=send-mail ${BASEMAIL}=" \
311 -e "s=^mailq[ ]*/.*$$=mailq ${BASEMAIL}=" \
312 -e "s=^newaliases[ ]*/.*$$=newaliases ${BASEMAIL}=" \
313 -e "s=^hoststat[ ]*/.*$$=hoststat ${BASEMAIL}=" \
314 -e "s=^purgestat[ ]*/.*$$=purgestat ${BASEMAIL}=" \
315 ${DESTDIR}/etc/mail/mailer.conf > ${DESTDIR}/etc/mail/mailer.conf.new
316 ${MV} ${DESTDIR}/etc/mail/mailer.conf.new \
317 ${DESTDIR}/etc/mail/mailer.conf
318
319 mailer.conf:
320 @${SED} \
321 -e "s=^sendmail[ ]*/.*$$=sendmail ${SENDMAIL}=" \
322 -e "s=^send-mail[ ]*/.*$$=send-mail ${SENDMAIL}=" \
323 -e "s=^mailq[ ]*/.*$$=mailq ${SENDMAIL}=" \
324 -e "s=^newaliases[ ]*/.*$$=newaliases ${SENDMAIL}=" \
325 -e "s=^hoststat[ ]*/.*$$=hoststat ${SENDMAIL}=" \
326 -e "s=^purgestat[ ]*/.*$$=purgestat ${SENDMAIL}=" \
327 ${DESTDIR}/etc/mail/mailer.conf > ${DESTDIR}/etc/mail/mailer.conf.new
328 ${MV} ${DESTDIR}/etc/mail/mailer.conf.new \
329 ${DESTDIR}/etc/mail/mailer.conf
330 .endif
331
332 # create sumbit.cf on older systems
333 #
334 submit.cf: ${DESTDIR}/etc/mail/submit.cf
335
336 ${DESTDIR}/etc/mail/submit.mc:
337 ${INSTALL_DATA} ${PREFIX}/share/sendmail/cf/cf/submit.mc \
338 ${DESTDIR}/etc/mail/submit.mc
339
340 ${DESTDIR}/etc/mail/submit.cf: ${DESTDIR}/etc/mail/submit.mc
341 @( cd ${DESTDIR}/etc/mail && ${MAKE} \
342 SENDMAIL_CF_DIR=${PREFIX}/share/sendmail/cf \
343 SENDMAIL_MC=submit )
344
345 # create basics for smtp-auth
346 #
347 howto-sasldb:
348 @${ECHO_CMD} "# Links:"
349 @${ECHO_CMD} "#"
350 @${ECHO_CMD} "# http://www.sendmail.org/~gshapiro/"
351 @${ECHO_CMD} "# http://www.sendmail.org/~ca/email/auth.html"
352 @${ECHO_CMD} "# http://www.bme.ogi.edu/~pchytil/linux/sendmail/"
353 @${ECHO_CMD} "# http://blue-labs.org/software/sm-pgsql/"
354 @${ECHO_CMD} "# http://www.falkotimme.com/howtos/sendmail_smtp_auth_tls/"
355 @${ECHO_CMD} "#"
356
357 # create certificates for TLS/SSL
358 #
359 tls-install:
360 ${SETENV} DESTDIR=${DESTDIR} FILESDIR=${FILESDIR} \
361 ${SH} ${FILESDIR}/tls-install.sh
362
363 help:
364 @${ECHO_CMD} "# additional targets:"
365 @${ECHO_CMD} "#"
366 @${ECHO_CMD} "# configure ${DESTDIR}/etc/mail/mailer.conf"
367 @${ECHO_CMD} "# for sendmail from ports"
368 @${ECHO_CMD} "make mailer.conf"
369 @${ECHO_CMD} "# for sendmail in the base"
370 @${ECHO_CMD} "make mailer.base"
371 @${ECHO_CMD} "#"
372 @${ECHO_CMD} "# show howto for configuring sasldb"
373 @${ECHO_CMD} "make howto-sasldb"
374 @${ECHO_CMD} "#"
375 @${ECHO_CMD} "# create a self-signed certificate"
376 @${ECHO_CMD} "make tls-install"
377 @${ECHO_CMD} "#"
378
379 .include <bsd.port.pre.mk>
380
381 .if ${PORT_OPTIONS:MTLS}
382 .if !defined(WITH_OPENSSL_BASE)
383 SITE+= ${FILESDIR}/site.config.m4.ssl
384 .endif
385 SITE+= ${FILESDIR}/site.config.m4.tls
386 .endif
387
388 .if exists(${FILESDIR}/site.config.m4.local)
389 SITE+= ${FILESDIR}/site.config.m4.local
390 .endif
391
392 .if exists(${DESTDIR}/etc/mail/mailer.conf) && ${PREFIX} == "/usr"
393 pre-everything::
394 @${ECHO_CMD} "#"
395 @${ECHO_CMD} "# You can't override the base sendmail this way."
396 @${ECHO_CMD} "# your version BSD use mailwrapper."
397 @${ECHO_CMD} "#"
398 @${ECHO_CMD} "# Please install with normal PREFIX"
399 @${ECHO_CMD} "# and activate the port version with"
400 @${ECHO_CMD} "# cd ${PORTSDIR}/mail/sendmail && make mailer.conf"
401 @${ECHO_CMD} "#"
402 @${FALSE}
403 .endif
404
405 .include <bsd.port.post.mk>

Properties

Name Value
svn:keywords MidnightBSD=%H