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