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: Thu, 28 Apr 2022 06:14:34
Message-Id: 1651126423.9e61f94f5b32ca9adb0cd0dab130dd79b5680a34.eras@gentoo
1 commit: 9e61f94f5b32ca9adb0cd0dab130dd79b5680a34
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 28 06:13:43 2022 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 06:13:43 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e61f94f
7
8 mail-mta/postfix: add 3.7.2
9
10 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
11
12 mail-mta/postfix/Manifest | 1 +
13 mail-mta/postfix/postfix-3.7.2.ebuild | 292 ++++++++++++++++++++++++++++++++++
14 2 files changed, 293 insertions(+)
15
16 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
17 index 98f5e223a09b..d70feeba19ae 100644
18 --- a/mail-mta/postfix/Manifest
19 +++ b/mail-mta/postfix/Manifest
20 @@ -1,4 +1,5 @@
21 DIST postfix-3.6.5.tar.gz 4751485 BLAKE2B 7d53ccf76d978db269fe0ab8641abcb3ba91a72c97fa739a2c8ea80c45bb3ecdaca51d08f7db03582887a0cdcdf96be423e3e35b4f2ab2fbb0fbe4e98dd60758 SHA512 510c7b387b38c8683bda33371468c1c1209285baca7d8f237fdb668b313fa4b4d6727f7e4eb79fc81c4155f0839b4e95995dff186e62621b26e5b8b31cff15d5
22 DIST postfix-3.6.6.tar.gz 4752461 BLAKE2B f2508233bfe72706450af0f61d58ef1b5781cebef28dbf42a3f9772f7033ead65542e6b906b35e9ec2adfe05db3f992a7f39287a6439cc60672d7313c52fe3e6 SHA512 ee2e1a59c99b9869c401f8a42afdc094c4b2ba804ed8f9f366c33b36b8d2c66d8362d5a32fbe72f4b2c9a431c232b60ada9fce29dec60ac4610220e0f5c6fb77
23 DIST postfix-3.7.1.tar.gz 4824081 BLAKE2B d0bfdbc5105407e5143823e8e14b49e60d5c248eac435279a5fe803b370b46a56de9aff39fdf94398758863f753e43e889e2dffbb393ab63cf486d4fd3f5cf99 SHA512 2a8916eae4b0a4f4e055e1dbae1b9655b1eabcb22d911599a63fb9a1900174c9eab24280bee2ddab42db6674c6b4362964a2a41f67fcb18f0c8c41ad0100b044
24 +DIST postfix-3.7.2.tar.gz 4824424 BLAKE2B 3f7aaba222b64274f756ea37b8ac06c29469d9183879deb4942a709d75783f4a8ca81204971b6658aba4b5bea46ed9c21b14e1f8fc6b613f257acd3aad16c170 SHA512 23bb1af6bf3743c741f108da136f64613f9062d121dc459944ac192275335952cd309ffec6c380f5d36430605eec538c2549c3fdee9d4597f739d9d1b0a033fc
25 DIST postfix-3.8-20220421.tar.gz 4808572 BLAKE2B e12951d4731401b09c1f3111c1ad0200e056b02d46dbde2a2f5d59c05c018c50d8597e6a058666f9f5d1c71a42f07592938071fb28e32bbb507f626c2b705839 SHA512 92f3d81fb410ef6f3d16c3840a6e6058d61f344acd9a5caf9f59072fe9e4358ff80457e417e7a2381f6d4eeec3eaa1b5a8b753dc1543039162e63fd402ed7084
26
27 diff --git a/mail-mta/postfix/postfix-3.7.2.ebuild b/mail-mta/postfix/postfix-3.7.2.ebuild
28 new file mode 100644
29 index 000000000000..59bf377e426e
30 --- /dev/null
31 +++ b/mail-mta/postfix/postfix-3.7.2.ebuild
32 @@ -0,0 +1,292 @@
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/_rc/-RC}"
40 +MY_SRC="${PN}-${MY_PV}"
41 +MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
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
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 + mycc=" -DHAS_PCRE=2"
111 + AUXLIBS_PCRE="$(pcre2-config --libs8)"
112 +
113 + use pam && mylibs="${mylibs} -lpam"
114 +
115 + if use ldap; then
116 + mycc="${mycc} -DHAS_LDAP"
117 + AUXLIBS_LDAP="-lldap -llber"
118 + fi
119 +
120 + if use mysql; then
121 + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
122 + AUXLIBS_MYSQL="$(mysql_config --libs)"
123 + fi
124 +
125 + if use postgres; then
126 + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
127 + AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
128 + fi
129 +
130 + if use sqlite; then
131 + mycc="${mycc} -DHAS_SQLITE"
132 + AUXLIBS_SQLITE="-lsqlite3 -lpthread"
133 + fi
134 +
135 + if use ssl; then
136 + mycc="${mycc} -DUSE_TLS"
137 + mylibs="${mylibs} -lssl -lcrypto"
138 + fi
139 +
140 + if use lmdb; then
141 + mycc="${mycc} -DHAS_LMDB"
142 + AUXLIBS_LMDB="-llmdb -lpthread"
143 + fi
144 +
145 + if ! use eai; then
146 + mycc="${mycc} -DNO_EAI"
147 + fi
148 +
149 + # broken. and "in other words, not supported" by upstream.
150 + # Use inet_protocols setting in main.cf
151 + #if ! use ipv6; then
152 + # mycc="${mycc} -DNO_IPV6"
153 + #fi
154 +
155 + if use sasl; then
156 + if use dovecot-sasl; then
157 + # Set dovecot as default.
158 + mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
159 + fi
160 + if use ldap-bind; then
161 + mycc="${mycc} -DUSE_LDAP_SASL"
162 + fi
163 + mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
164 + mylibs="${mylibs} -lsasl2"
165 + elif use dovecot-sasl; then
166 + mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
167 + fi
168 +
169 + if ! use nis; then
170 + mycc="${mycc} -DNO_NIS"
171 + fi
172 +
173 + if ! use berkdb; then
174 + mycc="${mycc} -DNO_DB"
175 + # change default database type
176 + if use cdb; then
177 + mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
178 + elif use lmdb; then
179 + mycc="${mycc} -DDEF_DB_TYPE=\\\"lmdb\\\""
180 + fi
181 + fi
182 +
183 + if use cdb; then
184 + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
185 + # Tinycdb is preferred.
186 + if has_version dev-db/tinycdb ; then
187 + AUXLIBS_CDB="-lcdb"
188 + else
189 + CDB_PATH="/usr/$(get_libdir)"
190 + for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
191 + AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
192 + done
193 + fi
194 + fi
195 +
196 + sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
197 + sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
198 +
199 + emake makefiles shared=yes dynamicmaps=no pie=yes \
200 + shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
201 + DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
202 + AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
203 + AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
204 + AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
205 + AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
206 +}
207 +
208 +src_install() {
209 + LD_LIBRARY_PATH="${S}/lib" \
210 + /bin/sh postfix-install \
211 + -non-interactive \
212 + install_root="${D}" \
213 + config_directory="/etc/postfix" \
214 + manpage_directory="/usr/share/man" \
215 + command_directory="/usr/sbin" \
216 + mailq_path="/usr/bin/mailq" \
217 + newaliases_path="/usr/bin/newaliases" \
218 + sendmail_path="/usr/sbin/sendmail" \
219 + || die "postfix-install failed"
220 +
221 + # Fix spool removal on upgrade
222 + rm -Rf "${D}"/var
223 + keepdir /var/spool/postfix
224 +
225 + # Install rmail for UUCP, closes bug #19127
226 + dobin auxiliary/rmail/rmail
227 +
228 + # Provide another link for legacy FSH
229 + dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
230 +
231 + # Install qshape, posttls-finger, collate and tlstype
232 + dobin auxiliary/qshape/qshape.pl
233 + doman man/man1/qshape.1
234 + dobin bin/posttls-finger
235 + doman man/man1/posttls-finger.1
236 + dobin auxiliary/collate/collate.pl
237 + newdoc auxiliary/collate/README README.collate
238 + dobin auxiliary/collate/tlstype.pl
239 + dodoc auxiliary/collate/README.tlstype
240 +
241 + # Performance tuning tools and their manuals
242 + dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
243 + doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
244 +
245 + # Set proper permissions on required files/directories
246 + keepdir /var/lib/postfix
247 + fowners -R postfix:postfix /var/lib/postfix
248 + fperms 0750 /var/lib/postfix
249 + fowners root:postdrop /usr/sbin/post{drop,queue,log}
250 + fperms 02755 /usr/sbin/post{drop,queue,log}
251 +
252 + keepdir /etc/postfix
253 + keepdir /etc/postfix/postfix-files.d
254 + if use mbox; then
255 + mypostconf="mail_spool_directory=/var/mail"
256 + else
257 + mypostconf="home_mailbox=.maildir/"
258 + fi
259 + LD_LIBRARY_PATH="${S}/lib" \
260 + "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
261 + -e ${mypostconf} || die "postconf failed"
262 +
263 + insinto /etc/postfix
264 + newins "${FILESDIR}"/smtp.pass saslpass
265 + fperms 600 /etc/postfix/saslpass
266 +
267 + newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
268 + # do not start mysql/postgres unnecessarily - bug #359913
269 + use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
270 + use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
271 +
272 + dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
273 + dodoc -r README_FILES/ examples/
274 + # postfix set-permissions expects uncompressed man files
275 + docompress -x /usr/share/man
276 +
277 + if use pam; then
278 + pamd_mimic_system smtp auth account
279 + fi
280 +
281 + if use sasl; then
282 + insinto /etc/sasl2
283 + newins "${FILESDIR}"/smtp.sasl smtpd.conf
284 + fi
285 +
286 + # header files
287 + insinto /usr/include/postfix
288 + doins include/*.h
289 +
290 + if has_version mail-mta/postfix; then
291 + # let the sysadmin decide when to change the compatibility_level
292 + sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
293 + fi
294 +
295 + systemd_dounit "${FILESDIR}/${PN}.service"
296 +}
297 +
298 +pkg_postinst() {
299 + # do not assume berkdb
300 + if [[ ! -e /etc/mail/aliases.db \
301 + && ! -e /etc/mail/aliases.cdb \
302 + && ! -e /etc/mail/aliases.lmdb ]] ; then
303 + ewarn
304 + ewarn "You must edit /etc/mail/aliases to suit your needs"
305 + ewarn "and then run /usr/bin/newaliases. Postfix will not"
306 + ewarn "work correctly without it."
307 + ewarn
308 + fi
309 +
310 + # check and fix file permissions
311 + "${EROOT}"/usr/sbin/postfix set-permissions
312 +
313 + # configure tls
314 + if use ssl ; then
315 + if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
316 + elog "To configure client side TLS settings:"
317 + elog "${EROOT}"/usr/sbin/postfix tls enable-client
318 + fi
319 + if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
320 + elog "To configure server side TLS settings:"
321 + elog "${EROOT}"/usr/sbin/postfix tls enable-server
322 + fi
323 + fi
324 +}