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: Mon, 24 Jan 2022 10:40:53
Message-Id: 1643020844.6b3d75096d878ab23385292062875c2bdcba69b3.eras@gentoo
1 commit: 6b3d75096d878ab23385292062875c2bdcba69b3
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 24 10:40:29 2022 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 24 10:40:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b3d7509
7
8 mail-mta/postfix: bump to 3.8_pre20220123
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
12
13 mail-mta/postfix/Manifest | 1 +
14 mail-mta/postfix/postfix-3.8_pre20220123.ebuild | 294 ++++++++++++++++++++++++
15 2 files changed, 295 insertions(+)
16
17 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
18 index 9b6a425058f3..7dc3581f1a22 100644
19 --- a/mail-mta/postfix/Manifest
20 +++ b/mail-mta/postfix/Manifest
21 @@ -1,3 +1,4 @@
22 DIST postfix-3.6.3.tar.gz 4750833 BLAKE2B 2a68e0f18227e09c0ce855901503fa83a58805f036f57eff9003102f5933a241e624e5f3f7a7af4f3d89784d95bc0be6ac1d17f30712f61491808ed6a90ce2d3 SHA512 7179aaeeaf27838b867d9a07f9a889d7cd6b7f5053e123caef4dff2820d4df6d5be167effedde6c857b4468966b8449c631e56405e1ac2d589716fb4e3f15e3b
23 DIST postfix-3.6.4.tar.gz 4751433 BLAKE2B 2b410413e18cc2792bab7b75bcb8bcf36191c6abca8f2fea0ce54053f7a0be681352542ea8a3e26752a60ddc026bbc6ce84c926cc721811b43f3debc07b557cf SHA512 f5813801377a5887d27720cc7f85a6a68f8ca82fc7a9e852b27c8967996b3d64f651cc16e2b021d55316a074b4778e19155bb60c8f0885d4aaf72766cab7c4cd
24 DIST postfix-3.7.0-RC1.tar.gz 4820050 BLAKE2B 71f8f7daf7014698a1505b4573957772518b295e19805b611bfaf1f24682bcca5018c67a61c2d25a0072f7081c503e98d966b0a4cffed619605f74dc97b8fe13 SHA512 102b4cd030140c151486bd353c1b3e6d4ef871edec617521fda1e6903753689a1390e082b49ee3da2755bf270f53b5a23d1b4b5b2a20458e47c5601ae21ab75c
25 +DIST postfix-3.8-20220123.tar.gz 4816983 BLAKE2B fd3a18b3739ea3574611932743118d4c035a1b4badd41101f951df1b45fc514df9f04b8793c1d92890bd5b1c9b4da7a525fec1ce4a36097bffa2284f7927c7f8 SHA512 f13e23c3f44691d2a21e4a336817479c318be8b675c913d5edece91ab5f5779d464ea25a1d80f635c18e1e2f2204c1c2228b4f847843835413165107fec992c4
26
27 diff --git a/mail-mta/postfix/postfix-3.8_pre20220123.ebuild b/mail-mta/postfix/postfix-3.8_pre20220123.ebuild
28 new file mode 100644
29 index 000000000000..27dc0dccf2ae
30 --- /dev/null
31 +++ b/mail-mta/postfix/postfix-3.8_pre20220123.ebuild
32 @@ -0,0 +1,294 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +inherit pam systemd toolchain-funcs
38 +
39 +MY_PV="${PV/_pre/-}"
40 +MY_SRC="${PN}-${MY_PV}"
41 +MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/experimental"
42 +RC_VER="2.7"
43 +
44 +DESCRIPTION="A fast and secure drop-in replacement for sendmail"
45 +HOMEPAGE="http://www.postfix.org/"
46 +SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
47 +
48 +LICENSE="|| ( IBM EPL-2.0 )"
49 +SLOT="0"
50 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
51 +IUSE="+berkdb cdb dovecot-sasl +eai ldap ldap-bind lmdb mbox memcached mysql nis pam postgres sasl selinux sqlite ssl"
52 +
53 +DEPEND="
54 + acct-group/postfix
55 + acct-group/postdrop
56 + acct-user/postfix
57 + || ( dev-libs/libpcre2:0 dev-libs/libpcre )
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? ( sys-libs/pam )
68 + postgres? ( dev-db/postgresql:* )
69 + sasl? ( >=dev-libs/cyrus-sasl-2 )
70 + sqlite? ( dev-db/sqlite:3 )
71 + ssl? ( >=dev-libs/openssl-1.1.1:0= )
72 + "
73 +
74 +RDEPEND="${DEPEND}
75 + memcached? ( net-misc/memcached )
76 + net-mail/mailbase
77 + !mail-mta/courier
78 + !mail-mta/esmtp
79 + !mail-mta/exim
80 + !mail-mta/msmtp[mta]
81 + !mail-mta/netqmail
82 + !mail-mta/nullmailer
83 + !mail-mta/sendmail
84 + !mail-mta/opensmtpd
85 + !mail-mta/ssmtp[mta]
86 + selinux? ( sec-policy/selinux-postfix )"
87 +
88 +REQUIRED_USE="ldap-bind? ( ldap sasl )"
89 +
90 +S="${WORKDIR}/${MY_SRC}"
91 +
92 +src_prepare() {
93 + default
94 + sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
95 + src/util/sys_defs.h || die "sed failed"
96 + # change default paths to better comply with portage standard paths
97 + sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
98 +}
99 +
100 +src_configure() {
101 + for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
102 + do
103 + local AUXLIBS_${name}=""
104 + done
105 +
106 + # Make sure LDFLAGS get passed down to the executables.
107 + local mycc="" mylibs="${LDFLAGS} -ldl"
108 +
109 + # libpcre is EOL. prefer libpcre2
110 + if has_version dev-libs/libpcre2; then
111 + mycc="-DHAS_PCRE=2"
112 + AUXLIBS_PCRE="$(pcre2-config --libs8)"
113 + else
114 + mycc="-DHAS_PCRE=1"
115 + AUXLIBS_PCRE="$(pcre-config --libs)"
116 + fi
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 + # change default database type
181 + if use cdb; then
182 + mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
183 + elif use lmdb; then
184 + mycc="${mycc} -DDEF_DB_TYPE=\\\"lmdb\\\""
185 + fi
186 + fi
187 +
188 + if use cdb; then
189 + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
190 + # Tinycdb is preferred.
191 + if has_version dev-db/tinycdb ; then
192 + AUXLIBS_CDB="-lcdb"
193 + else
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 + sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
202 + sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
203 +
204 + emake makefiles shared=yes dynamicmaps=no pie=yes \
205 + shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
206 + DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
207 + AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
208 + AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
209 + AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
210 + AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
211 +}
212 +
213 +src_install() {
214 + LD_LIBRARY_PATH="${S}/lib" \
215 + /bin/sh postfix-install \
216 + -non-interactive \
217 + install_root="${D}" \
218 + config_directory="/etc/postfix" \
219 + manpage_directory="/usr/share/man" \
220 + command_directory="/usr/sbin" \
221 + mailq_path="/usr/bin/mailq" \
222 + newaliases_path="/usr/bin/newaliases" \
223 + sendmail_path="/usr/sbin/sendmail" \
224 + || die "postfix-install failed"
225 +
226 + # Fix spool removal on upgrade
227 + rm -Rf "${D}"/var
228 + keepdir /var/spool/postfix
229 +
230 + # Install rmail for UUCP, closes bug #19127
231 + dobin auxiliary/rmail/rmail
232 +
233 + # Provide another link for legacy FSH
234 + dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
235 +
236 + # Install qshape, posttls-finger, collate and tlstype
237 + dobin auxiliary/qshape/qshape.pl
238 + doman man/man1/qshape.1
239 + dobin bin/posttls-finger
240 + doman man/man1/posttls-finger.1
241 + dobin auxiliary/collate/collate.pl
242 + newdoc auxiliary/collate/README README.collate
243 + dobin auxiliary/collate/tlstype.pl
244 + dodoc auxiliary/collate/README.tlstype
245 +
246 + # Performance tuning tools and their manuals
247 + dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
248 + doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
249 +
250 + # Set proper permissions on required files/directories
251 + keepdir /var/lib/postfix
252 + fowners -R postfix:postfix /var/lib/postfix
253 + fperms 0750 /var/lib/postfix
254 + fowners root:postdrop /usr/sbin/post{drop,queue,log}
255 + fperms 02755 /usr/sbin/post{drop,queue,log}
256 +
257 + keepdir /etc/postfix
258 + keepdir /etc/postfix/postfix-files.d
259 + if use mbox; then
260 + mypostconf="mail_spool_directory=/var/spool/mail"
261 + else
262 + mypostconf="home_mailbox=.maildir/"
263 + fi
264 + LD_LIBRARY_PATH="${S}/lib" \
265 + "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
266 + -e ${mypostconf} || die "postconf failed"
267 +
268 + insinto /etc/postfix
269 + newins "${FILESDIR}"/smtp.pass saslpass
270 + fperms 600 /etc/postfix/saslpass
271 +
272 + newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
273 + # do not start mysql/postgres unnecessarily - bug #359913
274 + use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
275 + use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
276 +
277 + dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
278 + dodoc -r README_FILES/ examples/
279 + # postfix set-permissions expects uncompressed man files
280 + docompress -x /usr/share/man
281 +
282 + if use pam; then
283 + pamd_mimic_system smtp auth account
284 + fi
285 +
286 + if use sasl; then
287 + insinto /etc/sasl2
288 + newins "${FILESDIR}"/smtp.sasl smtpd.conf
289 + fi
290 +
291 + # header files
292 + insinto /usr/include/postfix
293 + doins include/*.h
294 +
295 + if has_version mail-mta/postfix; then
296 + # let the sysadmin decide when to change the compatibility_level
297 + sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
298 + fi
299 +
300 + systemd_dounit "${FILESDIR}/${PN}.service"
301 +}
302 +
303 +pkg_postinst() {
304 + if [[ ! -e /etc/mail/aliases.db ]] ; then
305 + ewarn
306 + ewarn "You must edit /etc/mail/aliases to suit your needs"
307 + ewarn "and then run /usr/bin/newaliases. Postfix will not"
308 + ewarn "work correctly without it."
309 + ewarn
310 + fi
311 +
312 + # check and fix file permissions
313 + "${EROOT}"/usr/sbin/postfix set-permissions
314 +
315 + # configure tls
316 + if use ssl ; then
317 + if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
318 + elog "To configure client side TLS settings:"
319 + elog "${EROOT}"/usr/sbin/postfix tls enable-client
320 + fi
321 + if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
322 + elog "To configure server side TLS settings:"
323 + elog "${EROOT}"/usr/sbin/postfix tls enable-server
324 + fi
325 + fi
326 +}