Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: mail-mta/postfix/files/, mail-mta/postfix/
Date: Sun, 18 Jun 2017 20:40:12
Message-Id: 1497818265.b6022183f33e511260a2e2fed5afed88ca5dd448.blueness@gentoo
1 commit: b6022183f33e511260a2e2fed5afed88ca5dd448
2 Author: Wolfgang Mueller <vehk <AT> vehk <DOT> de>
3 AuthorDate: Sun Jun 18 18:05:11 2017 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 18 20:37:45 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=b6022183
7
8 mail-mta/postfix: file descriptor passing for musl
9
10 mail-mta/postfix/Manifest | 11 +
11 mail-mta/postfix/files/postfix-2.11.1-db6.patch | 12 +
12 .../postfix/files/postfix-libressl-runtime.patch | 102 +++++++
13 mail-mta/postfix/files/postfix-libressl.patch | 17 ++
14 mail-mta/postfix/files/postfix-musl-fd.patch | 11 +
15 mail-mta/postfix/files/postfix.rc6.2.7 | 85 ++++++
16 mail-mta/postfix/files/postfix.service | 26 ++
17 mail-mta/postfix/files/smtp.pass | 2 +
18 mail-mta/postfix/files/smtp.sasl | 2 +
19 mail-mta/postfix/metadata.xml | 24 ++
20 mail-mta/postfix/postfix-3.1.6.ebuild | 309 +++++++++++++++++++++
21 11 files changed, 601 insertions(+)
22
23 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
24 new file mode 100644
25 index 0000000..c575d87
26 --- /dev/null
27 +++ b/mail-mta/postfix/Manifest
28 @@ -0,0 +1,11 @@
29 +AUX postfix-2.11.1-db6.patch 699 SHA256 90356024954a624306f2f5c8859e6a2a69965f83ca5e0d3d1005c9205bf41181 SHA512 9a6f00ae2d31b732be929ce647c222871704db02c09af659e260cf1a995bbde7f2045c59b9c33520070f427d4a2b377f6193bf6f9971087bf8df7f0c95d6d824 WHIRLPOOL 025a95e18942daf7d8a84a6ab9d17f14800aa34fc29bb5a8694f6667d1215553fe33375ef7e831937362b4b5129f6957ef3d8fd781508b554bfe841971524e15
30 +AUX postfix-libressl-runtime.patch 3603 SHA256 7bcbb79f5ae01a02c1b438e27c7d982fcd198e77506b82041fd306f1025154c8 SHA512 cdafeff6b47659a6c2ba242550cfe1733cfff2e9d2b03970695e68170d62b3b55b6846b59023f501a2c5b0bb5818b8c0fb8eda63953edcbf35d3bca010d6d88a WHIRLPOOL 0abcdedde85cda3a400dcbca38038a389027f7d726d9fdb0eb67018f5c879b353537f67d53b6cee42bc53ab8757ddca783b6d369ef23750e4a3997e960e0556a
31 +AUX postfix-libressl.patch 659 SHA256 4228bb29d3f07cabc2a10c72824cf83953e2e6b62aa504caafc6fcb5f0cf89d1 SHA512 fe8aba872f557257c44d14be0eb624414d8dbe172c33e08d8edec5a06c52f0332d7384c9ce588faa49c6c766a1ffc1a6455dee8ef6ee6008f18fa2150407d15e WHIRLPOOL a48659134912bc675a6c6ab1087373d1255434b2e3e82d842ca1ce1722446b5c3f9a4a288433946994bede968f45660b17b4931e0ba729a1e5b7036cc30d522c
32 +AUX postfix-musl-fd.patch 394 SHA256 c79880a8dcdb51c7454ca95fa9e3f4ffb14caeb1c08fdf2090fed7666dc3b3b7 SHA512 5e76c4dedc4d322e20bf4e1cbfe3fd4d4074fbca5a1f317328d8f2bbff34a807ce0cc446c15793a491fdfc20f6b26fabfc3d626de310f63249453455981c087c WHIRLPOOL 67e23567cfa174da066b4d581bc9724c16543e3292869db5220cd518371484462953e194071b144c488d66692047736396854dfba895feefaa901896d81f57e6
33 +AUX postfix.rc6.2.7 2107 SHA256 34cb4ef8067b9001005931c30ab87be41f47c20ef1185a3afbc86d3d6f01996e SHA512 2ad1b053bbb51d4f480dbf5a01252e8e99a82ec14a75ff49336b2b190ea55bc02400542b109fa0cc4ebfe6b42eaabbc45f70f2ea581f1eb9c4189c439b825592 WHIRLPOOL 8be6f87fa85bee404c0b6cc185773b60a1a8abb36ac6a30a9d73cd819f95e0b7af63cce6956f6d11e171c40e6dbdec30c00f55b5bd617b30fda2acd958d72cfe
34 +AUX postfix.service 662 SHA256 60e79c0b189d48f341313af55e345014cd4ae5ddf3ed04b2881149f54d0c4e9b SHA512 04b475040b153f488a9358567ff9ee2eb8f263c619dadc23c837d17c19106041296e3652bcaded2be0c7c8b9eee7fd5f2ad55bed3e7f9b3a4bf9655f4762d563 WHIRLPOOL 2861f2b0418c8b7598e8a24f5131fedb9e5d5b8cb280b5dd7f5f620834738cf5cd895aad7cb813ee3f0107a658a2e89edd6b8eade541b57897777157a5410464
35 +AUX smtp.pass 29 SHA256 21e672c3c46410d713b359d79126961a12d54ceab309fd2c94c5b4f531206167 SHA512 a8a940099a77ea0547004daf5392a6efc0cd643f10072803d65e37763012464ad25b1b925ae9e32bffb3c3e8a5d4b2d3bb5619a174d58fdc4ea5d4090db0d365 WHIRLPOOL 912d0d1b91a88d1e079f8efdab4cc231a0497907c83ad07f22bb90c5479fcf59bc28694a808c1f23dc67fec8fab5e03f28f0fa40106801dabd2da06e0210fb57
36 +AUX smtp.sasl 42 SHA256 41637ac35a85827e193564b7dbcaa94eafd0206af8ebcd41bcfc48a314416376 SHA512 a48e2bd173c4443dd2c389f6973a541dbcba4223b52b42b409a68d934a7fc82a98d4027267befcd5db6ec628cce6a9dffdf044e6fbd774b6e748f07f4106db47 WHIRLPOOL 0d3132798fbfaa047a3be5b8b1f0a99c2fa22514cdef4908ca7f670210789f432247b4668e063bfe581ad17a4f5ba180e31c5c1e5ed9a0a9ca6417dd14ebd067
37 +DIST postfix-3.1.6.tar.gz 4341308 SHA256 e5eb005fd133c6a32ca03e796e0192945eb877be8eb727f30d25547c997c5aa6 SHA512 646317393d33fcec99bef7f3dc142a847591927bc034c0c71e578baedad1875040cfeabdaa3436312f60485cb69bbdb31197aa9e7526a457946d7749b781099b WHIRLPOOL 66a087da3b33353a22176b9162fe0679f8ff35e48ae693a3315d52232e662638d48b8827648c0b0368e018161e1ade6a671773c109208ded9659cca26b1b5ea1
38 +EBUILD postfix-3.1.6.ebuild 8715 SHA256 a62b0608b640d0d55973499ad9d75d0e35f917f863b0cf3f485eca07fdf09a08 SHA512 f20f82d88e8967221ef598c7550e118f4a4b7bd9e5f8bb2b3545cd3302fc7474c82790fe192884060fe8d3eefe7c41f2f33a3f99ce8f41c09aed543969b054a7 WHIRLPOOL 0fb71563fb592b33887963d8d77ce2fc000fe78d25dcc731d21c07dc63d501fd97db8e0ac59afc80a582e10341ab2a57a52e08a95df373f8bf0319f469674e87
39 +MISC metadata.xml 909 SHA256 b9443044f47f7c0cfebe2bb4869b598ae59a54abec2f9f2b0326536283ed9315 SHA512 e01265765b76f0c2e28fa8049912c6c2f65a1aa8cfcbceda79c5fd7336ebc2626703d19e964239b50ad9b62a106f7a8432bf3ead2562190b2f49487360bbc4d8 WHIRLPOOL b49c42350b193b5fa2c67a5d7b0aacda999bca8b0bb9daac674c601682017f4196b651994f1fef4cc2a1fa0e4bb52a1329ac913ec2d1239404745c6faa0be0f5
40
41 diff --git a/mail-mta/postfix/files/postfix-2.11.1-db6.patch b/mail-mta/postfix/files/postfix-2.11.1-db6.patch
42 new file mode 100644
43 index 0000000..5f5cad4
44 --- /dev/null
45 +++ b/mail-mta/postfix/files/postfix-2.11.1-db6.patch
46 @@ -0,0 +1,12 @@
47 +--- src/util/dict_db.c 2012-01-25 00:41:08.000000000 +0000
48 ++++ src/util/dict_db.c 2014-06-25 18:56:10.000000000 +0000
49 +@@ -693,7 +688,8 @@
50 + msg_fatal("set DB cache size %d: %m", dict_db_cache_size);
51 + if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
52 + msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
53 +-#if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0)
54 ++#if DB_VERSION_MAJOR == 6 || DB_VERSION_MAJOR == 5 || \
55 ++ (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0)
56 + if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0)
57 + FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags,
58 + "open database %s: %m", db_path));
59
60 diff --git a/mail-mta/postfix/files/postfix-libressl-runtime.patch b/mail-mta/postfix/files/postfix-libressl-runtime.patch
61 new file mode 100644
62 index 0000000..8140886
63 --- /dev/null
64 +++ b/mail-mta/postfix/files/postfix-libressl-runtime.patch
65 @@ -0,0 +1,102 @@
66 +--- src/posttls-finger/posttls-finger.c.orig 2016-08-27 20:27:50 UTC
67 ++++ src/posttls-finger/posttls-finger.c
68 +@@ -1511,7 +1511,8 @@ static int finger(STATE *state)
69 + return (0);
70 + }
71 +
72 +-#if defined(USE_TLS) && OPENSSL_VERSION_NUMBER < 0x10100000L
73 ++#if defined(USE_TLS) && \
74 ++ ( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
75 +
76 + /* ssl_cleanup - free memory allocated in the OpenSSL library */
77 +
78 +@@ -1958,7 +1959,8 @@ int main(int argc, char *argv[])
79 + cleanup(&state);
80 +
81 + /* OpenSSL 1.1.0 and later (de)initialization is implicit */
82 +-#if defined(USE_TLS) && OPENSSL_VERSION_NUMBER < 0x10100000L
83 ++#if defined(USE_TLS) && \
84 ++ ( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
85 + ssl_cleanup();
86 + #endif
87 +
88 +--- src/tls/tls_client.c.orig 2016-08-27 20:27:50 UTC
89 ++++ src/tls/tls_client.c
90 +@@ -299,7 +299,7 @@ TLS_APPL_STATE *tls_client_init(const TL
91 + */
92 + tls_check_version();
93 +
94 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
95 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
96 +
97 + /*
98 + * Initialize the OpenSSL library by the book! To start with, we must
99 +@@ -441,7 +441,7 @@ TLS_APPL_STATE *tls_client_init(const TL
100 + /*
101 + * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
102 + */
103 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
104 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
105 +
106 + /*
107 + * According to the OpenSSL documentation, temporary RSA key is needed
108 +--- src/tls/tls_dane.c.orig 2016-08-27 20:27:50 UTC
109 ++++ src/tls/tls_dane.c
110 +@@ -2163,7 +2163,7 @@ static SSL_CTX *ctx_init(const char *CAf
111 + tls_param_init();
112 + tls_check_version();
113 +
114 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
115 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
116 + SSL_load_error_strings();
117 + SSL_library_init();
118 + #endif
119 +--- src/tls/tls_rsa.c.orig 2016-01-03 14:49:51 UTC
120 ++++ src/tls/tls_rsa.c
121 +@@ -57,7 +57,7 @@
122 + /*
123 + * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
124 + */
125 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
126 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
127 +
128 + /* tls_tmp_rsa_cb - call-back to generate ephemeral RSA key */
129 +
130 +@@ -109,7 +109,7 @@ int main(int unused_argc, char *cons
131 + /*
132 + * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
133 + */
134 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
135 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
136 + RSA *rsa;
137 +
138 + msg_vstream_init(argv[0], VSTREAM_ERR);
139 +--- src/tls/tls_server.c.orig 2016-08-27 20:27:50 UTC
140 ++++ src/tls/tls_server.c
141 +@@ -174,7 +174,7 @@ static const char server_session_id_cont
142 + #endif /* OPENSSL_VERSION_NUMBER */
143 +
144 + /* OpenSSL 1.1.0 bitrot */
145 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
146 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
147 + typedef const unsigned char *session_id_t;
148 +
149 + #else
150 +@@ -377,7 +377,7 @@ TLS_APPL_STATE *tls_server_init(const TL
151 + */
152 + tls_check_version();
153 +
154 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
155 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
156 +
157 + /*
158 + * Initialize the OpenSSL library by the book! To start with, we must
159 +@@ -588,7 +588,7 @@ TLS_APPL_STATE *tls_server_init(const TL
160 + /*
161 + * 2015-12-05: Ephemeral RSA removed from OpenSSL 1.1.0-dev
162 + */
163 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
164 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
165 +
166 + /*
167 + * According to OpenSSL documentation, a temporary RSA key is needed when
168
169 diff --git a/mail-mta/postfix/files/postfix-libressl.patch b/mail-mta/postfix/files/postfix-libressl.patch
170 new file mode 100644
171 index 0000000..ce047b7
172 --- /dev/null
173 +++ b/mail-mta/postfix/files/postfix-libressl.patch
174 @@ -0,0 +1,17 @@
175 +OpenBSD patch at:
176 +http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/mail/postfix/snapshot/patches/patch-src_tls_tls_h
177 +$OpenBSD: patch-src_tls_tls_h,v 1.2 2016/02/25 09:39:49 sthen Exp $
178 +
179 +Fix building with LibreSSL
180 +
181 +--- src/tls/tls.h.orig Sat Feb 6 15:09:41 2016
182 ++++ src/tls/tls.h Sun Feb 14 19:54:38 2016
183 +@@ -89,7 +89,7 @@ extern const char *str_tls_level(int);
184 + #endif
185 +
186 + /* Backwards compatibility with OpenSSL < 1.1.0 */
187 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L
188 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
189 + #define OpenSSL_version_num SSLeay
190 + #define OpenSSL_version SSLeay_version
191 + #define OPENSSL_VERSION SSLEAY_VERSION
192
193 diff --git a/mail-mta/postfix/files/postfix-musl-fd.patch b/mail-mta/postfix/files/postfix-musl-fd.patch
194 new file mode 100644
195 index 0000000..b48b16f
196 --- /dev/null
197 +++ b/mail-mta/postfix/files/postfix-musl-fd.patch
198 @@ -0,0 +1,11 @@
199 +--- src/util/sys_defs.h 2017-06-05 02:46:02.016419848 +0000
200 ++++ src/util/sys_defs.h 2017-06-05 02:46:37.275600185 +0000
201 +@@ -813,7 +813,7 @@
202 + #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
203 + #endif
204 + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
205 +- || (__GLIBC__ < 2)
206 ++ || (defined(__GLIBC__) && (__GLIBC__ < 2))
207 + #define CANT_USE_SEND_RECV_MSG
208 + #define DEF_SMTP_CACHE_DEMAND 0
209 + #else
210
211 diff --git a/mail-mta/postfix/files/postfix.rc6.2.7 b/mail-mta/postfix/files/postfix.rc6.2.7
212 new file mode 100644
213 index 0000000..9a1c1e2
214 --- /dev/null
215 +++ b/mail-mta/postfix/files/postfix.rc6.2.7
216 @@ -0,0 +1,85 @@
217 +#!/sbin/openrc-run
218 +# Copyright 1999-2012 Gentoo Foundation
219 +# Distributed under the terms of the GNU General Public License v2
220 +
221 +extra_started_commands="reload abort flush"
222 +
223 +description_reload="Re-read configuration files. Running processes terminate at their earliest convenience."
224 +description_abort="Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately."
225 +description_flush="Force delivery: attempt to deliver every message in the deferred mail queue."
226 +
227 +# Please read http://www.postfix.org/MULTI_INSTANCE_README.html for multi instance support
228 +CONF_DIR="/etc/postfix"
229 +CONF_OPT="${SVCNAME##*.}"
230 +if [ -n ${CONF_OPT} -a ${SVCNAME} != "postfix" ]; then
231 + CONF_DIR="${CONF_DIR}.${CONF_OPT}"
232 +fi
233 +if [ "${CONF_DIR}" = "/etc/postfix" ]; then
234 + CONF_PARAM=""
235 + CONF_MESSAGE=""
236 +else
237 + CONF_PARAM="-c ${CONF_DIR}"
238 + CONF_MESSAGE="(${CONF_DIR})"
239 +fi
240 +
241 +depend() {
242 + use logger dns ypbind amavisd antivirus postfix_greylist net saslauthd
243 + if [ "${SVCNAME}" = "postfix" ]; then
244 + provide mta
245 + fi
246 +}
247 +
248 +start() {
249 + if [ ! -z "${CONF_PARAM}" ]; then
250 + einfo "Please consider updating your config for postmulti support."
251 + fi
252 + ebegin "Starting postfix ${CONF_MESSAGE}"
253 + if [ ! -d ${CONF_DIR} ]; then
254 + eend 1 "${CONF_DIR} does not exist"
255 + return 1
256 + fi
257 + /usr/sbin/postfix ${CONF_PARAM} start >/dev/null 2>&1
258 + eend $?
259 +}
260 +
261 +stop() {
262 + ebegin "Stopping postfix ${CONF_MESSAGE}"
263 + /usr/sbin/postfix ${CONF_PARAM} stop >/dev/null 2>&1
264 + eend
265 +}
266 +
267 +status() {
268 + local _retval
269 + einfon ""
270 + /usr/sbin/postfix ${CONF_PARAM} status
271 + _retval=$?
272 + if [ x${_retval} = 'x0' ]; then
273 + mark_service_started "${SVCNAME}"
274 + eend 0
275 + else
276 + mark_service_stopped "${SVCNAME}"
277 + eend 3
278 + fi
279 +}
280 +
281 +reload() {
282 + ebegin "Reloading postfix ${CONF_MESSAGE}"
283 + /usr/sbin/postfix ${CONF_PARAM} reload >/dev/null 2>&1
284 + eend $?
285 +}
286 +
287 +abort() {
288 + ebegin "Aborting postfix ${CONF_MESSAGE}"
289 +
290 + if service_started "${SVCNAME}"; then
291 + mark_service_stopped "${SVCNAME}"
292 + fi
293 + /usr/sbin/postfix ${CONF_PARAM} abort >/dev/null 2>&1
294 + eend $?
295 +}
296 +
297 +flush() {
298 + ebegin "Flushing postfix ${CONF_MESSAGE}"
299 + /usr/sbin/postfix ${CONF_PARAM} flush >/dev/null 2>&1
300 + eend $?
301 +}
302
303 diff --git a/mail-mta/postfix/files/postfix.service b/mail-mta/postfix/files/postfix.service
304 new file mode 100644
305 index 0000000..db585b3
306 --- /dev/null
307 +++ b/mail-mta/postfix/files/postfix.service
308 @@ -0,0 +1,26 @@
309 +[Unit]
310 +Description=Postfix Mail Transport Agent
311 +After=network.target
312 +
313 +[Service]
314 +Type=forking
315 +ExecStartPre=-/usr/bin/newaliases
316 +ExecStart=/usr/sbin/postfix start
317 +ExecStop=/usr/sbin/postfix stop
318 +ExecReload=/usr/sbin/postfix reload
319 +# Hardening
320 +PrivateTmp=yes
321 +PrivateDevices=yes
322 +ProtectSystem=full
323 +ReadWritePaths=-/etc/mail/aliases.db
324 +CapabilityBoundingSet=~ CAP_NET_ADMIN CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE
325 +MemoryDenyWriteExecute=true
326 +ProtectKernelModules=true
327 +ProtectKernelTunables=true
328 +ProtectControlGroups=true
329 +RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
330 +RestrictNamespaces=true
331 +RestrictRealtime=true
332 +
333 +[Install]
334 +WantedBy=multi-user.target
335
336 diff --git a/mail-mta/postfix/files/smtp.pass b/mail-mta/postfix/files/smtp.pass
337 new file mode 100644
338 index 0000000..f9b5120
339 --- /dev/null
340 +++ b/mail-mta/postfix/files/smtp.pass
341 @@ -0,0 +1,2 @@
342 +#
343 +# remotehost user:password
344
345 diff --git a/mail-mta/postfix/files/smtp.sasl b/mail-mta/postfix/files/smtp.sasl
346 new file mode 100644
347 index 0000000..82f2945
348 --- /dev/null
349 +++ b/mail-mta/postfix/files/smtp.sasl
350 @@ -0,0 +1,2 @@
351 +pwcheck_method:saslauthd
352 +mech_list: PLAIN
353
354 diff --git a/mail-mta/postfix/metadata.xml b/mail-mta/postfix/metadata.xml
355 new file mode 100644
356 index 0000000..0842375
357 --- /dev/null
358 +++ b/mail-mta/postfix/metadata.xml
359 @@ -0,0 +1,24 @@
360 +<?xml version="1.0" encoding="UTF-8"?>
361 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
362 +<pkgmetadata>
363 + <maintainer type="project">
364 + <email>net-mail@g.o</email>
365 + <name>Net-Mail</name>
366 + </maintainer>
367 + <use>
368 + <flag name="dovecot-sasl">Enable <pkg>net-mail/dovecot</pkg> protocol
369 + version 1 (server only) SASL implementation</flag>
370 + <flag name="eai">Add support for SMTPUTF8</flag>
371 + <flag name="ldap-bind">Add support for binding to LDAP backend
372 + using <pkg>dev-libs/cyrus-sasl</pkg></flag>
373 + <flag name="memcached">Add support for using <pkg>net-misc/memcached</pkg>
374 + for lookup tables</flag>
375 + <flag name="lmdb">Add support for using <pkg>dev-db/lmdb</pkg>
376 + for lookup tables</flag>
377 + <flag name="vda">Add support for virtual delivery agent quota
378 + enforcing</flag>
379 + </use>
380 + <upstream>
381 + <remote-id type="sourceforge">vda</remote-id>
382 + </upstream>
383 +</pkgmetadata>
384
385 diff --git a/mail-mta/postfix/postfix-3.1.6.ebuild b/mail-mta/postfix/postfix-3.1.6.ebuild
386 new file mode 100644
387 index 0000000..10ed98a
388 --- /dev/null
389 +++ b/mail-mta/postfix/postfix-3.1.6.ebuild
390 @@ -0,0 +1,309 @@
391 +# Copyright 1999-2017 Gentoo Foundation
392 +# Distributed under the terms of the GNU General Public License v2
393 +
394 +EAPI=6
395 +inherit flag-o-matic pam systemd toolchain-funcs user
396 +
397 +MY_PV="${PV/_rc/-RC}"
398 +MY_SRC="${PN}-${MY_PV}"
399 +MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
400 +RC_VER="2.7"
401 +
402 +DESCRIPTION="A fast and secure drop-in replacement for sendmail"
403 +HOMEPAGE="http://www.postfix.org/"
404 +SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
405 +
406 +LICENSE="IBM"
407 +SLOT="0"
408 +KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
409 +IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
410 +
411 +DEPEND=">=dev-libs/libpcre-3.4
412 + dev-lang/perl
413 + berkdb? ( >=sys-libs/db-3.2:* )
414 + cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
415 + eai? ( dev-libs/icu:= )
416 + ldap? ( net-nds/openldap )
417 + ldap-bind? ( net-nds/openldap[sasl] )
418 + lmdb? ( >=dev-db/lmdb-0.9.11 )
419 + mysql? ( virtual/mysql )
420 + pam? ( virtual/pam )
421 + postgres? ( dev-db/postgresql:* )
422 + sasl? ( >=dev-libs/cyrus-sasl-2 )
423 + sqlite? ( dev-db/sqlite:3 )
424 + ssl? (
425 + !libressl? ( dev-libs/openssl:0 )
426 + libressl? ( dev-libs/libressl )
427 + )"
428 +
429 +RDEPEND="${DEPEND}
430 + dovecot-sasl? ( net-mail/dovecot )
431 + memcached? ( net-misc/memcached )
432 + net-mail/mailbase
433 + !mail-mta/courier
434 + !mail-mta/esmtp
435 + !mail-mta/exim
436 + !mail-mta/mini-qmail
437 + !mail-mta/msmtp[mta]
438 + !mail-mta/netqmail
439 + !mail-mta/nullmailer
440 + !mail-mta/qmail-ldap
441 + !mail-mta/sendmail
442 + !mail-mta/opensmtpd
443 + !<mail-mta/ssmtp-2.64-r2
444 + !>=mail-mta/ssmtp-2.64-r2[mta]
445 + !net-mail/fastforward
446 + selinux? ( sec-policy/selinux-postfix )"
447 +
448 +REQUIRED_USE="ldap-bind? ( ldap sasl )"
449 +
450 +S="${WORKDIR}/${MY_SRC}"
451 +
452 +pkg_setup() {
453 + # Add postfix, postdrop user/group (bug #77565)
454 + enewgroup postfix 207
455 + enewgroup postdrop 208
456 + enewuser postfix 207 -1 /var/spool/postfix postfix,mail
457 +}
458 +
459 +src_prepare() {
460 + default
461 + sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
462 + src/util/sys_defs.h || die "sed failed"
463 + # change default paths to better comply with portage standard paths
464 + sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
465 + eapply -p0 "${FILESDIR}/${PN}-musl-fd.patch"
466 + eapply -p0 "${FILESDIR}/${PN}-libressl.patch"
467 + eapply -p0 "${FILESDIR}/${PN}-libressl-runtime.patch"
468 +}
469 +
470 +src_configure() {
471 + for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
472 + do
473 + local AUXLIBS_${name}=""
474 + done
475 +
476 + # Make sure LDFLAGS get passed down to the executables.
477 + local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
478 + AUXLIBS_PCRE="$(pcre-config --libs)"
479 +
480 + use pam && mylibs="${mylibs} -lpam"
481 +
482 + if use ldap; then
483 + mycc="${mycc} -DHAS_LDAP"
484 + AUXLIBS_LDAP="-lldap -llber"
485 + fi
486 +
487 + if use mysql; then
488 + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
489 + AUXLIBS_MYSQL="$(mysql_config --libs)"
490 + fi
491 +
492 + if use postgres; then
493 + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
494 + AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
495 + fi
496 +
497 + if use sqlite; then
498 + mycc="${mycc} -DHAS_SQLITE"
499 + AUXLIBS_SQLITE="-lsqlite3 -lpthread"
500 + fi
501 +
502 + if use ssl; then
503 + mycc="${mycc} -DUSE_TLS"
504 + mylibs="${mylibs} -lssl -lcrypto"
505 + fi
506 +
507 + if use lmdb; then
508 + mycc="${mycc} -DHAS_LMDB"
509 + AUXLIBS_LMDB="-llmdb -lpthread"
510 + fi
511 +
512 + if ! use eai; then
513 + mycc="${mycc} -DNO_EAI"
514 + fi
515 +
516 + # broken. and "in other words, not supported" by upstream.
517 + # Use inet_protocols setting in main.cf
518 + #if ! use ipv6; then
519 + # mycc="${mycc} -DNO_IPV6"
520 + #fi
521 +
522 + if use sasl; then
523 + if use dovecot-sasl; then
524 + # Set dovecot as default.
525 + mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
526 + fi
527 + if use ldap-bind; then
528 + mycc="${mycc} -DUSE_LDAP_SASL"
529 + fi
530 + mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
531 + mylibs="${mylibs} -lsasl2"
532 + elif use dovecot-sasl; then
533 + mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
534 + fi
535 +
536 + if ! use nis; then
537 + mycc="${mycc} -DNO_NIS"
538 + fi
539 +
540 + if ! use berkdb; then
541 + mycc="${mycc} -DNO_DB"
542 + if use cdb; then
543 + # change default hash format from Berkeley DB to cdb
544 + mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
545 + fi
546 + fi
547 +
548 + if use cdb; then
549 + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
550 + # Tinycdb is preferred.
551 + if has_version dev-db/tinycdb ; then
552 + einfo "Building with dev-db/tinycdb"
553 + AUXLIBS_CDB="-lcdb"
554 + else
555 + einfo "Building with dev-db/cdb"
556 + CDB_PATH="/usr/$(get_libdir)"
557 + for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
558 + AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
559 + done
560 + fi
561 + fi
562 +
563 + # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
564 + # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
565 + mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
566 + filter-lfs-flags
567 +
568 + # Workaround for bug #76512
569 + if use hardened; then
570 + [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
571 + fi
572 +
573 + # Remove annoying C++ comment style warnings - bug #378099
574 + append-flags -Wno-comment
575 +
576 + sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
577 + sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
578 +
579 + emake makefiles shared=yes dynamicmaps=no pie=yes \
580 + shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
581 + DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
582 + AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
583 + AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
584 + AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
585 + AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
586 +}
587 +
588 +src_install () {
589 + local myconf
590 + use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
591 + html_directory=\"/usr/share/doc/${PF}/html\""
592 +
593 + LD_LIBRARY_PATH="${S}/lib" \
594 + /bin/sh postfix-install \
595 + -non-interactive \
596 + install_root="${D}" \
597 + config_directory="/etc/postfix" \
598 + manpage_directory="/usr/share/man" \
599 + command_directory="/usr/sbin" \
600 + mailq_path="/usr/bin/mailq" \
601 + newaliases_path="/usr/bin/newaliases" \
602 + sendmail_path="/usr/sbin/sendmail" \
603 + ${myconf} \
604 + || die "postfix-install failed"
605 +
606 + # Fix spool removal on upgrade
607 + rm -Rf "${D}"/var
608 + keepdir /var/spool/postfix
609 +
610 + # Install rmail for UUCP, closes bug #19127
611 + dobin auxiliary/rmail/rmail
612 +
613 + # Provide another link for legacy FSH
614 + dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
615 +
616 + # Install qshape and posttls-finger
617 + dobin auxiliary/qshape/qshape.pl
618 + doman man/man1/qshape.1
619 + dobin bin/posttls-finger
620 + doman man/man1/posttls-finger.1
621 +
622 + # Performance tuning tools and their manuals
623 + dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
624 + doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
625 +
626 + # Set proper permissions on required files/directories
627 + dodir /var/lib/postfix
628 + keepdir /var/lib/postfix
629 + fowners -R postfix:postfix /var/lib/postfix
630 + fperms 0750 /var/lib/postfix
631 + fowners root:postdrop /usr/sbin/post{drop,queue}
632 + fperms 02711 /usr/sbin/post{drop,queue}
633 +
634 + keepdir /etc/postfix
635 + if use mbox; then
636 + mypostconf="mail_spool_directory=/var/spool/mail"
637 + else
638 + mypostconf="home_mailbox=.maildir/"
639 + fi
640 + LD_LIBRARY_PATH="${S}/lib" \
641 + "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
642 + -e ${mypostconf} || die "postconf failed"
643 +
644 + insinto /etc/postfix
645 + newins "${FILESDIR}"/smtp.pass saslpass
646 + fperms 600 /etc/postfix/saslpass
647 +
648 + newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
649 + # do not start mysql/postgres unnecessarily - bug #359913
650 + use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
651 + use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
652 +
653 + dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
654 + use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
655 +
656 + pamd_mimic_system smtp auth account
657 +
658 + if use sasl; then
659 + insinto /etc/sasl2
660 + newins "${FILESDIR}"/smtp.sasl smtpd.conf
661 + fi
662 +
663 + # header files
664 + insinto /usr/include/postfix
665 + doins include/*.h
666 +
667 + # Keep config_dir clean
668 + rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
669 + rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
670 +
671 + if has_version mail-mta/postfix; then
672 + # let the sysadmin decide when to change the compatibility_level
673 + sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
674 + fi
675 +
676 + systemd_dounit "${FILESDIR}/${PN}.service"
677 +}
678 +
679 +pkg_postinst() {
680 + if [[ ! -e /etc/mail/aliases.db ]] ; then
681 + ewarn
682 + ewarn "You must edit /etc/mail/aliases to suit your needs"
683 + ewarn "and then run /usr/bin/newaliases. Postfix will not"
684 + ewarn "work correctly without it."
685 + ewarn
686 + fi
687 +
688 + # configure tls
689 + if use ssl ; then
690 + if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
691 + elog "To configure client side TLS settings:"
692 + elog "${EROOT}"usr/sbin/postfix tls enable-client
693 + fi
694 + if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
695 + elog "To configure server side TLS settings:"
696 + elog "${EROOT}"usr/sbin/postfix tls enable-server
697 + fi
698 + fi
699 +}