Gentoo Archives: gentoo-commits

From: Eray Aslan <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/dovecot/, net-mail/dovecot/files/
Date: Fri, 05 Oct 2018 11:08:36
Message-Id: 1538737432.38b1b5ecb1cc03000e3e9db61cb6537a7b252106.eras@gentoo
1 commit: 38b1b5ecb1cc03000e3e9db61cb6537a7b252106
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 5 11:03:52 2018 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 5 11:03:52 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38b1b5ec
7
8 net-mail/dovecot: bump to 2.3.3
9
10 Closes: https://bugs.gentoo.org/666202
11 Closes: https://bugs.gentoo.org/667118
12 Closes: https://bugs.gentoo.org/664988
13 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
14 Package-Manager: Portage-2.3.50, Repoman-2.3.11
15
16 net-mail/dovecot/Manifest | 2 +
17 net-mail/dovecot/dovecot-2.3.3.ebuild | 291 ++++++++++++++++++++++++++
18 net-mail/dovecot/files/dovecot-glibc228.patch | 44 ++++
19 net-mail/dovecot/files/dovecot.init-r5 | 57 +++++
20 4 files changed, 394 insertions(+)
21
22 diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
23 index bf8481d15dc..1a99069f813 100644
24 --- a/net-mail/dovecot/Manifest
25 +++ b/net-mail/dovecot/Manifest
26 @@ -5,4 +5,6 @@ DIST dovecot-2.2.19.tar.gz 5256627 BLAKE2B 0b7fe57ced1b1f7eb5e29e8d6723d237cc107
27 DIST dovecot-2.2.34.tar.gz 6181270 BLAKE2B dfdb1e6812574e79595202e830167400569adf61155aa5ddaae443e798c4a05ccec2acd2975e00e9e7ffc63ee1dcf7e4e2a9288b1e6e1e1427d1e89790a8fa13 SHA512 9f08a7116a08a08495aa0e7b4cb6b11a924ea61006970487946e338bc79bba7fd7619c345cbf278a74de285d548af04fc66eaaee508185b8b9d7335cf5612055
28 DIST dovecot-2.2.36.tar.gz 6239707 BLAKE2B 702bb24265b5fefec9c484b3cca890fb1536ff94d1f2d6c99ee8c294ee4e38091eef5a727f0d4bd03700263286361f55747a22fa74def350710f9e49a4b10580 SHA512 327c50971e276f6013ca7f7bb59498ee88d76c9f8419bd18ee531cf10142214350fb81c6d64eaef73ee01765dd0fcf4142ab146ed67d9d7d86d5a58d41cf8db5
29 DIST dovecot-2.3-pigeonhole-0.5.2.tar.gz 1814618 BLAKE2B b1187021673429bee1b45a1f657bea995e9881257919ff55bac63106d65963294ee2b3829167c6d50e351c4bc3c7e88a5ccfb757308d2500c5d4146246145074 SHA512 6bc24d9241f94db795a012346d9bc94b5cc7d7ce0175c03213c2b5d179d80dec95e9bdbd50bed628c8f9f7c51639e692ba5e429212a3b4a654c1e4764ac4f11c
30 +DIST dovecot-2.3-pigeonhole-0.5.3.tar.gz 1827329 BLAKE2B 0d484906022217b1082233e6a3a20c17bafc68b90ce1c5c956c714d111ffb9ab49a3794e199695bb61a1f3ad6bd46e56e63ee3c140cb01eaa7589ef7bd754b19 SHA512 8403b1976a915836ba875b96825446d46e0d8c7ff245ed1f2b014347fdc78a81f9ed6dbd05bd3b4f1f7072edc5e9a302201cdb375de44436adcbb83919f203f5
31 DIST dovecot-2.3.2.1.tar.gz 6797491 BLAKE2B 92b88fd0f0cb8ed6c418bf27c2e1fc4efe13f1ccfb4948ce5eed1a4e76a4e96f0d6770d9841026ec5a515310ebaa4b335063e3516de454db8ba06cc4ee5a00ec SHA512 c085a0d04925485423086736a3c7d919ad0ca9efeff005890382da5333edb68c7d23ccb89fbe2ac44f8f016fc993bf2c669e450794c3ab13463676cbb47c7bf7
32 +DIST dovecot-2.3.3.tar.gz 6851107 BLAKE2B 87d6e11c8ff59cfe0b49d3561c307535efb09296af617530a4d5a89b4fc12055d006d1b283a4de076f27d59deb64324b96f28620958ad85c38197710c5decdf7 SHA512 8666c4f92f7df883067540f85be9d03dbe6815b58a7f5de55b4292e986e9a2a1ef52c7e0c72dde2bc781fe40d57488b78a99b6b813745b8e4683f1a2fdc1f2ff
33
34 diff --git a/net-mail/dovecot/dovecot-2.3.3.ebuild b/net-mail/dovecot/dovecot-2.3.3.ebuild
35 new file mode 100644
36 index 00000000000..9d28a2916e9
37 --- /dev/null
38 +++ b/net-mail/dovecot/dovecot-2.3.3.ebuild
39 @@ -0,0 +1,291 @@
40 +# Copyright 1999-2018 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=6
44 +# do not add a ssl USE flag. ssl is mandatory
45 +SSL_DEPS_SKIP=1
46 +inherit autotools ssl-cert systemd user versionator
47 +
48 +MY_P="${P/_/.}"
49 +#MY_S="${PN}-ce-${PV}"
50 +major_minor="$(get_version_component_range 1-2)"
51 +sieve_version="0.5.3"
52 +if [[ ${PV} == *_rc* ]] ; then
53 + rc_dir="rc/"
54 +else
55 + rc_dir=""
56 +fi
57 +SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
58 + sieve? (
59 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
60 + )
61 + managesieve? (
62 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
63 + ) "
64 +DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
65 +HOMEPAGE="https://www.dovecot.org/"
66 +
67 +SLOT="0"
68 +LICENSE="LGPL-2.1 MIT"
69 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
70 +
71 +IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
72 +IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
73 +IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
74 +
75 +IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
76 +
77 +DEPEND="argon2? ( dev-libs/libsodium )
78 + bzip2? ( app-arch/bzip2 )
79 + caps? ( sys-libs/libcap )
80 + kerberos? ( virtual/krb5 )
81 + ldap? ( net-nds/openldap )
82 + lua? ( dev-lang/lua:* )
83 + lucene? ( >=dev-cpp/clucene-2.3 )
84 + lzma? ( app-arch/xz-utils )
85 + lz4? ( app-arch/lz4 )
86 + mysql? ( virtual/mysql )
87 + pam? ( virtual/pam )
88 + postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
89 + selinux? ( sec-policy/selinux-dovecot )
90 + solr? ( net-misc/curl dev-libs/expat )
91 + sqlite? ( dev-db/sqlite:* )
92 + !libressl? ( dev-libs/openssl:0 )
93 + libressl? ( dev-libs/libressl )
94 + tcpd? ( sys-apps/tcp-wrappers )
95 + textcat? ( app-text/libexttextcat )
96 + vpopmail? ( net-mail/vpopmail )
97 + zlib? ( sys-libs/zlib )
98 + virtual/libiconv
99 + dev-libs/icu:="
100 +
101 +RDEPEND="${DEPEND}
102 + net-mail/mailbase"
103 +
104 +PATCHES=( "${FILESDIR}/${PN}-glibc228.patch" )
105 +
106 +pkg_setup() {
107 + if use managesieve && ! use sieve; then
108 + ewarn "managesieve USE flag selected but sieve USE flag unselected"
109 + ewarn "sieve USE flag will be turned on"
110 + fi
111 + # default internal user
112 + enewgroup dovecot 97
113 + enewuser dovecot 97 -1 /dev/null dovecot
114 + # default login user
115 + enewuser dovenull -1 -1 /dev/null
116 + # add "mail" group for suid'ing. Better security isolation.
117 + if use suid; then
118 + enewgroup mail
119 + fi
120 +}
121 +
122 +src_prepare() {
123 + default
124 + # bug 657108
125 + # elibtoolize
126 + eautoreconf
127 +}
128 +
129 +src_configure() {
130 + local conf=""
131 +
132 + if use postgres || use mysql || use sqlite; then
133 + conf="${conf} --with-sql"
134 + fi
135 +
136 + # turn valgrind tests off. Bug #340791
137 + VALGRIND=no econf \
138 + --with-rundir="${EPREFIX}/run/dovecot" \
139 + --with-statedir="${EPREFIX}/var/lib/dovecot" \
140 + --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
141 + --without-stemmer \
142 + --disable-rpath \
143 + --without-libbsd \
144 + --with-icu \
145 + --with-ssl \
146 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
147 + $( use_with argon2 sodium ) \
148 + $( use_with bzip2 bzlib ) \
149 + $( use_with caps libcap ) \
150 + $( use_with kerberos gssapi ) \
151 + $( use_with lua ) \
152 + $( use_with ldap ) \
153 + $( use_with lucene ) \
154 + $( use_with lz4 ) \
155 + $( use_with lzma ) \
156 + $( use_with mysql ) \
157 + $( use_with pam ) \
158 + $( use_with postgres pgsql ) \
159 + $( use_with sqlite ) \
160 + $( use_with solr ) \
161 + $( use_with tcpd libwrap ) \
162 + $( use_with textcat ) \
163 + $( use_with vpopmail ) \
164 + $( use_with zlib ) \
165 + $( use_enable static-libs static ) \
166 + ${conf}
167 +
168 + if use sieve || use managesieve ; then
169 + # The sieve plugin needs this file to be build to determine the plugin
170 + # directory and the list of libraries to link to.
171 + emake dovecot-config
172 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
173 + econf \
174 + $( use_enable static-libs static ) \
175 + --localstatedir="${EPREFIX%/}/var" \
176 + --enable-shared \
177 + --with-dovecot="${S}" \
178 + $( use_with managesieve )
179 + fi
180 +}
181 +
182 +src_compile() {
183 + default
184 + if use sieve || use managesieve ; then
185 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
186 + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
187 + fi
188 +}
189 +
190 +src_test() {
191 + default
192 + if use sieve || use managesieve ; then
193 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
194 + default
195 + fi
196 +}
197 +
198 +src_install () {
199 + default
200 +
201 + # insecure:
202 + # use suid && fperms u+s /usr/libexec/dovecot/deliver
203 + # better:
204 + if use suid;then
205 + einfo "Changing perms to allow deliver to be suided"
206 + fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
207 + fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
208 + fi
209 +
210 + newinitd "${FILESDIR}"/dovecot.init-r5 dovecot
211 +
212 + rm -rf "${ED}"/usr/share/doc/dovecot
213 +
214 + dodoc AUTHORS NEWS README TODO
215 + dodoc doc/*.{txt,cnf,xml,sh}
216 + docinto example-config
217 + dodoc doc/example-config/*.{conf,ext}
218 + docinto example-config/conf.d
219 + dodoc doc/example-config/conf.d/*.{conf,ext}
220 + docinto wiki
221 + dodoc doc/wiki/*
222 + doman doc/man/*.{1,7}
223 +
224 + # Create the dovecot.conf file from the dovecot-example.conf file that
225 + # the dovecot folks nicely left for us....
226 + local conf="${ED}/etc/dovecot/dovecot.conf"
227 + local confd="${ED}/etc/dovecot/conf.d"
228 +
229 + insinto /etc/dovecot
230 + doins doc/example-config/*.{conf,ext}
231 + insinto /etc/dovecot/conf.d
232 + doins doc/example-config/conf.d/*.{conf,ext}
233 + fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
234 + rm -f "${confd}/../README"
235 +
236 + # .maildir is the Gentoo default
237 + local mail_location="maildir:~/.maildir"
238 + sed -i -e \
239 + "s|#mail_location =|mail_location = ${mail_location}|" \
240 + "${confd}/10-mail.conf" \
241 + || die "failed to update mail location settings in 10-mail.conf"
242 +
243 + # We're using pam files (imap and pop3) provided by mailbase
244 + if use pam; then
245 + sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
246 + "${confd}/auth-system.conf.ext" \
247 + || die "failed to update PAM settings in auth-system.conf.ext"
248 + # mailbase does not provide a sieve pam file
249 + use managesieve && dosym imap /etc/pam.d/sieve
250 + sed -i -e \
251 + 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
252 + "${confd}/10-auth.conf" \
253 + || die "failed to update PAM settings in 10-auth.conf"
254 + fi
255 +
256 + # Disable ipv6 if necessary
257 + if ! use ipv6; then
258 + sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
259 + || die "failed to update listen settings in dovecot.conf"
260 + fi
261 +
262 + # Update ssl cert locations
263 + sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
264 + || die "ssl conf failed"
265 + sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
266 + -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
267 + "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
268 +
269 + # Install SQL configuration
270 + if use mysql || use postgres; then
271 + sed -i -e \
272 + 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
273 + "${confd}/10-auth.conf" || die "failed to update SQL settings in \
274 + 10-auth.conf"
275 + fi
276 +
277 + # Install LDAP configuration
278 + if use ldap; then
279 + sed -i -e \
280 + 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
281 + "${confd}/10-auth.conf" \
282 + || die "failed to update ldap settings in 10-auth.conf"
283 + fi
284 +
285 + if use vpopmail; then
286 + sed -i -e \
287 + 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
288 + "${confd}/10-auth.conf" \
289 + || die "failed to update vpopmail settings in 10-auth.conf"
290 + fi
291 +
292 + if use sieve || use managesieve ; then
293 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
294 + emake DESTDIR="${ED}" install
295 + sed -i -e \
296 + 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
297 + || die "failed to update sieve settings in 15-lda.conf"
298 + rm -rf "${ED}"/usr/share/doc/dovecot
299 + docinto example-config/conf.d
300 + dodoc doc/example-config/conf.d/*.conf
301 + insinto /etc/dovecot/conf.d
302 + doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
303 + use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
304 + docinto sieve/rfc
305 + dodoc doc/rfc/*.txt
306 + docinto sieve/devel
307 + dodoc doc/devel/DESIGN
308 + docinto plugins
309 + dodoc doc/plugins/*.txt
310 + docinto extensions
311 + dodoc doc/extensions/*.txt
312 + docinto locations
313 + dodoc doc/locations/*.txt
314 + doman doc/man/*.{1,7}
315 + fi
316 +
317 + use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
318 +}
319 +
320 +pkg_postinst() {
321 + # Let's not make a new certificate if we already have one
322 + if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
323 + -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
324 + einfo "Creating SSL certificate"
325 + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
326 + install_cert /etc/ssl/dovecot/server
327 + fi
328 +
329 + elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
330 +}
331
332 diff --git a/net-mail/dovecot/files/dovecot-glibc228.patch b/net-mail/dovecot/files/dovecot-glibc228.patch
333 new file mode 100644
334 index 00000000000..9549c12f6e8
335 --- /dev/null
336 +++ b/net-mail/dovecot/files/dovecot-glibc228.patch
337 @@ -0,0 +1,44 @@
338 +From 63a74b9e8e0604486a15a879e7f1a27257322400 Mon Sep 17 00:00:00 2001
339 +From: Aki Tuomi <aki.tuomi@×××××××.fi>
340 +Date: Wed, 8 Aug 2018 12:33:20 +0300
341 +Subject: [PATCH] auth: mycrypt - include crypt.h
342 +MIME-Version: 1.0
343 +Content-Type: text/plain; charset=UTF-8
344 +Content-Transfer-Encoding: 8bit
345 +
346 +Fixes crypt usage on glibc-2.28
347 +
348 +Reported by Reuben Farrelly
349 +Patch provided by Thore Bödecker
350 +---
351 + configure.ac | 2 +-
352 + src/auth/mycrypt.c | 3 +++
353 + 2 files changed, 4 insertions(+), 1 deletion(-)
354 +
355 +diff --git a/configure.ac b/configure.ac
356 +index dd545ebfdc..c5d8fae666 100644
357 +--- a/configure.ac
358 ++++ b/configure.ac
359 +@@ -315,7 +315,7 @@ AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h \
360 + quota.h sys/fs/quota_common.h \
361 + mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
362 + xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
363 +- sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h)
364 ++ sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h crypt.h)
365 +
366 + CC_CLANG
367 + AC_CC_PIE
368 +diff --git a/src/auth/mycrypt.c b/src/auth/mycrypt.c
369 +index c49fcf842e..0bd00bc238 100644
370 +--- a/src/auth/mycrypt.c
371 ++++ b/src/auth/mycrypt.c
372 +@@ -14,6 +14,9 @@
373 + # define _XPG6 /* Some Solaris versions require this, some break with this */
374 + #endif
375 + #include <unistd.h>
376 ++#ifdef HAVE_CRYPT_H
377 ++# include <crypt.h>
378 ++#endif
379 +
380 + #include "mycrypt.h"
381 +
382
383 diff --git a/net-mail/dovecot/files/dovecot.init-r5 b/net-mail/dovecot/files/dovecot.init-r5
384 new file mode 100644
385 index 00000000000..8a98603d4b4
386 --- /dev/null
387 +++ b/net-mail/dovecot/files/dovecot.init-r5
388 @@ -0,0 +1,57 @@
389 +#!/sbin/openrc-run
390 +# Copyright 1999-2018 Gentoo Authors
391 +# Distributed under the terms of the GNU General Public License, v2 or later
392 +
393 +extra_started_commands="reload"
394 +
395 +depend() {
396 + need localmount
397 + before postfix
398 + after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd
399 + use logger net
400 +}
401 +
402 +checkconfig() {
403 + DOVECOT_INSTANCE=${SVCNAME##*.}
404 + if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
405 + DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
406 + else
407 + DOVECOT_CONF=/etc/dovecot/dovecot.conf
408 + fi
409 + if [ ! -e ${DOVECOT_CONF} ]; then
410 + eerror "You will need an ${DOVECOT_CONF} first"
411 + return 1
412 + fi
413 + if [ -x /usr/sbin/dovecot ]; then
414 + DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} config -h base_dir)
415 + else
416 + eerror "dovecot not executable"
417 + return 1
418 + fi
419 + DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/run/dovecot}
420 + DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid
421 +}
422 +
423 +start() {
424 + checkconfig || return 1
425 + ebegin "Starting ${SVCNAME}"
426 + start-stop-daemon --start --exec /usr/sbin/dovecot \
427 + --pidfile "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}"
428 + eend $?
429 +}
430 +
431 +stop() {
432 + checkconfig || return 1
433 + ebegin "Stopping ${SVCNAME}"
434 + start-stop-daemon --stop --exec /usr/sbin/dovecot \
435 + --pidfile "${DOVECOT_PIDFILE}"
436 + eend $?
437 +}
438 +
439 +reload() {
440 + checkconfig || return 1
441 + ebegin "Reloading ${SVCNAME} configs and restarting auth/login processes"
442 + start-stop-daemon --signal HUP --exec /usr/sbin/dovecot \
443 + --pidfile "${DOVECOT_PIDFILE}"
444 + eend $?
445 +}