Gentoo Archives: gentoo-commits

From: Julian Ospald <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-mta/exim/
Date: Wed, 30 Sep 2015 11:59:26
Message-Id: 1443614345.ad163d1574c6f5ed3d898ac6544e0d09185db7b4.hasufell@gentoo
1 commit: ad163d1574c6f5ed3d898ac6544e0d09185db7b4
2 Author: Julian Ospald <hasufell <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 30 11:55:12 2015 +0000
4 Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 30 11:59:05 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad163d15
7
8 mail-mta/exim: add libressl support
9
10 mail-mta/exim/exim-4.86-r1.ebuild | 511 ++++++++++++++++++++++++++++++++++++++
11 1 file changed, 511 insertions(+)
12
13 diff --git a/mail-mta/exim/exim-4.86-r1.ebuild b/mail-mta/exim/exim-4.86-r1.ebuild
14 new file mode 100644
15 index 0000000..54365b5
16 --- /dev/null
17 +++ b/mail-mta/exim/exim-4.86-r1.ebuild
18 @@ -0,0 +1,511 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +# $Id$
22 +
23 +EAPI="5"
24 +
25 +inherit eutils toolchain-funcs multilib pam systemd
26 +
27 +IUSE="dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn exiscan-acl gnutls ipv6 ldap libressl lmtp maildir mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl selinux spf sqlite srs ssl syslog tcpd tpda X"
28 +REQUIRED_USE="spf? ( exiscan-acl ) srs? ( exiscan-acl ) dmarc? ( spf dkim ) pkcs11? ( gnutls )"
29 +
30 +COMM_URI="ftp://ftp.exim.org/pub/exim/exim4$([[ ${PV} == *_rc* ]] && echo /test)"
31 +
32 +DESCRIPTION="A highly configurable, drop-in replacement for sendmail"
33 +SRC_URI="${COMM_URI}/${P//rc/RC}.tar.bz2
34 + mirror://gentoo/system_filter.exim.gz
35 + doc? ( ${COMM_URI}/${PN}-html-${PV//rc/RC}.tar.bz2 )"
36 +HOMEPAGE="http://www.exim.org/"
37 +
38 +SLOT="0"
39 +LICENSE="GPL-2"
40 +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris"
41 +
42 +COMMON_DEPEND=">=sys-apps/sed-4.0.5
43 + >=sys-libs/db-3.2
44 + dev-libs/libpcre
45 + perl? ( dev-lang/perl:= )
46 + pam? ( virtual/pam )
47 + tcpd? ( sys-apps/tcp-wrappers )
48 + ssl? (
49 + !libressl? ( dev-libs/openssl:0= )
50 + libressl? ( dev-libs/libressl:= )
51 + )
52 + gnutls? ( net-libs/gnutls[pkcs11?]
53 + dev-libs/libtasn1 )
54 + ldap? ( >=net-nds/openldap-2.0.7 )
55 + mysql? ( virtual/mysql )
56 + postgres? ( dev-db/postgresql )
57 + sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r2 )
58 + redis? ( dev-libs/hiredis )
59 + spf? ( >=mail-filter/libspf2-1.2.5-r1 )
60 + dmarc? ( mail-filter/opendmarc )
61 + srs? ( mail-filter/libsrs_alt )
62 + X? ( x11-proto/xproto
63 + x11-libs/libX11
64 + x11-libs/libXmu
65 + x11-libs/libXt
66 + x11-libs/libXaw
67 + )
68 + sqlite? ( dev-db/sqlite )
69 + radius? ( net-dialup/radiusclient )
70 + virtual/libiconv
71 + "
72 + # added X check for #57206
73 +DEPEND="${COMMON_DEPEND}
74 + virtual/pkgconfig"
75 +RDEPEND="${COMMON_DEPEND}
76 + !mail-mta/courier
77 + !mail-mta/esmtp
78 + !mail-mta/mini-qmail
79 + !<mail-mta/msmtp-1.4.19-r1
80 + !>=mail-mta/msmtp-1.4.19-r1[mta]
81 + !mail-mta/netqmail
82 + !mail-mta/nullmailer
83 + !mail-mta/postfix
84 + !mail-mta/qmail-ldap
85 + !mail-mta/sendmail
86 + !mail-mta/opensmtpd
87 + !<mail-mta/ssmtp-2.64-r2
88 + !>=mail-mta/ssmtp-2.64-r2[mta]
89 + !net-mail/mailwrapper
90 + >=net-mail/mailbase-0.00-r5
91 + virtual/logger
92 + dcc? ( mail-filter/dcc )
93 + selinux? ( sec-policy/selinux-exim )
94 + "
95 +
96 +S=${WORKDIR}/${P//rc/RC}
97 +
98 +src_prepare() {
99 + epatch "${FILESDIR}"/exim-4.14-tail.patch
100 + epatch "${FILESDIR}"/exim-4.74-localscan_dlopen.patch
101 + epatch "${FILESDIR}"/exim-4.69-r1.27021.patch
102 + epatch "${FILESDIR}"/exim-4.74-radius-db-ENV-clash.patch # 287426
103 + epatch "${FILESDIR}"/exim-4.82-makefile-freebsd.patch # 235785
104 + epatch "${FILESDIR}"/exim-4.77-as-needed-ldflags.patch # 352265, 391279
105 + epatch "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591
106 +
107 + if use maildir ; then
108 + epatch "${FILESDIR}"/exim-4.20-maildir.patch
109 + else
110 + epatch "${FILESDIR}"/exim-4.80-spool-mail-group.patch # 438606
111 + fi
112 +
113 + # user Exim believes it should be
114 + MAILUSER=mail
115 + MAILGROUP=mail
116 + if use prefix && [[ ${EUID} != 0 ]] ; then
117 + MAILUSER=$(id -un)
118 + MAILGROUP=$(id -gn)
119 + fi
120 +}
121 +
122 +src_configure() {
123 + # general config and paths
124 +
125 + sed -i.orig \
126 + -e "/SYSTEM_ALIASES_FILE/s'SYSTEM_ALIASES_FILE'${EPREFIX}/etc/mail/aliases'" \
127 + "${S}"/src/configure.default || die
128 +
129 + sed -i -e 's/^buildname=.*/buildname=exim-gentoo/g' Makefile || die
130 +
131 + sed -e "48i\CFLAGS=${CFLAGS}" \
132 + -e "s:BIN_DIRECTORY=/usr/exim/bin:BIN_DIRECTORY=${EPREFIX}/usr/sbin:" \
133 + -e "s:EXIM_USER=:EXIM_USER=${MAILUSER}:" \
134 + -e "s:CONFIGURE_FILE=/usr/exim/configure:CONFIGURE_FILE=${EPREFIX}/etc/exim/exim.conf:" \
135 + -e "s:ZCAT_COMMAND=.*$:ZCAT_COMMAND=${EPREFIX}/bin/zcat:" \
136 + -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \
137 + src/EDITME > Local/Makefile
138 +
139 + cd Local
140 +
141 + cat >> Makefile <<- EOC
142 + INFO_DIRECTORY=${EPREFIX}/usr/share/info
143 + PID_FILE_PATH=${EPREFIX}/run/exim.pid
144 + SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim
145 + HAVE_ICONV=yes
146 + EOC
147 +
148 + # if we use libiconv, now is the time to tell so
149 + use !elibc_glibc && echo "EXTRALIBS_EXIM=-liconv" >> Makefile
150 +
151 + # support for IPv6
152 + if use ipv6; then
153 + cat >> Makefile <<- EOC
154 + HAVE_IPV6=YES
155 + EOC
156 + fi
157 +
158 + #
159 + # mail storage formats
160 +
161 + # mailstore is Exim's traditional storage format
162 + cat >> Makefile <<- EOC
163 + SUPPORT_MAILSTORE=yes
164 + EOC
165 +
166 + # mbox
167 + if use mbx; then
168 + cat >> Makefile <<- EOC
169 + SUPPORT_MBX=yes
170 + EOC
171 + fi
172 +
173 + # maildir
174 + if use maildir; then
175 + cat >> Makefile <<- EOC
176 + SUPPORT_MAILDIR=yes
177 + EOC
178 + fi
179 +
180 + #
181 + # lookup methods
182 +
183 + # use the "native" interfaces to the DBM and CDB libraries, support
184 + # passwd and directory lookups by default
185 + cat >> Makefile <<- EOC
186 + USE_DB=yes
187 + DBMLIB=-ldb
188 + LOOKUP_CDB=yes
189 + LOOKUP_PASSWD=yes
190 + LOOKUP_DSEARCH=yes
191 + EOC
192 +
193 + if ! use dnsdb; then
194 + # DNSDB lookup is enabled by default
195 + sed -i "s:^LOOKUP_DNSDB=yes:# LOOKUP_DNSDB=yes:" Makefile
196 + fi
197 +
198 + if use ldap; then
199 + cat >> Makefile <<- EOC
200 + LOOKUP_LDAP=yes
201 + LDAP_LIB_TYPE=OPENLDAP2
202 + LOOKUP_INCLUDE += -I"${EROOT}"usr/include/ldap
203 + LOOKUP_LIBS += -lldap -llber
204 + EOC
205 + fi
206 +
207 + if use mysql; then
208 + cat >> Makefile <<- EOC
209 + LOOKUP_MYSQL=yes
210 + LOOKUP_INCLUDE += $(mysql_config --include)
211 + LOOKUP_LIBS += $(mysql_config --libs)
212 + EOC
213 + fi
214 +
215 + if use nis; then
216 + cat >> Makefile <<- EOC
217 + LOOKUP_NIS=yes
218 + LOOKUP_NISPLUS=yes
219 + EOC
220 + fi
221 +
222 + if use postgres; then
223 + cat >> Makefile <<- EOC
224 + LOOKUP_PGSQL=yes
225 + LOOKUP_INCLUDE += -I$(pg_config --includedir)
226 + LOOKUP_LIBS += -L$(pg_config --libdir) -lpq
227 + EOC
228 + fi
229 +
230 + if use sqlite; then
231 + cat >> Makefile <<- EOC
232 + LOOKUP_SQLITE=yes
233 + LOOKUP_SQLITE_PC=sqlite3
234 + EOC
235 + fi
236 +
237 + if use redis; then
238 + cat >> Makefile <<- EOC
239 + EXPERIMENTAL_REDIS=yes
240 + LOOKUP_LIBS += -lhiredis
241 + EOC
242 + fi
243 +
244 + #
245 + # Exim monitor, enabled by default, controlled via X USE-flag,
246 + # disable if not requested, bug #46778
247 + if use X; then
248 + cp ../exim_monitor/EDITME eximon.conf || die
249 + else
250 + sed -i -e '/^EXIM_MONITOR=/s/^/# /' Makefile
251 + fi
252 +
253 + #
254 + # features
255 +
256 + # content scanning support
257 + if use exiscan-acl; then
258 + cat >> Makefile <<- EOC
259 + WITH_CONTENT_SCAN=yes
260 + WITH_OLD_DEMIME=yes
261 + EOC
262 + fi
263 +
264 + # DomainKeys Identified Mail, RFC4871
265 + if ! use dkim; then
266 + # DKIM is enabled by default
267 + cat >> Makefile <<- EOC
268 + DISABLE_DKIM=yes
269 + EOC
270 + fi
271 +
272 + # Per-Recipient-Data-Response
273 + if ! use prdr; then
274 + # PRDR is enabled by default
275 + cat >> Makefile <<- EOC
276 + DISABLE_PRDR=yes
277 + EOC
278 + fi
279 +
280 + # log to syslog
281 + if use syslog; then
282 + sed -i "s:LOG_FILE_PATH=/var/log/exim/exim_%s.log:LOG_FILE_PATH=syslog:" Makefile
283 + cat >> Makefile <<- EOC
284 + LOG_FILE_PATH=syslog
285 + EOC
286 + else
287 + cat >> Makefile <<- EOC
288 + LOG_FILE_PATH=${EPREFIX}/var/log/exim/exim_%s.log
289 + EOC
290 + fi
291 +
292 + # starttls support (ssl)
293 + if use ssl; then
294 + echo "SUPPORT_TLS=yes" >> Makefile
295 + if use gnutls; then
296 + echo "USE_GNUTLS=yes" >> Makefile
297 + echo "USE_GNUTLS_PC=gnutls" >> Makefile
298 + use pkcs11 || echo "AVOID_GNUTLS_PKCS11=yes" >> Makefile
299 + else
300 + echo "USE_OPENSSL_PC=openssl" >> Makefile
301 + fi
302 + fi
303 +
304 + # TCP wrappers
305 + if use tcpd; then
306 + cat >> Makefile <<- EOC
307 + USE_TCP_WRAPPERS=yes
308 + EXTRALIBS_EXIM += -lwrap
309 + EOC
310 + fi
311 +
312 + # Light Mail Transport Protocol
313 + if use lmtp; then
314 + cat >> Makefile <<- EOC
315 + TRANSPORT_LMTP=yes
316 + EOC
317 + fi
318 +
319 + # embedded Perl
320 + if use perl; then
321 + cat >> Makefile <<- EOC
322 + EXIM_PERL=perl.o
323 + EOC
324 + fi
325 +
326 + # dlfunc
327 + if use dlfunc; then
328 + cat >> Makefile <<- EOC
329 + EXPAND_DLFUNC=yes
330 + EOC
331 + fi
332 +
333 + #
334 + # experimental features
335 +
336 + # Distributed Checksum Clearinghouse
337 + if use dcc; then
338 + echo "EXPERIMENTAL_DCC=yes">> Makefile
339 + fi
340 +
341 + # Sender Policy Framework
342 + if use spf; then
343 + cat >> Makefile <<- EOC
344 + EXPERIMENTAL_SPF=yes
345 + EXTRALIBS_EXIM += -lspf2
346 + EOC
347 + fi
348 +
349 + # Sender Rewriting Scheme
350 + if use srs; then
351 + cat >> Makefile <<- EOC
352 + EXPERIMENTAL_SRS=yes
353 + EXTRALIBS_EXIM += -lsrs_alt
354 + EOC
355 + fi
356 +
357 + # DMARC
358 + if use dmarc; then
359 + cat >> Makefile <<- EOC
360 + EXPERIMENTAL_DMARC=yes
361 + EXTRALIBS_EXIM += -lopendmarc
362 + EOC
363 + fi
364 +
365 + # Transport post-delivery actions
366 + if use tpda; then
367 + cat >> Makefile <<- EOC
368 + EXPERIMENTAL_EVENT=yes
369 + EOC
370 + fi
371 +
372 + # Proxy Protocol
373 + if use proxy; then
374 + cat >> Makefile <<- EOC
375 + EXPERIMENTAL_PROXY=yes
376 + EOC
377 + fi
378 +
379 + # Delivery Sender Notifications
380 + if use dsn; then
381 + cat >> Makefile <<- EOC
382 + EXPERIMENTAL_DSN=yes
383 + EOC
384 + fi
385 +
386 + #
387 + # authentication (SMTP AUTH)
388 +
389 + # standard bits
390 + cat >> Makefile <<- EOC
391 + AUTH_SPA=yes
392 + AUTH_CRAM_MD5=yes
393 + AUTH_PLAINTEXT=yes
394 + EOC
395 +
396 + # Cyrus SASL
397 + if use sasl; then
398 + cat >> Makefile <<- EOC
399 + CYRUS_SASLAUTHD_SOCKET=${EPREFIX}/run/saslauthd/mux
400 + AUTH_CYRUS_SASL=yes
401 + AUTH_LIBS += -lsasl2
402 + EOC
403 + fi
404 +
405 + # Dovecot
406 + if use dovecot-sasl; then
407 + cat >> Makefile <<- EOC
408 + AUTH_DOVECOT=yes
409 + EOC
410 + fi
411 +
412 + # Pluggable Authentication Modules
413 + if use pam; then
414 + cat >> Makefile <<- EOC
415 + SUPPORT_PAM=yes
416 + AUTH_LIBS += -lpam
417 + EOC
418 + fi
419 +
420 + # Radius
421 + if use radius; then
422 + cat >> Makefile <<- EOC
423 + RADIUS_CONFIG_FILE=${EPREFIX}/etc/radiusclient/radiusclient.conf
424 + RADIUS_LIB_TYPE=RADIUSCLIENT
425 + AUTH_LIBS += -lradiusclient
426 + EOC
427 + fi
428 +}
429 +
430 +src_compile() {
431 + emake -j1 CC="$(tc-getCC)" HOSTCC="$(tc-getCC $CBUILD)" \
432 + AR="$(tc-getAR) cq" RANLIB="$(tc-getRANLIB)" FULLECHO='' \
433 + || die "make failed"
434 +}
435 +
436 +src_install () {
437 + cd "${S}"/build-exim-gentoo || die
438 + dosbin exim
439 + if use X; then
440 + dosbin eximon.bin
441 + dosbin eximon
442 + fi
443 + fperms 4755 /usr/sbin/exim
444 +
445 + dosym exim /usr/sbin/sendmail
446 + dosym exim /usr/sbin/rsmtp
447 + dosym exim /usr/sbin/rmail
448 + dosym /usr/sbin/exim /usr/bin/mailq
449 + dosym /usr/sbin/exim /usr/bin/newaliases
450 + dosym /usr/sbin/sendmail /usr/lib/sendmail
451 +
452 + for i in exicyclog exim_dbmbuild exim_dumpdb exim_fixdb exim_lock \
453 + exim_tidydb exinext exiwhat exigrep eximstats exiqsumm exiqgrep \
454 + convert4r3 convert4r4 exipick
455 + do
456 + dosbin $i
457 + done
458 +
459 + dodoc "${S}"/doc/*
460 + doman "${S}"/doc/exim.8
461 + use dsn && dodoc "${S}"/README.DSN
462 + use doc && dohtml -r "${WORKDIR}"/${PN}-html-${PV//rc/RC}/doc/html/spec_html/*
463 +
464 + # conf files
465 + insinto /etc/exim
466 + newins "${S}"/src/configure.default exim.conf.dist
467 + if use exiscan-acl; then
468 + newins "${S}"/src/configure.default exim.conf.exiscan-acl
469 + fi
470 + doins "${WORKDIR}"/system_filter.exim
471 + doins "${FILESDIR}"/auth_conf.sub
472 +
473 + pamd_mimic system-auth exim auth account
474 +
475 + # headers, #436406
476 + if use dlfunc ; then
477 + # fixup includes so they actually can be found when including
478 + sed -i \
479 + -e '/#include "\(config\|store\|mytypes\).h"/s:"\(.\+\)":<exim/\1>:' \
480 + local_scan.h || die
481 + insinto /usr/include/exim
482 + doins {config,local_scan}.h ../src/{mytypes,store}.h
483 + fi
484 +
485 + insinto /etc/logrotate.d
486 + newins "${FILESDIR}/exim.logrotate" exim
487 +
488 + newinitd "${FILESDIR}"/exim.rc9 exim
489 + newconfd "${FILESDIR}"/exim.confd exim
490 +
491 + systemd_dounit "${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket}
492 + systemd_newunit "${FILESDIR}"/exim_at.service 'exim@.service'
493 + systemd_newunit "${FILESDIR}"/exim-submission_at.service 'exim-submission@.service'
494 +
495 + DIROPTIONS="-m 0750 -o ${MAILUSER} -g ${MAILGROUP}"
496 + dodir /var/log/${PN}
497 +}
498 +
499 +pkg_postinst() {
500 + if [[ ! -f ${EROOT}etc/exim/exim.conf ]] ; then
501 + einfo "${EROOT}etc/exim/system_filter.exim is a sample system_filter."
502 + einfo "${EROOT}etc/exim/auth_conf.sub contains the configuration sub for using smtp auth."
503 + einfo "Please create ${EROOT}etc/exim/exim.conf from ${EROOT}etc/exim/exim.conf.dist."
504 + fi
505 + if use dcc ; then
506 + einfo "DCC support is experimental, you can find some limited"
507 + einfo "documentation at the bottom of this prerelease message:"
508 + einfo "http://article.gmane.org/gmane.mail.exim.devel/3579"
509 + fi
510 + use spf && einfo "SPF support is experimental"
511 + use srs && einfo "SRS support is experimental"
512 + if use dmarc ; then
513 + einfo "DMARC support is experimental. See global settings to"
514 + einfo "configure DMARC, for usage see the documentation at "
515 + einfo "experimental-spec.txt."
516 + fi
517 + use tpda && einfo "TPDA/EVENT support is experimental"
518 + use proxy && einfo "proxy support is experimental"
519 + if use dsn ; then
520 + einfo "Starting from Exim 4.83, DSN support comes from upstream."
521 + einfo "DSN support is an experimental feature. If you used DSN"
522 + einfo "support prior to 4.83, make sure to remove all dsn_process"
523 + einfo "switches from your routers, see https://bugs.gentoo.org/511818"
524 + fi
525 + einfo "Exim maintains some db files under its spool directory that need"
526 + einfo "cleaning from time to time. (${EROOT}var/spool/exim/db)"
527 + einfo "Please use the exim_tidydb tool as documented in the Exim manual:"
528 + einfo "http://www.exim.org/exim-html-current/doc/html/spec_html/ch-exim_utilities.html#SECThindatmai"
529 +}