Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: mail-mta/postfix/
Date: Mon, 29 Jan 2018 19:12:15
Message-Id: 1517145707.d5addc7d8110d96b35ac1c8f58d5dabd9be00b11.lluixhi@gentoo
1 commit: d5addc7d8110d96b35ac1c8f58d5dabd9be00b11
2 Author: Pierre-Olivier Mercier <nemunaire <AT> nemunai <DOT> re>
3 AuthorDate: Sun Jan 28 13:21:32 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Sun Jan 28 13:21:47 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=d5addc7d
7
8 mail-mta/postfix: sync 3.2.4 with upstream
9
10 mail-mta/postfix/Manifest | 3 +-
11 mail-mta/postfix/postfix-3.2.4.ebuild | 309 ++++++++++++++++++++++++++++++++++
12 2 files changed, 311 insertions(+), 1 deletion(-)
13
14 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
15 index 909aae4..3493921 100644
16 --- a/mail-mta/postfix/Manifest
17 +++ b/mail-mta/postfix/Manifest
18 @@ -1 +1,2 @@
19 -DIST postfix-3.1.6.tar.gz 4341308 SHA256 e5eb005fd133c6a32ca03e796e0192945eb877be8eb727f30d25547c997c5aa6 SHA512 646317393d33fcec99bef7f3dc142a847591927bc034c0c71e578baedad1875040cfeabdaa3436312f60485cb69bbdb31197aa9e7526a457946d7749b781099b WHIRLPOOL 66a087da3b33353a22176b9162fe0679f8ff35e48ae693a3315d52232e662638d48b8827648c0b0368e018161e1ade6a671773c109208ded9659cca26b1b5ea1
20 +DIST postfix-3.1.6.tar.gz 4341308 BLAKE2B 6a5ec763cf96770240f63b35b4532c555cc6e5e807aeaa526366d3069e83399e470703677ed63f51c4d4178ed66b3644b71b5f586ba78f4bfe5caad4b36c13f9 SHA512 646317393d33fcec99bef7f3dc142a847591927bc034c0c71e578baedad1875040cfeabdaa3436312f60485cb69bbdb31197aa9e7526a457946d7749b781099b
21 +DIST postfix-3.2.4.tar.gz 4390376 BLAKE2B 132a6b467f9156d716a92cc7beae0f9a7c47e6a2045e83726a5e7305e6f9bf666ebcfb93a9ab1a96ec988431661059d62e926287bd13089eeb4bab3e8f4b9fc7 SHA512 6dc583d3b1c98f5c8d6486351bee9f92a98b5379cd0d76d26a382379c112317e7a2a58c3a200477a6d0f831c73395257d1a63170df17ea8a65a4048a7df391f8
22
23 diff --git a/mail-mta/postfix/postfix-3.2.4.ebuild b/mail-mta/postfix/postfix-3.2.4.ebuild
24 new file mode 100644
25 index 0000000..a6bffaa
26 --- /dev/null
27 +++ b/mail-mta/postfix/postfix-3.2.4.ebuild
28 @@ -0,0 +1,309 @@
29 +# Copyright 1999-2018 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +
32 +EAPI=6
33 +inherit flag-o-matic pam systemd toolchain-funcs user
34 +
35 +MY_PV="${PV/_pre/-}"
36 +MY_SRC="${PN}-${MY_PV}"
37 +MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
38 +RC_VER="2.7"
39 +
40 +DESCRIPTION="A fast and secure drop-in replacement for sendmail"
41 +HOMEPAGE="http://www.postfix.org/"
42 +SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
43 +
44 +LICENSE="IBM"
45 +SLOT="0"
46 +KEYWORDS="amd64 arm ~mips ppc x86"
47 +IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
48 +
49 +DEPEND=">=dev-libs/libpcre-3.4
50 + dev-lang/perl
51 + berkdb? ( >=sys-libs/db-3.2:* )
52 + cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
53 + eai? ( dev-libs/icu:= )
54 + ldap? ( net-nds/openldap )
55 + ldap-bind? ( net-nds/openldap[sasl] )
56 + lmdb? ( >=dev-db/lmdb-0.9.11 )
57 + mysql? ( virtual/mysql )
58 + pam? ( virtual/pam )
59 + postgres? ( dev-db/postgresql:* )
60 + sasl? ( >=dev-libs/cyrus-sasl-2 )
61 + sqlite? ( dev-db/sqlite:3 )
62 + ssl? (
63 + !libressl? ( dev-libs/openssl:0 )
64 + libressl? ( dev-libs/libressl )
65 + )"
66 +
67 +RDEPEND="${DEPEND}
68 + dovecot-sasl? ( net-mail/dovecot )
69 + memcached? ( net-misc/memcached )
70 + net-mail/mailbase
71 + !mail-mta/courier
72 + !mail-mta/esmtp
73 + !mail-mta/exim
74 + !mail-mta/mini-qmail
75 + !mail-mta/msmtp[mta]
76 + !mail-mta/netqmail
77 + !mail-mta/nullmailer
78 + !mail-mta/qmail-ldap
79 + !mail-mta/sendmail
80 + !mail-mta/opensmtpd
81 + !<mail-mta/ssmtp-2.64-r2
82 + !>=mail-mta/ssmtp-2.64-r2[mta]
83 + !net-mail/fastforward
84 + selinux? ( sec-policy/selinux-postfix )"
85 +
86 +REQUIRED_USE="ldap-bind? ( ldap sasl )"
87 +
88 +S="${WORKDIR}/${MY_SRC}"
89 +
90 +pkg_setup() {
91 + # Add postfix, postdrop user/group (bug #77565)
92 + enewgroup postfix 207
93 + enewgroup postdrop 208
94 + enewuser postfix 207 -1 /var/spool/postfix postfix,mail
95 +}
96 +
97 +src_prepare() {
98 + default
99 + sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
100 + src/util/sys_defs.h || die "sed failed"
101 + # change default paths to better comply with portage standard paths
102 + sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
103 + eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
104 + eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
105 + eapply -p0 "${FILESDIR}/${PN}-musl-fd.patch"
106 +}
107 +
108 +src_configure() {
109 + for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
110 + do
111 + local AUXLIBS_${name}=""
112 + done
113 +
114 + # Make sure LDFLAGS get passed down to the executables.
115 + local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
116 + AUXLIBS_PCRE="$(pcre-config --libs)"
117 +
118 + use pam && mylibs="${mylibs} -lpam"
119 +
120 + if use ldap; then
121 + mycc="${mycc} -DHAS_LDAP"
122 + AUXLIBS_LDAP="-lldap -llber"
123 + fi
124 +
125 + if use mysql; then
126 + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
127 + AUXLIBS_MYSQL="$(mysql_config --libs)"
128 + fi
129 +
130 + if use postgres; then
131 + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
132 + AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
133 + fi
134 +
135 + if use sqlite; then
136 + mycc="${mycc} -DHAS_SQLITE"
137 + AUXLIBS_SQLITE="-lsqlite3 -lpthread"
138 + fi
139 +
140 + if use ssl; then
141 + mycc="${mycc} -DUSE_TLS"
142 + mylibs="${mylibs} -lssl -lcrypto"
143 + fi
144 +
145 + if use lmdb; then
146 + mycc="${mycc} -DHAS_LMDB"
147 + AUXLIBS_LMDB="-llmdb -lpthread"
148 + fi
149 +
150 + if ! use eai; then
151 + mycc="${mycc} -DNO_EAI"
152 + fi
153 +
154 + # broken. and "in other words, not supported" by upstream.
155 + # Use inet_protocols setting in main.cf
156 + #if ! use ipv6; then
157 + # mycc="${mycc} -DNO_IPV6"
158 + #fi
159 +
160 + if use sasl; then
161 + if use dovecot-sasl; then
162 + # Set dovecot as default.
163 + mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
164 + fi
165 + if use ldap-bind; then
166 + mycc="${mycc} -DUSE_LDAP_SASL"
167 + fi
168 + mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
169 + mylibs="${mylibs} -lsasl2"
170 + elif use dovecot-sasl; then
171 + mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
172 + fi
173 +
174 + if ! use nis; then
175 + mycc="${mycc} -DNO_NIS"
176 + fi
177 +
178 + if ! use berkdb; then
179 + mycc="${mycc} -DNO_DB"
180 + if use cdb; then
181 + # change default hash format from Berkeley DB to cdb
182 + mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
183 + fi
184 + fi
185 +
186 + if use cdb; then
187 + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
188 + # Tinycdb is preferred.
189 + if has_version dev-db/tinycdb ; then
190 + einfo "Building with dev-db/tinycdb"
191 + AUXLIBS_CDB="-lcdb"
192 + else
193 + einfo "Building with dev-db/cdb"
194 + CDB_PATH="/usr/$(get_libdir)"
195 + for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
196 + AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
197 + done
198 + fi
199 + fi
200 +
201 + # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
202 + # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
203 + mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
204 + filter-lfs-flags
205 +
206 + # Workaround for bug #76512
207 + if use hardened; then
208 + [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
209 + fi
210 +
211 + # Remove annoying C++ comment style warnings - bug #378099
212 + append-flags -Wno-comment
213 +
214 + sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
215 + sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
216 +
217 + emake makefiles shared=yes dynamicmaps=no pie=yes \
218 + shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
219 + DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
220 + AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
221 + AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
222 + AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
223 + AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
224 +}
225 +
226 +src_install () {
227 + local myconf
228 + use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
229 + html_directory=\"/usr/share/doc/${PF}/html\""
230 +
231 + LD_LIBRARY_PATH="${S}/lib" \
232 + /bin/sh postfix-install \
233 + -non-interactive \
234 + install_root="${D}" \
235 + config_directory="/etc/postfix" \
236 + manpage_directory="/usr/share/man" \
237 + command_directory="/usr/sbin" \
238 + mailq_path="/usr/bin/mailq" \
239 + newaliases_path="/usr/bin/newaliases" \
240 + sendmail_path="/usr/sbin/sendmail" \
241 + ${myconf} \
242 + || die "postfix-install failed"
243 +
244 + # Fix spool removal on upgrade
245 + rm -Rf "${D}"/var
246 + keepdir /var/spool/postfix
247 +
248 + # Install rmail for UUCP, closes bug #19127
249 + dobin auxiliary/rmail/rmail
250 +
251 + # Provide another link for legacy FSH
252 + dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
253 +
254 + # Install qshape and posttls-finger
255 + dobin auxiliary/qshape/qshape.pl
256 + doman man/man1/qshape.1
257 + dobin bin/posttls-finger
258 + doman man/man1/posttls-finger.1
259 +
260 + # Performance tuning tools and their manuals
261 + dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
262 + doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
263 +
264 + # Set proper permissions on required files/directories
265 + dodir /var/lib/postfix
266 + keepdir /var/lib/postfix
267 + fowners -R postfix:postfix /var/lib/postfix
268 + fperms 0750 /var/lib/postfix
269 + fowners root:postdrop /usr/sbin/post{drop,queue}
270 + fperms 02711 /usr/sbin/post{drop,queue}
271 +
272 + keepdir /etc/postfix
273 + if use mbox; then
274 + mypostconf="mail_spool_directory=/var/spool/mail"
275 + else
276 + mypostconf="home_mailbox=.maildir/"
277 + fi
278 + LD_LIBRARY_PATH="${S}/lib" \
279 + "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
280 + -e ${mypostconf} || die "postconf failed"
281 +
282 + insinto /etc/postfix
283 + newins "${FILESDIR}"/smtp.pass saslpass
284 + fperms 600 /etc/postfix/saslpass
285 +
286 + newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
287 + # do not start mysql/postgres unnecessarily - bug #359913
288 + use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
289 + use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
290 +
291 + dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
292 + use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
293 +
294 + pamd_mimic_system smtp auth account
295 +
296 + if use sasl; then
297 + insinto /etc/sasl2
298 + newins "${FILESDIR}"/smtp.sasl smtpd.conf
299 + fi
300 +
301 + # header files
302 + insinto /usr/include/postfix
303 + doins include/*.h
304 +
305 + # Keep config_dir clean
306 + rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
307 + rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
308 +
309 + if has_version mail-mta/postfix; then
310 + # let the sysadmin decide when to change the compatibility_level
311 + sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
312 + fi
313 +
314 + systemd_dounit "${FILESDIR}/${PN}.service"
315 +}
316 +
317 +pkg_postinst() {
318 + if [[ ! -e /etc/mail/aliases.db ]] ; then
319 + ewarn
320 + ewarn "You must edit /etc/mail/aliases to suit your needs"
321 + ewarn "and then run /usr/bin/newaliases. Postfix will not"
322 + ewarn "work correctly without it."
323 + ewarn
324 + fi
325 +
326 + # configure tls
327 + if use ssl ; then
328 + if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
329 + elog "To configure client side TLS settings:"
330 + elog "${EROOT}"usr/sbin/postfix tls enable-client
331 + fi
332 + if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
333 + elog "To configure server side TLS settings:"
334 + elog "${EROOT}"usr/sbin/postfix tls enable-server
335 + fi
336 + fi
337 +}