Gentoo Archives: gentoo-commits

From: Eray Aslan <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-mta/postfix/, mail-mta/postfix/files/
Date: Tue, 24 Sep 2019 04:53:36
Message-Id: 1569300742.38495cf1befec938e3dcf90adf74ae085939bee0.eras@gentoo
1 commit: 38495cf1befec938e3dcf90adf74ae085939bee0
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 24 04:52:22 2019 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 24 04:52:22 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38495cf1
7
8 mail-mta/postfix: bump to 3.4.7
9
10 and fix building with glibc-2.30
11 Closes: https://bugs.gentoo.org/692144
12 Package-Manager: Portage-2.3.76, Repoman-2.3.17
13 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
14
15 mail-mta/postfix/Manifest | 1 +
16 mail-mta/postfix/files/postfix-glibc230.patch | 31 +++
17 mail-mta/postfix/postfix-3.4.7.ebuild | 318 ++++++++++++++++++++++++++
18 3 files changed, 350 insertions(+)
19
20 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
21 index cc20f6ff2a2..7f875606383 100644
22 --- a/mail-mta/postfix/Manifest
23 +++ b/mail-mta/postfix/Manifest
24 @@ -1,5 +1,6 @@
25 DIST postfix-2.10.9.tar.gz 3820525 BLAKE2B ed1fc10f016cdc63fe2b86c68cca270c98348417babf6d8e05f76fa2550f5cbca95825f14cf54897e66323cdbe6132a1046402b853b6f000ade630277278c748 SHA512 c77df7ccc051bd72271dc5298da0ca4e45397b1ba96fc8be31e095f5b15cd30ebc0b29cf638e76efc65503cb241efd937f2d64aaa97243402c35e2927b7a7b91
26 DIST postfix-3.4.5.tar.gz 4581301 BLAKE2B 9de66cab6eea610fc83e4629980b3e201b4e3f9185729cb84933aa940b64b7818d0439c5145ea0b635666db92c970e1974f4f439cd3b733c58e1fe5794c046fa SHA512 af59d960b40799f7667935bef8fafb93ae6dcb70abaa77a15cf498571f37fa0429f411f9f08b1b6bfa588d3f572260d14d6d5409f0cd1e82b1c59928b2124c94
27 DIST postfix-3.4.6.tar.gz 4571771 BLAKE2B e08b2e6c01fe54fcc7439182783190f4adb81758a1bbcc1bfec71e02dca91a779308f624e081837f7e2deec8666f10bc51238e90cc952de6c8371fb18790604f SHA512 96430d60cf58b9876e52a742dbfe3ca1da4ec82eeea5cd35c6ee4e69714ddd5601561a6663aac51a34b2d64db4f7678d7c5d720ec9ead807b5d7e87e37434961
28 +DIST postfix-3.4.7.tar.gz 4572758 BLAKE2B 8d811293672fc2a1e0e3276fadd172d9e130a3e0b5ccbaf27ddf183a50f25ca9bbf5c0a28806bb1f79d5648c4de44edd8ee98192355077e29a0c69a2685878dc SHA512 2bc29a87a65c46d06b6fc51c4cdf22da773e63f19488871e040eba6250bf686eecc7de11e14224018c35b061e66e1759c69dc649d7388f724a58080195209e68
29 DIST postfix-3.5-20190914.tar.gz 4618078 BLAKE2B 5c065ed430327f538cfd66e1784d31ae01b809a44c46079861f8ce9e5e220f36a053d410da8df6cd0ee1b93ff432e98ba5584c42801ce34bb1438f9ddbdbce4e SHA512 320fe67b86e81e51448c7874b35c71ca525b19f1744c783f6e20b032f843e267bba8c57e6ddd11b941b68f85af9bee8d80699d5859d6a76ee83e45cf8bcbc8d1
30 DIST postfix-vda-v13-2.10.0.patch 55701 BLAKE2B d8df041bb4ae7457cd066e71b6ae9470840d42edc9990a550ae51356cd62bfb08516250249030da26d1ef475619f0ebd609570d84ce57f8cdc347a2824b29536 SHA512 0b4b53a8cd28abf56eee3b2ed63ca1814251b60816e6ca1143249d25fd6ef7f905bec3134125ac6e851af685db8aae878012113693261529ae2ddbcf1bd93e62
31
32 diff --git a/mail-mta/postfix/files/postfix-glibc230.patch b/mail-mta/postfix/files/postfix-glibc230.patch
33 new file mode 100644
34 index 00000000000..23a869bd8d4
35 --- /dev/null
36 +++ b/mail-mta/postfix/files/postfix-glibc230.patch
37 @@ -0,0 +1,31 @@
38 +--- a/src/dns/dns_str_resflags.c 2016-05-15 18:20:14.000000000 +0300
39 ++++ b/src/dns/dns_str_resflags.c 2019-05-03 17:29:16.000000000 +0300
40 +@@ -52,18 +52,28 @@
41 + static const LONG_NAME_MASK resflag_table[] = {
42 + "RES_INIT", RES_INIT,
43 + "RES_DEBUG", RES_DEBUG,
44 ++#ifdef RES_AAONLY
45 + "RES_AAONLY", RES_AAONLY,
46 ++#endif
47 + "RES_USEVC", RES_USEVC,
48 ++#ifdef RES_PRIMARY
49 + "RES_PRIMARY", RES_PRIMARY,
50 ++#endif
51 + "RES_IGNTC", RES_IGNTC,
52 + "RES_RECURSE", RES_RECURSE,
53 + "RES_DEFNAMES", RES_DEFNAMES,
54 + "RES_STAYOPEN", RES_STAYOPEN,
55 + "RES_DNSRCH", RES_DNSRCH,
56 ++#ifdef RES_INSECURE1
57 + "RES_INSECURE1", RES_INSECURE1,
58 ++#endif
59 ++#ifdef RES_INSECURE2
60 + "RES_INSECURE2", RES_INSECURE2,
61 ++#endif
62 + "RES_NOALIASES", RES_NOALIASES,
63 ++#ifdef RES_USE_INET6
64 + "RES_USE_INET6", RES_USE_INET6,
65 ++#endif
66 + #ifdef RES_ROTATE
67 + "RES_ROTATE", RES_ROTATE,
68 + #endif
69
70 diff --git a/mail-mta/postfix/postfix-3.4.7.ebuild b/mail-mta/postfix/postfix-3.4.7.ebuild
71 new file mode 100644
72 index 00000000000..2cd31c520af
73 --- /dev/null
74 +++ b/mail-mta/postfix/postfix-3.4.7.ebuild
75 @@ -0,0 +1,318 @@
76 +# Copyright 1999-2019 Gentoo Authors
77 +# Distributed under the terms of the GNU General Public License v2
78 +
79 +EAPI=7
80 +
81 +inherit flag-o-matic pam systemd toolchain-funcs
82 +
83 +MY_PV="${PV/_rc/-RC}"
84 +MY_SRC="${PN}-${MY_PV}"
85 +MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
86 +RC_VER="2.7"
87 +
88 +DESCRIPTION="A fast and secure drop-in replacement for sendmail"
89 +HOMEPAGE="http://www.postfix.org/"
90 +SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
91 +
92 +LICENSE="|| ( IBM EPL-2.0 )"
93 +SLOT="0"
94 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
95 +IUSE="+berkdb cdb dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
96 +
97 +DEPEND=">=dev-libs/libpcre-3.4
98 + dev-lang/perl
99 + berkdb? ( >=sys-libs/db-3.2:* )
100 + cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
101 + eai? ( dev-libs/icu:= )
102 + ldap? ( net-nds/openldap )
103 + ldap-bind? ( net-nds/openldap[sasl] )
104 + lmdb? ( >=dev-db/lmdb-0.9.11 )
105 + mysql? ( dev-db/mysql-connector-c:0= )
106 + nis? ( net-libs/libnsl )
107 + pam? ( virtual/pam )
108 + postgres? ( dev-db/postgresql:* )
109 + sasl? ( >=dev-libs/cyrus-sasl-2 )
110 + sqlite? ( dev-db/sqlite:3 )
111 + ssl? (
112 + !libressl? ( dev-libs/openssl:0= )
113 + libressl? ( >=dev-libs/libressl-2.9.1:0= )
114 + )"
115 +
116 +RDEPEND="${DEPEND}
117 + acct-group/postfix
118 + acct-group/postdrop
119 + acct-user/postfix
120 + memcached? ( net-misc/memcached )
121 + net-mail/mailbase
122 + !mail-mta/courier
123 + !mail-mta/esmtp
124 + !mail-mta/exim
125 + !mail-mta/mini-qmail
126 + !mail-mta/msmtp[mta]
127 + !mail-mta/netqmail
128 + !mail-mta/nullmailer
129 + !mail-mta/qmail-ldap
130 + !mail-mta/sendmail
131 + !mail-mta/opensmtpd
132 + !<mail-mta/ssmtp-2.64-r2
133 + !>=mail-mta/ssmtp-2.64-r2[mta]
134 + !net-mail/fastforward
135 + selinux? ( sec-policy/selinux-postfix )"
136 +
137 +REQUIRED_USE="ldap-bind? ( ldap sasl )"
138 +
139 +S="${WORKDIR}/${MY_SRC}"
140 +
141 +PATCHES=(
142 + "${FILESDIR}/${PN}-libressl-certkey.patch"
143 + "${FILESDIR}/${PN}-libressl-server.patch"
144 + "${FILESDIR}/${PN}-glibc230.patch"
145 +)
146 +
147 +src_prepare() {
148 + default
149 + sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
150 + src/util/sys_defs.h || die "sed failed"
151 + # change default paths to better comply with portage standard paths
152 + sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
153 +}
154 +
155 +src_configure() {
156 + for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
157 + do
158 + local AUXLIBS_${name}=""
159 + done
160 +
161 + # Make sure LDFLAGS get passed down to the executables.
162 + local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
163 + AUXLIBS_PCRE="$(pcre-config --libs)"
164 +
165 + use pam && mylibs="${mylibs} -lpam"
166 +
167 + if use ldap; then
168 + mycc="${mycc} -DHAS_LDAP"
169 + AUXLIBS_LDAP="-lldap -llber"
170 + fi
171 +
172 + if use mysql; then
173 + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
174 + AUXLIBS_MYSQL="$(mysql_config --libs)"
175 + fi
176 +
177 + if use postgres; then
178 + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
179 + AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
180 + fi
181 +
182 + if use sqlite; then
183 + mycc="${mycc} -DHAS_SQLITE"
184 + AUXLIBS_SQLITE="-lsqlite3 -lpthread"
185 + fi
186 +
187 + if use ssl; then
188 + mycc="${mycc} -DUSE_TLS"
189 + mylibs="${mylibs} -lssl -lcrypto"
190 + fi
191 +
192 + if use lmdb; then
193 + mycc="${mycc} -DHAS_LMDB"
194 + AUXLIBS_LMDB="-llmdb -lpthread"
195 + fi
196 +
197 + if ! use eai; then
198 + mycc="${mycc} -DNO_EAI"
199 + fi
200 +
201 + # broken. and "in other words, not supported" by upstream.
202 + # Use inet_protocols setting in main.cf
203 + #if ! use ipv6; then
204 + # mycc="${mycc} -DNO_IPV6"
205 + #fi
206 +
207 + if use sasl; then
208 + if use dovecot-sasl; then
209 + # Set dovecot as default.
210 + mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
211 + fi
212 + if use ldap-bind; then
213 + mycc="${mycc} -DUSE_LDAP_SASL"
214 + fi
215 + mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
216 + mylibs="${mylibs} -lsasl2"
217 + elif use dovecot-sasl; then
218 + mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
219 + fi
220 +
221 + if ! use nis; then
222 + mycc="${mycc} -DNO_NIS"
223 + fi
224 +
225 + if ! use berkdb; then
226 + mycc="${mycc} -DNO_DB"
227 + if use cdb; then
228 + # change default hash format from Berkeley DB to cdb
229 + mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
230 + fi
231 + fi
232 +
233 + if use cdb; then
234 + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
235 + # Tinycdb is preferred.
236 + if has_version dev-db/tinycdb ; then
237 + einfo "Building with dev-db/tinycdb"
238 + AUXLIBS_CDB="-lcdb"
239 + else
240 + einfo "Building with dev-db/cdb"
241 + CDB_PATH="/usr/$(get_libdir)"
242 + for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
243 + AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
244 + done
245 + fi
246 + fi
247 +
248 + # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
249 + # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
250 + mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
251 + filter-lfs-flags
252 +
253 + # Workaround for bug #76512
254 + if use hardened; then
255 + [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
256 + fi
257 +
258 + # Remove annoying C++ comment style warnings - bug #378099
259 + append-flags -Wno-comment
260 +
261 + sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
262 + sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
263 +
264 + emake makefiles shared=yes dynamicmaps=no pie=yes \
265 + shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
266 + DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
267 + AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
268 + AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
269 + AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
270 + AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
271 +}
272 +
273 +src_install () {
274 + LD_LIBRARY_PATH="${S}/lib" \
275 + /bin/sh postfix-install \
276 + -non-interactive \
277 + install_root="${D}" \
278 + config_directory="/etc/postfix" \
279 + manpage_directory="/usr/share/man" \
280 + command_directory="/usr/sbin" \
281 + mailq_path="/usr/bin/mailq" \
282 + newaliases_path="/usr/bin/newaliases" \
283 + sendmail_path="/usr/sbin/sendmail" \
284 + || die "postfix-install failed"
285 +
286 + # Fix spool removal on upgrade
287 + rm -Rf "${D}"/var
288 + keepdir /var/spool/postfix
289 +
290 + # Install rmail for UUCP, closes bug #19127
291 + dobin auxiliary/rmail/rmail
292 +
293 + # Provide another link for legacy FSH
294 + dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
295 +
296 + # Install qshape, posttls-finger and collate
297 + dobin auxiliary/qshape/qshape.pl
298 + doman man/man1/qshape.1
299 + dobin bin/posttls-finger
300 + doman man/man1/posttls-finger.1
301 + dobin auxiliary/collate/collate.pl
302 + newdoc auxiliary/collate/README README.collate
303 +
304 + # Performance tuning tools and their manuals
305 + dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
306 + doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
307 +
308 + # Set proper permissions on required files/directories
309 + keepdir /var/lib/postfix
310 + fowners -R postfix:postfix /var/lib/postfix
311 + fperms 0750 /var/lib/postfix
312 + fowners root:postdrop /usr/sbin/post{drop,queue}
313 + fperms 02755 /usr/sbin/post{drop,queue}
314 +
315 + keepdir /etc/postfix
316 + keepdir /etc/postfix/postfix-files.d
317 + if use mbox; then
318 + mypostconf="mail_spool_directory=/var/spool/mail"
319 + else
320 + mypostconf="home_mailbox=.maildir/"
321 + fi
322 + LD_LIBRARY_PATH="${S}/lib" \
323 + "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
324 + -e ${mypostconf} || die "postconf failed"
325 +
326 + insinto /etc/postfix
327 + newins "${FILESDIR}"/smtp.pass saslpass
328 + fperms 600 /etc/postfix/saslpass
329 +
330 + newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
331 + # do not start mysql/postgres unnecessarily - bug #359913
332 + use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
333 + use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
334 +
335 + dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
336 + mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
337 + # postfix set-permissions expects uncompressed man files
338 + docompress -x /usr/share/man
339 +
340 + pamd_mimic_system smtp auth account
341 +
342 + if use sasl; then
343 + insinto /etc/sasl2
344 + newins "${FILESDIR}"/smtp.sasl smtpd.conf
345 + fi
346 +
347 + # header files
348 + insinto /usr/include/postfix
349 + doins include/*.h
350 +
351 + if has_version mail-mta/postfix; then
352 + # let the sysadmin decide when to change the compatibility_level
353 + sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
354 + fi
355 +
356 + systemd_dounit "${FILESDIR}/${PN}.service"
357 +}
358 +
359 +pkg_preinst() {
360 + if has_version '<mail-mta/postfix-3.4'; then
361 + elog
362 + elog "Postfix-3.4 introduces a new master.cf service 'postlog'"
363 + elog "with type 'unix-dgram' that is used by the new postlogd(8) daemon."
364 + elog "Before backing out to an older Postfix version, edit the master.cf"
365 + elog "file and remove the postlog entry."
366 + elog
367 + fi
368 +}
369 +
370 +pkg_postinst() {
371 + if [[ ! -e /etc/mail/aliases.db ]] ; then
372 + ewarn
373 + ewarn "You must edit /etc/mail/aliases to suit your needs"
374 + ewarn "and then run /usr/bin/newaliases. Postfix will not"
375 + ewarn "work correctly without it."
376 + ewarn
377 + fi
378 +
379 + # check and fix file permissions
380 + "${EROOT}"/usr/sbin/postfix set-permissions
381 +
382 + # configure tls
383 + if use ssl ; then
384 + if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
385 + elog "To configure client side TLS settings:"
386 + elog "${EROOT}"/usr/sbin/postfix tls enable-client
387 + fi
388 + if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
389 + elog "To configure server side TLS settings:"
390 + elog "${EROOT}"/usr/sbin/postfix tls enable-server
391 + fi
392 + fi
393 +}