Gentoo Archives: gentoo-commits

From: "Eray Aslan (eras)" <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-mta/postfix: postfix-2.11.4.ebuild postfix-3.0.0.ebuild postfix-3.1_pre20150208.ebuild ChangeLog postfix-3.0.0_rc1.ebuild postfix-3.1_pre20150201.ebuild
Date: Mon, 09 Feb 2015 16:39:31
Message-Id: 20150209163927.2D5E211671@oystercatcher.gentoo.org
1 eras 15/02/09 16:39:27
2
3 Modified: ChangeLog
4 Added: postfix-2.11.4.ebuild postfix-3.0.0.ebuild
5 postfix-3.1_pre20150208.ebuild
6 Removed: postfix-3.0.0_rc1.ebuild
7 postfix-3.1_pre20150201.ebuild
8 Log:
9 Version bump
10
11 (Portage version: 2.2.16/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
12
13 Revision Changes Path
14 1.567 mail-mta/postfix/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.567&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.567&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?r1=1.566&r2=1.567
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v
23 retrieving revision 1.566
24 retrieving revision 1.567
25 diff -u -r1.566 -r1.567
26 --- ChangeLog 3 Feb 2015 06:44:22 -0000 1.566
27 +++ ChangeLog 9 Feb 2015 16:39:27 -0000 1.567
28 @@ -1,6 +1,15 @@
29 # ChangeLog for mail-mta/postfix
30 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.566 2015/02/03 06:44:22 eras Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.567 2015/02/09 16:39:27 eras Exp $
33 +
34 +*postfix-3.1_pre20150208 (09 Feb 2015)
35 +*postfix-3.0.0 (09 Feb 2015)
36 +*postfix-2.11.4 (09 Feb 2015)
37 +
38 + 09 Feb 2015; Eray Aslan <eras@g.o> +postfix-2.11.4.ebuild,
39 + +postfix-3.0.0.ebuild, +postfix-3.1_pre20150208.ebuild,
40 + -postfix-3.0.0_rc1.ebuild, -postfix-3.1_pre20150201.ebuild:
41 + Version bump
42
43 03 Feb 2015; Eray Aslan <eras@g.o> postfix-3.0.0_rc1.ebuild,
44 postfix-3.1_pre20150201.ebuild:
45
46
47
48 1.1 mail-mta/postfix/postfix-2.11.4.ebuild
49
50 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.11.4.ebuild?rev=1.1&view=markup
51 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.11.4.ebuild?rev=1.1&content-type=text/plain
52
53 Index: postfix-2.11.4.ebuild
54 ===================================================================
55 # Copyright 1999-2015 Gentoo Foundation
56 # Distributed under the terms of the GNU General Public License v2
57 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.11.4.ebuild,v 1.1 2015/02/09 16:39:27 eras Exp $
58
59 EAPI=5
60 inherit eutils flag-o-matic multilib pam ssl-cert systemd toolchain-funcs user versionator
61
62 MY_PV="${PV/_pre/-}"
63 MY_SRC="${PN}-${MY_PV}"
64 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
65 VDA_PV="2.10.0"
66 VDA_P="${PN}-vda-v13-${VDA_PV}"
67 RC_VER="2.7"
68
69 DESCRIPTION="A fast and secure drop-in replacement for sendmail"
70 HOMEPAGE="http://www.postfix.org/"
71 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
72 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
73
74 LICENSE="IBM"
75 SLOT="0"
76 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
77 IUSE="+berkdb cdb doc dovecot-sasl hardened ldap ldap-bind lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
78
79 DEPEND=">=dev-libs/libpcre-3.4
80 dev-lang/perl
81 berkdb? ( >=sys-libs/db-3.2:* )
82 cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
83 ldap? ( net-nds/openldap )
84 ldap-bind? ( net-nds/openldap[sasl] )
85 lmdb? ( >=dev-db/lmdb-0.9.11 )
86 mysql? ( virtual/mysql )
87 pam? ( virtual/pam )
88 postgres? ( dev-db/postgresql:* )
89 sasl? ( >=dev-libs/cyrus-sasl-2 )
90 sqlite? ( dev-db/sqlite:3 )
91 ssl? ( >=dev-libs/openssl-0.9.6g:* )"
92
93 RDEPEND="${DEPEND}
94 dovecot-sasl? ( net-mail/dovecot )
95 memcached? ( net-misc/memcached )
96 net-mail/mailbase
97 !mail-mta/courier
98 !mail-mta/esmtp
99 !mail-mta/exim
100 !mail-mta/mini-qmail
101 !mail-mta/msmtp[mta]
102 !mail-mta/netqmail
103 !mail-mta/nullmailer
104 !mail-mta/qmail-ldap
105 !mail-mta/sendmail
106 !mail-mta/opensmtpd
107 !<mail-mta/ssmtp-2.64-r2
108 !>=mail-mta/ssmtp-2.64-r2[mta]
109 !net-mail/fastforward
110 selinux? ( sec-policy/selinux-postfix )"
111
112 REQUIRED_USE="ldap-bind? ( ldap sasl )"
113
114 S="${WORKDIR}/${MY_SRC}"
115
116 pkg_setup() {
117 # Add postfix, postdrop user/group (bug #77565)
118 enewgroup postfix 207
119 enewgroup postdrop 208
120 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
121 }
122
123 src_prepare() {
124 epatch "${FILESDIR}/${PN}-2.11.1-db6.patch"
125 if use vda; then
126 epatch "${DISTDIR}"/${VDA_P}.patch
127 fi
128
129 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
130 src/util/sys_defs.h || die "sed failed"
131
132 # change default paths to better comply with portage standard paths
133 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
134
135 epatch_user
136 }
137
138 src_configure() {
139 # Make sure LDFLAGS get passed down to the executables.
140 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
141
142 use pam && mylibs="${mylibs} -lpam"
143
144 if use ldap; then
145 mycc="${mycc} -DHAS_LDAP"
146 mylibs="${mylibs} -lldap -llber"
147 fi
148
149 if use mysql; then
150 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
151 mylibs="${mylibs} $(mysql_config --libs)"
152 fi
153
154 if use postgres; then
155 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
156 mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
157 fi
158
159 if use sqlite; then
160 mycc="${mycc} -DHAS_SQLITE"
161 mylibs="${mylibs} -lsqlite3"
162 fi
163
164 if use ssl; then
165 mycc="${mycc} -DUSE_TLS"
166 mylibs="${mylibs} -lssl -lcrypto"
167 fi
168
169 if use lmdb; then
170 mycc="${mycc} -DHAS_LMDB"
171 mylibs="${mylibs} -llmdb"
172 fi
173
174 # broken. and "in other words, not supported" by upstream.
175 # Use inet_protocols setting in main.cf
176 #if ! use ipv6; then
177 # mycc="${mycc} -DNO_IPV6"
178 #fi
179
180 if use sasl; then
181 if use dovecot-sasl; then
182 # Set dovecot as default.
183 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
184 fi
185 if use ldap-bind; then
186 mycc="${mycc} -DUSE_LDAP_SASL"
187 fi
188 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
189 mylibs="${mylibs} -lsasl2"
190 elif use dovecot-sasl; then
191 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
192 fi
193
194 if ! use nis; then
195 mycc="${mycc} -DNO_NIS"
196 fi
197
198 if ! use berkdb; then
199 mycc="${mycc} -DNO_DB"
200 if use cdb; then
201 # change default hash format from Berkeley DB to cdb
202 mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
203 fi
204 fi
205
206 if use cdb; then
207 mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
208 CDB_LIBS=""
209 # Tinycdb is preferred.
210 if has_version dev-db/tinycdb ; then
211 einfo "Building with dev-db/tinycdb"
212 CDB_LIBS="-lcdb"
213 else
214 einfo "Building with dev-db/cdb"
215 CDB_PATH="/usr/$(get_libdir)"
216 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
217 CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
218 done
219 fi
220 mylibs="${mylibs} ${CDB_LIBS}"
221 fi
222
223 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
224 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
225 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
226 filter-lfs-flags
227
228 # Workaround for bug #76512
229 if use hardened; then
230 [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
231 fi
232
233 # Remove annoying C++ comment style warnings - bug #378099
234 append-flags -Wno-comment
235
236 sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
237 sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
238 emake DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles
239 }
240
241 src_install () {
242 local myconf
243 use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
244 html_directory=\"/usr/share/doc/${PF}/html\""
245
246 /bin/sh postfix-install \
247 -non-interactive \
248 install_root="${D}" \
249 config_directory="/etc/postfix" \
250 manpage_directory="/usr/share/man" \
251 command_directory="/usr/sbin" \
252 mailq_path="/usr/bin/mailq" \
253 newaliases_path="/usr/bin/newaliases" \
254 sendmail_path="/usr/sbin/sendmail" \
255 ${myconf} \
256 || die "postfix-install failed"
257
258 # Fix spool removal on upgrade
259 rm -Rf "${D}"/var
260 keepdir /var/spool/postfix
261
262 # Install rmail for UUCP, closes bug #19127
263 dobin auxiliary/rmail/rmail
264
265 # Provide another link for legacy FSH
266 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
267
268 # Install qshape tool and posttls-finger
269 dobin auxiliary/qshape/qshape.pl
270 doman man/man1/qshape.1
271 dobin bin/posttls-finger
272 doman man/man1/posttls-finger.1
273
274 # Performance tuning tools and their manuals
275 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
276 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
277
278 # Set proper permissions on required files/directories
279 dodir /var/lib/postfix
280 keepdir /var/lib/postfix
281 fowners -R postfix:postfix /var/lib/postfix
282 fperms 0750 /var/lib/postfix
283 fowners root:postdrop /usr/sbin/post{drop,queue}
284 fperms 02711 /usr/sbin/post{drop,queue}
285
286 keepdir /etc/postfix
287 if use mbox; then
288 mypostconf="mail_spool_directory=/var/spool/mail"
289 else
290 mypostconf="home_mailbox=.maildir/"
291 fi
292 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
293 -e ${mypostconf} || die "postconf failed"
294
295 insinto /etc/postfix
296 newins "${FILESDIR}"/smtp.pass saslpass
297 fperms 600 /etc/postfix/saslpass
298
299 newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
300 # do not start mysql/postgres unnecessarily - bug #359913
301 use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
302 use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
303
304 dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
305 mv "${D}"/etc/postfix/{*.default,makedefs.out} "${D}"/usr/share/doc/${PF}/
306 use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
307
308 pamd_mimic_system smtp auth account
309
310 if use sasl; then
311 insinto /etc/sasl2
312 newins "${FILESDIR}"/smtp.sasl smtpd.conf
313 fi
314
315 # header files
316 insinto /usr/include/postfix
317 doins include/*.h
318
319 # Remove unnecessary files
320 rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
321 rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
322
323 systemd_dounit "${FILESDIR}/${PN}.service"
324 }
325
326 pkg_preinst() {
327 # Postfix 2.9.
328 # default for inet_protocols changed from ipv4 to all in postfix-2.9.
329 # check inet_protocols setting in main.cf and modify if necessary to prevent
330 # performance loss with useless DNS lookups and useless connection attempts.
331 [[ -d ${ROOT}/etc/postfix ]] && {
332 if [[ "$(${D}/usr/sbin/postconf -dh inet_protocols)" != "ipv4" ]]; then
333 if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n inet_protocols)" ]];
334 then
335 ewarn "\nCOMPATIBILITY: adding inet_protocols=ipv4 to main.cf."
336 ewarn "That will keep the same behaviour as previous postfix versions."
337 ewarn "Specify inet_protocols explicitly if you want to enable IPv6.\n"
338 else
339 # delete inet_protocols setting. there is already one in /etc/postfix
340 sed -i -e /inet_protocols/d "${D}"/etc/postfix/main.cf || die
341 fi
342 fi
343 }
344 }
345
346 pkg_postinst() {
347 # Do not install server.{key,pem) SSL certificates if they already exist
348 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
349 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
350 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
351 install_cert /etc/ssl/postfix/server
352 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
353 fi
354
355 if [[ ! -e /etc/mail/aliases.db ]] ; then
356 ewarn
357 ewarn "You must edit /etc/mail/aliases to suit your needs"
358 ewarn "and then run /usr/bin/newaliases. Postfix will not"
359 ewarn "work correctly without it."
360 ewarn
361 fi
362
363 if [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 9 ]]; then
364 elog "If you are using old style postfix instances by symlinking"
365 elog "startup scripts in ${ROOT}etc/init.d, please consider"
366 elog "upgrading your config for postmulti support. For more info:"
367 elog "http://www.postfix.org/MULTI_INSTANCE_README.html"
368 if ! use berkdb; then
369 ewarn "\nPostfix is installed without BerkeleyDB support."
370 ewarn "Please turn on berkdb USE flag if you need hash or"
371 ewarn "btree table lookups.\n"
372 fi
373 ewarn "Postfix daemons now live under /usr/libexec/postfix"
374 ewarn "Please adjust your main.cf accordingly by running"
375 ewarn "etc-update/dispatch-conf or similar and accepting the new"
376 ewarn "daemon_directory setting."
377 fi
378 }
379
380
381
382 1.1 mail-mta/postfix/postfix-3.0.0.ebuild
383
384 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-3.0.0.ebuild?rev=1.1&view=markup
385 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-3.0.0.ebuild?rev=1.1&content-type=text/plain
386
387 Index: postfix-3.0.0.ebuild
388 ===================================================================
389 # Copyright 1999-2015 Gentoo Foundation
390 # Distributed under the terms of the GNU General Public License v2
391 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-3.0.0.ebuild,v 1.1 2015/02/09 16:39:27 eras Exp $
392
393 EAPI=5
394 inherit eutils flag-o-matic multilib pam ssl-cert systemd toolchain-funcs user versionator
395
396 MY_PV="${PV/_rc/-RC}"
397 MY_SRC="${PN}-${MY_PV}"
398 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
399 VDA_PV="2.10.0"
400 VDA_P="${PN}-vda-v13-${VDA_PV}"
401 RC_VER="2.7"
402
403 DESCRIPTION="A fast and secure drop-in replacement for sendmail"
404 HOMEPAGE="http://www.postfix.org/"
405 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
406 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
407
408 LICENSE="IBM"
409 SLOT="0"
410 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
411 IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
412
413 DEPEND=">=dev-libs/libpcre-3.4
414 dev-lang/perl
415 berkdb? ( >=sys-libs/db-3.2:* )
416 cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
417 eai? ( dev-libs/icu )
418 ldap? ( net-nds/openldap )
419 ldap-bind? ( net-nds/openldap[sasl] )
420 lmdb? ( >=dev-db/lmdb-0.9.11 )
421 mysql? ( virtual/mysql )
422 pam? ( virtual/pam )
423 postgres? ( dev-db/postgresql:* )
424 sasl? ( >=dev-libs/cyrus-sasl-2 )
425 sqlite? ( dev-db/sqlite:3 )
426 ssl? ( >=dev-libs/openssl-0.9.6g:* )"
427
428 RDEPEND="${DEPEND}
429 dovecot-sasl? ( net-mail/dovecot )
430 memcached? ( net-misc/memcached )
431 net-mail/mailbase
432 !mail-mta/courier
433 !mail-mta/esmtp
434 !mail-mta/exim
435 !mail-mta/mini-qmail
436 !mail-mta/msmtp[mta]
437 !mail-mta/netqmail
438 !mail-mta/nullmailer
439 !mail-mta/qmail-ldap
440 !mail-mta/sendmail
441 !mail-mta/opensmtpd
442 !<mail-mta/ssmtp-2.64-r2
443 !>=mail-mta/ssmtp-2.64-r2[mta]
444 !net-mail/fastforward
445 selinux? ( sec-policy/selinux-postfix )"
446
447 # No vda support for postfix-3.0
448 REQUIRED_USE="ldap-bind? ( ldap sasl )
449 !vda"
450
451 S="${WORKDIR}/${MY_SRC}"
452
453 pkg_setup() {
454 # Add postfix, postdrop user/group (bug #77565)
455 enewgroup postfix 207
456 enewgroup postdrop 208
457 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
458 }
459
460 src_prepare() {
461 if use vda; then
462 epatch "${DISTDIR}"/${VDA_P}.patch
463 fi
464
465 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
466 src/util/sys_defs.h || die "sed failed"
467
468 # change default paths to better comply with portage standard paths
469 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
470
471 epatch_user
472 }
473
474 src_configure() {
475 for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
476 do
477 local AUXLIBS_${name}=""
478 done
479
480 # Make sure LDFLAGS get passed down to the executables.
481 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
482 AUXLIBS_PCRE="$(pcre-config --libs)"
483
484 use pam && mylibs="${mylibs} -lpam"
485
486 if use ldap; then
487 mycc="${mycc} -DHAS_LDAP"
488 AUXLIBS_LDAP="-lldap -llber"
489 fi
490
491 if use mysql; then
492 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
493 AUXLIBS_MYSQL="$(mysql_config --libs)"
494 fi
495
496 if use postgres; then
497 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
498 AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
499 fi
500
501 if use sqlite; then
502 mycc="${mycc} -DHAS_SQLITE"
503 AUXLIBS_SQLITE="-lsqlite3 -lpthread"
504 fi
505
506 if use ssl; then
507 mycc="${mycc} -DUSE_TLS"
508 mylibs="${mylibs} -lssl -lcrypto"
509 fi
510
511 if use lmdb; then
512 mycc="${mycc} -DHAS_LMDB"
513 AUXLIBS_LMDB="-llmdb -lpthread"
514 fi
515
516 if ! use eai; then
517 mycc="${mycc} -DNO_EAI"
518 fi
519
520 # broken. and "in other words, not supported" by upstream.
521 # Use inet_protocols setting in main.cf
522 #if ! use ipv6; then
523 # mycc="${mycc} -DNO_IPV6"
524 #fi
525
526 if use sasl; then
527 if use dovecot-sasl; then
528 # Set dovecot as default.
529 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
530 fi
531 if use ldap-bind; then
532 mycc="${mycc} -DUSE_LDAP_SASL"
533 fi
534 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
535 mylibs="${mylibs} -lsasl2"
536 elif use dovecot-sasl; then
537 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
538 fi
539
540 if ! use nis; then
541 mycc="${mycc} -DNO_NIS"
542 fi
543
544 if ! use berkdb; then
545 mycc="${mycc} -DNO_DB"
546 if use cdb; then
547 # change default hash format from Berkeley DB to cdb
548 mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
549 fi
550 fi
551
552 if use cdb; then
553 mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
554 # Tinycdb is preferred.
555 if has_version dev-db/tinycdb ; then
556 einfo "Building with dev-db/tinycdb"
557 AUXLIBS_CDB="-lcdb"
558 else
559 einfo "Building with dev-db/cdb"
560 CDB_PATH="/usr/$(get_libdir)"
561 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
562 AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
563 done
564 fi
565 fi
566
567 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
568 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
569 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
570 filter-lfs-flags
571
572 # Workaround for bug #76512
573 if use hardened; then
574 [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
575 fi
576
577 # Remove annoying C++ comment style warnings - bug #378099
578 append-flags -Wno-comment
579
580 sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
581 sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
582
583 emake makefiles shared=yes dynamicmaps=no \
584 shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
585 DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
586 AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
587 AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
588 AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
589 AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
590 }
591
592 src_install () {
593 local myconf
594 use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
595 html_directory=\"/usr/share/doc/${PF}/html\""
596
597 LD_LIBRARY_PATH="${S}/lib" \
598 /bin/sh postfix-install \
599 -non-interactive \
600 install_root="${D}" \
601 config_directory="/etc/postfix" \
602 manpage_directory="/usr/share/man" \
603 command_directory="/usr/sbin" \
604 mailq_path="/usr/bin/mailq" \
605 newaliases_path="/usr/bin/newaliases" \
606 sendmail_path="/usr/sbin/sendmail" \
607 ${myconf} \
608 || die "postfix-install failed"
609
610 # Fix spool removal on upgrade
611 rm -Rf "${D}"/var
612 keepdir /var/spool/postfix
613
614 # Install rmail for UUCP, closes bug #19127
615 dobin auxiliary/rmail/rmail
616
617 # Provide another link for legacy FSH
618 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
619
620 # Install qshape tool and posttls-finger
621 dobin auxiliary/qshape/qshape.pl
622 doman man/man1/qshape.1
623 dobin bin/posttls-finger
624 doman man/man1/posttls-finger.1
625
626 # Performance tuning tools and their manuals
627 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
628 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
629
630 # Set proper permissions on required files/directories
631 dodir /var/lib/postfix
632 keepdir /var/lib/postfix
633 fowners -R postfix:postfix /var/lib/postfix
634 fperms 0750 /var/lib/postfix
635 fowners root:postdrop /usr/sbin/post{drop,queue}
636 fperms 02711 /usr/sbin/post{drop,queue}
637
638 keepdir /etc/postfix
639 if use mbox; then
640 mypostconf="mail_spool_directory=/var/spool/mail"
641 else
642 mypostconf="home_mailbox=.maildir/"
643 fi
644 LD_LIBRARY_PATH="${S}/lib" \
645 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
646 -e ${mypostconf} || die "postconf failed"
647
648 insinto /etc/postfix
649 newins "${FILESDIR}"/smtp.pass saslpass
650 fperms 600 /etc/postfix/saslpass
651
652 newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
653 # do not start mysql/postgres unnecessarily - bug #359913
654 use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
655 use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
656
657 dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
658 mv "${D}"/etc/postfix/{*.default,makedefs.out,*.proto} "${D}"/usr/share/doc/${PF}/
659 use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
660
661 pamd_mimic_system smtp auth account
662
663 if use sasl; then
664 insinto /etc/sasl2
665 newins "${FILESDIR}"/smtp.sasl smtpd.conf
666 fi
667
668 # header files
669 insinto /usr/include/postfix
670 doins include/*.h
671
672 # Remove unnecessary files
673 rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
674 rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
675
676 if has_version mail-mta/postfix; then
677 # let the sysadmin decide when to change the compatibility_level
678 sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
679 fi
680
681 systemd_dounit "${FILESDIR}/${PN}.service"
682 }
683
684 pkg_postinst() {
685 # Do not install server.{key,pem) SSL certificates if they already exist
686 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
687 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
688 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
689 install_cert /etc/ssl/postfix/server
690 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
691 fi
692
693 if [[ ! -e /etc/mail/aliases.db ]] ; then
694 ewarn
695 ewarn "You must edit /etc/mail/aliases to suit your needs"
696 ewarn "and then run /usr/bin/newaliases. Postfix will not"
697 ewarn "work correctly without it."
698 ewarn
699 fi
700 }
701
702
703
704 1.1 mail-mta/postfix/postfix-3.1_pre20150208.ebuild
705
706 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-3.1_pre20150208.ebuild?rev=1.1&view=markup
707 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-3.1_pre20150208.ebuild?rev=1.1&content-type=text/plain
708
709 Index: postfix-3.1_pre20150208.ebuild
710 ===================================================================
711 # Copyright 1999-2015 Gentoo Foundation
712 # Distributed under the terms of the GNU General Public License v2
713 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-3.1_pre20150208.ebuild,v 1.1 2015/02/09 16:39:27 eras Exp $
714
715 EAPI=5
716 inherit eutils flag-o-matic multilib pam ssl-cert systemd toolchain-funcs user versionator
717
718 MY_PV="${PV/_pre/-}"
719 MY_SRC="${PN}-${MY_PV}"
720 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/experimental"
721 VDA_PV="2.10.0"
722 VDA_P="${PN}-vda-v13-${VDA_PV}"
723 RC_VER="2.7"
724
725 DESCRIPTION="A fast and secure drop-in replacement for sendmail"
726 HOMEPAGE="http://www.postfix.org/"
727 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
728 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
729
730 LICENSE="IBM"
731 SLOT="0"
732 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
733 IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
734
735 DEPEND=">=dev-libs/libpcre-3.4
736 dev-lang/perl
737 berkdb? ( >=sys-libs/db-3.2:* )
738 cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
739 eai? ( dev-libs/icu )
740 ldap? ( net-nds/openldap )
741 ldap-bind? ( net-nds/openldap[sasl] )
742 lmdb? ( >=dev-db/lmdb-0.9.11 )
743 mysql? ( virtual/mysql )
744 pam? ( virtual/pam )
745 postgres? ( dev-db/postgresql:* )
746 sasl? ( >=dev-libs/cyrus-sasl-2 )
747 sqlite? ( dev-db/sqlite:3 )
748 ssl? ( >=dev-libs/openssl-0.9.6g:* )"
749
750 RDEPEND="${DEPEND}
751 dovecot-sasl? ( net-mail/dovecot )
752 memcached? ( net-misc/memcached )
753 net-mail/mailbase
754 !mail-mta/courier
755 !mail-mta/esmtp
756 !mail-mta/exim
757 !mail-mta/mini-qmail
758 !mail-mta/msmtp[mta]
759 !mail-mta/netqmail
760 !mail-mta/nullmailer
761 !mail-mta/qmail-ldap
762 !mail-mta/sendmail
763 !mail-mta/opensmtpd
764 !<mail-mta/ssmtp-2.64-r2
765 !>=mail-mta/ssmtp-2.64-r2[mta]
766 !net-mail/fastforward
767 selinux? ( sec-policy/selinux-postfix )"
768
769 # No vda support for postfix-3.0
770 REQUIRED_USE="ldap-bind? ( ldap sasl )
771 !vda"
772
773 S="${WORKDIR}/${MY_SRC}"
774
775 pkg_setup() {
776 # Add postfix, postdrop user/group (bug #77565)
777 enewgroup postfix 207
778 enewgroup postdrop 208
779 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
780 }
781
782 src_prepare() {
783 if use vda; then
784 epatch "${DISTDIR}"/${VDA_P}.patch
785 fi
786
787 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
788 src/util/sys_defs.h || die "sed failed"
789
790 # change default paths to better comply with portage standard paths
791 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
792
793 epatch_user
794 }
795
796 src_configure() {
797 for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
798 do
799 local AUXLIBS_${name}=""
800 done
801
802 # Make sure LDFLAGS get passed down to the executables.
803 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
804 AUXLIBS_PCRE="$(pcre-config --libs)"
805
806 use pam && mylibs="${mylibs} -lpam"
807
808 if use ldap; then
809 mycc="${mycc} -DHAS_LDAP"
810 AUXLIBS_LDAP="-lldap -llber"
811 fi
812
813 if use mysql; then
814 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
815 AUXLIBS_MYSQL="$(mysql_config --libs)"
816 fi
817
818 if use postgres; then
819 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
820 AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
821 fi
822
823 if use sqlite; then
824 mycc="${mycc} -DHAS_SQLITE"
825 AUXLIBS_SQLITE="-lsqlite3 -lpthread"
826 fi
827
828 if use ssl; then
829 mycc="${mycc} -DUSE_TLS"
830 mylibs="${mylibs} -lssl -lcrypto"
831 fi
832
833 if use lmdb; then
834 mycc="${mycc} -DHAS_LMDB"
835 AUXLIBS_LMDB="-llmdb -lpthread"
836 fi
837
838 if ! use eai; then
839 mycc="${mycc} -DNO_EAI"
840 fi
841
842 # broken. and "in other words, not supported" by upstream.
843 # Use inet_protocols setting in main.cf
844 #if ! use ipv6; then
845 # mycc="${mycc} -DNO_IPV6"
846 #fi
847
848 if use sasl; then
849 if use dovecot-sasl; then
850 # Set dovecot as default.
851 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
852 fi
853 if use ldap-bind; then
854 mycc="${mycc} -DUSE_LDAP_SASL"
855 fi
856 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
857 mylibs="${mylibs} -lsasl2"
858 elif use dovecot-sasl; then
859 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
860 fi
861
862 if ! use nis; then
863 mycc="${mycc} -DNO_NIS"
864 fi
865
866 if ! use berkdb; then
867 mycc="${mycc} -DNO_DB"
868 if use cdb; then
869 # change default hash format from Berkeley DB to cdb
870 mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
871 fi
872 fi
873
874 if use cdb; then
875 mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
876 # Tinycdb is preferred.
877 if has_version dev-db/tinycdb ; then
878 einfo "Building with dev-db/tinycdb"
879 AUXLIBS_CDB="-lcdb"
880 else
881 einfo "Building with dev-db/cdb"
882 CDB_PATH="/usr/$(get_libdir)"
883 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
884 AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
885 done
886 fi
887 fi
888
889 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
890 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
891 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
892 filter-lfs-flags
893
894 # Workaround for bug #76512
895 if use hardened; then
896 [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
897 fi
898
899 # Remove annoying C++ comment style warnings - bug #378099
900 append-flags -Wno-comment
901
902 sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
903 sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
904
905 emake makefiles shared=yes dynamicmaps=no pie=yes \
906 shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
907 DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
908 AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
909 AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
910 AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
911 AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
912 }
913
914 src_install () {
915 local myconf
916 use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
917 html_directory=\"/usr/share/doc/${PF}/html\""
918
919 LD_LIBRARY_PATH="${S}/lib" \
920 /bin/sh postfix-install \
921 -non-interactive \
922 install_root="${D}" \
923 config_directory="/etc/postfix" \
924 manpage_directory="/usr/share/man" \
925 command_directory="/usr/sbin" \
926 mailq_path="/usr/bin/mailq" \
927 newaliases_path="/usr/bin/newaliases" \
928 sendmail_path="/usr/sbin/sendmail" \
929 ${myconf} \
930 || die "postfix-install failed"
931
932 # Fix spool removal on upgrade
933 rm -Rf "${D}"/var
934 keepdir /var/spool/postfix
935
936 # Install rmail for UUCP, closes bug #19127
937 dobin auxiliary/rmail/rmail
938
939 # Provide another link for legacy FSH
940 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
941
942 # Install qshape tool and posttls-finger
943 dobin auxiliary/qshape/qshape.pl
944 doman man/man1/qshape.1
945 dobin bin/posttls-finger
946 doman man/man1/posttls-finger.1
947
948 # Performance tuning tools and their manuals
949 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
950 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
951
952 # Set proper permissions on required files/directories
953 dodir /var/lib/postfix
954 keepdir /var/lib/postfix
955 fowners -R postfix:postfix /var/lib/postfix
956 fperms 0750 /var/lib/postfix
957 fowners root:postdrop /usr/sbin/post{drop,queue}
958 fperms 02711 /usr/sbin/post{drop,queue}
959
960 keepdir /etc/postfix
961 if use mbox; then
962 mypostconf="mail_spool_directory=/var/spool/mail"
963 else
964 mypostconf="home_mailbox=.maildir/"
965 fi
966 LD_LIBRARY_PATH="${S}/lib" \
967 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
968 -e ${mypostconf} || die "postconf failed"
969
970 insinto /etc/postfix
971 newins "${FILESDIR}"/smtp.pass saslpass
972 fperms 600 /etc/postfix/saslpass
973
974 newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
975 # do not start mysql/postgres unnecessarily - bug #359913
976 use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
977 use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
978
979 dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
980 mv "${D}"/etc/postfix/{*.default,*.proto} "${D}"/usr/share/doc/${PF}/
981 use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
982
983 pamd_mimic_system smtp auth account
984
985 if use sasl; then
986 insinto /etc/sasl2
987 newins "${FILESDIR}"/smtp.sasl smtpd.conf
988 fi
989
990 # header files
991 insinto /usr/include/postfix
992 doins include/*.h
993
994 # Remove unnecessary files
995 rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
996 rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
997
998 if has_version mail-mta/postfix; then
999 # let the sysadmin decide when to change the compatibility_level
1000 sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
1001 fi
1002
1003 systemd_dounit "${FILESDIR}/${PN}.service"
1004 }
1005
1006 pkg_postinst() {
1007 # Do not install server.{key,pem) SSL certificates if they already exist
1008 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
1009 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
1010 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
1011 install_cert /etc/ssl/postfix/server
1012 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
1013 fi
1014
1015 if [[ ! -e /etc/mail/aliases.db ]] ; then
1016 ewarn
1017 ewarn "You must edit /etc/mail/aliases to suit your needs"
1018 ewarn "and then run /usr/bin/newaliases. Postfix will not"
1019 ewarn "work correctly without it."
1020 ewarn
1021 fi
1022 }