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/
Date: Sat, 20 Apr 2019 23:25:41
Message-Id: 1555655675.3f2896be569c065349d7259299890ac5f70f8aeb.eras@gentoo
1 commit: 3f2896be569c065349d7259299890ac5f70f8aeb
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 19 06:34:35 2019 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 06:34:35 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f2896be
7
8 net-mail/dovecot: security bump to 2.3.5.2
9
10 Bug: https://bugs.gentoo.org/683732
11 Package-Manager: Portage-2.3.63, Repoman-2.3.12
12 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
13
14 net-mail/dovecot/Manifest | 1 +
15 net-mail/dovecot/dovecot-2.3.5.2.ebuild | 294 ++++++++++++++++++++++++++++++++
16 2 files changed, 295 insertions(+)
17
18 diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
19 index 87b742b9a6d..b319ea6bed2 100644
20 --- a/net-mail/dovecot/Manifest
21 +++ b/net-mail/dovecot/Manifest
22 @@ -2,3 +2,4 @@ DIST dovecot-2.2-pigeonhole-0.4.24.1.tar.gz 1810959 BLAKE2B f24b28dc7422ea4f379e
23 DIST dovecot-2.2.36.3.tar.gz 6270735 BLAKE2B 90bd6f7cd3769040215f574bb368c1ad835041fff54273e2477be2d2e057c1700472b08a24ed3a7cad469bd39449d94986bc6801373bb97a63975ddbb54cefa5 SHA512 47611dbde7ee854ad323dcdb726757c7172376761fa774f28fce3f9d74ed590319d812f0555abed5f8178c326c3cb7661ac0b708ca5982914e255cec60f72e35
24 DIST dovecot-2.3-pigeonhole-0.5.5.tar.gz 1847487 BLAKE2B 9574388566778a4011ce6546021675ed9e07ba0d874dc4163e4cea10096f3bb8a434f198c3bb446b628ee18402afe94bd90b7123b3cf4d47e4095ddad12d9bfc SHA512 21519fc9b1152a947b64ce4251e1a4bdbe003b48233b1856a32696f9c1e29f730268c56eb38f9431bbfac345e6cd42e8c78c87d0702f39ebf20c6d326dcdbb94
25 DIST dovecot-2.3.5.1.tar.gz 6953150 BLAKE2B 04484325e7b87f78c0aa6e3c769bc921e9dc62562cd8705b99166b7291b794f434b088dcf6512bc21c96d8937475cafa4d49c6ac611cb07f74a0d20e15e185c7 SHA512 e87754461fb0b065acd0ff10dc955000a2fe5baffed69efaf328ce9268f90140e9de444bc68e0bd48b565c7622885a79b1f90ff3dd2335c0c2362d05d9e73e8a
26 +DIST dovecot-2.3.5.2.tar.gz 6953228 BLAKE2B d3634ca0621349ed82c552b416bd633497ce9e4bdd5df30c2e35da1ab70a5934e2dda2b88ac6bbebeebc23918d9dcfb7a0976b1b51fba5eefd14327b2b2ea734 SHA512 041ec1c33c6accb5c89d96d7ab2f7dd59795f496c17faea1906e7977983e4a387aa855a238376515c09532731634d9d42e6d6be22659062855241847ea0213d5
27
28 diff --git a/net-mail/dovecot/dovecot-2.3.5.2.ebuild b/net-mail/dovecot/dovecot-2.3.5.2.ebuild
29 new file mode 100644
30 index 00000000000..b04e363563d
31 --- /dev/null
32 +++ b/net-mail/dovecot/dovecot-2.3.5.2.ebuild
33 @@ -0,0 +1,294 @@
34 +# Copyright 1999-2019 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +# do not add a ssl USE flag. ssl is mandatory
40 +SSL_DEPS_SKIP=1
41 +inherit autotools eapi7-ver ssl-cert systemd user
42 +
43 +MY_P="${P/_/.}"
44 +#MY_S="${PN}-ce-${PV}"
45 +major_minor="$(ver_cut 1-2)"
46 +sieve_version="0.5.5"
47 +if [[ ${PV} == *_rc* ]] ; then
48 + rc_dir="rc/"
49 +else
50 + rc_dir=""
51 +fi
52 +SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
53 + sieve? (
54 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
55 + )
56 + managesieve? (
57 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
58 + ) "
59 +DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
60 +HOMEPAGE="https://www.dovecot.org/"
61 +
62 +SLOT="0"
63 +LICENSE="LGPL-2.1 MIT"
64 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
65 +
66 +IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail"
67 +IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
68 +IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat"
69 +
70 +IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
71 +
72 +DEPEND="argon2? ( dev-libs/libsodium )
73 + bzip2? ( app-arch/bzip2 )
74 + caps? ( sys-libs/libcap )
75 + kerberos? ( virtual/krb5 )
76 + ldap? ( net-nds/openldap )
77 + lua? ( dev-lang/lua:* )
78 + lucene? ( >=dev-cpp/clucene-2.3 )
79 + lzma? ( app-arch/xz-utils )
80 + lz4? ( app-arch/lz4 )
81 + mysql? ( dev-db/mysql-connector-c:0= )
82 + pam? ( virtual/pam )
83 + postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
84 + selinux? ( sec-policy/selinux-dovecot )
85 + solr? ( net-misc/curl dev-libs/expat )
86 + sqlite? ( dev-db/sqlite:* )
87 + !libressl? ( dev-libs/openssl:0 )
88 + libressl? ( dev-libs/libressl )
89 + tcpd? ( sys-apps/tcp-wrappers )
90 + textcat? ( app-text/libexttextcat )
91 + vpopmail? ( net-mail/vpopmail )
92 + zlib? ( sys-libs/zlib )
93 + virtual/libiconv
94 + dev-libs/icu:="
95 +
96 +RDEPEND="${DEPEND}
97 + net-mail/mailbase"
98 +
99 +PATCHES=(
100 + "${FILESDIR}/${PN}-userdb-passwd-fix.patch"
101 +)
102 +
103 +pkg_setup() {
104 + if use managesieve && ! use sieve; then
105 + ewarn "managesieve USE flag selected but sieve USE flag unselected"
106 + ewarn "sieve USE flag will be turned on"
107 + fi
108 + # default internal user
109 + enewgroup dovecot 97
110 + enewuser dovecot 97 -1 /dev/null dovecot
111 + # default login user
112 + enewuser dovenull -1 -1 /dev/null
113 + # add "mail" group for suid'ing. Better security isolation.
114 + if use suid; then
115 + enewgroup mail
116 + fi
117 +}
118 +
119 +src_prepare() {
120 + default
121 + # bug 657108
122 + elibtoolize
123 + #eautoreconf
124 +}
125 +
126 +src_configure() {
127 + local conf=""
128 +
129 + if use postgres || use mysql || use sqlite; then
130 + conf="${conf} --with-sql"
131 + fi
132 +
133 + # turn valgrind tests off. Bug #340791
134 + VALGRIND=no econf \
135 + --with-rundir="${EPREFIX}/run/dovecot" \
136 + --with-statedir="${EPREFIX}/var/lib/dovecot" \
137 + --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
138 + --without-stemmer \
139 + --disable-rpath \
140 + --without-libbsd \
141 + --with-icu \
142 + --with-ssl \
143 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
144 + $( use_with argon2 sodium ) \
145 + $( use_with bzip2 bzlib ) \
146 + $( use_with caps libcap ) \
147 + $( use_with kerberos gssapi ) \
148 + $( use_with lua ) \
149 + $( use_with ldap ) \
150 + $( use_with lucene ) \
151 + $( use_with lz4 ) \
152 + $( use_with lzma ) \
153 + $( use_with mysql ) \
154 + $( use_with pam ) \
155 + $( use_with postgres pgsql ) \
156 + $( use_with sqlite ) \
157 + $( use_with solr ) \
158 + $( use_with tcpd libwrap ) \
159 + $( use_with textcat ) \
160 + $( use_with vpopmail ) \
161 + $( use_with zlib ) \
162 + $( use_enable static-libs static ) \
163 + ${conf}
164 +
165 + if use sieve || use managesieve ; then
166 + # The sieve plugin needs this file to be build to determine the plugin
167 + # directory and the list of libraries to link to.
168 + emake dovecot-config
169 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
170 + econf \
171 + $( use_enable static-libs static ) \
172 + --localstatedir="${EPREFIX%/}/var" \
173 + --enable-shared \
174 + --with-dovecot="${S}" \
175 + $( use_with managesieve )
176 + fi
177 +}
178 +
179 +src_compile() {
180 + default
181 + if use sieve || use managesieve ; then
182 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
183 + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
184 + fi
185 +}
186 +
187 +src_test() {
188 + default
189 + if use sieve || use managesieve ; then
190 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
191 + default
192 + fi
193 +}
194 +
195 +src_install () {
196 + default
197 +
198 + # insecure:
199 + # use suid && fperms u+s /usr/libexec/dovecot/deliver
200 + # better:
201 + if use suid;then
202 + einfo "Changing perms to allow deliver to be suided"
203 + fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
204 + fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
205 + fi
206 +
207 + newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
208 +
209 + rm -rf "${ED}"/usr/share/doc/dovecot
210 +
211 + dodoc AUTHORS NEWS README TODO
212 + dodoc doc/*.{txt,cnf,xml,sh}
213 + docinto example-config
214 + dodoc doc/example-config/*.{conf,ext}
215 + docinto example-config/conf.d
216 + dodoc doc/example-config/conf.d/*.{conf,ext}
217 + docinto wiki
218 + dodoc doc/wiki/*
219 + doman doc/man/*.{1,7}
220 +
221 + # Create the dovecot.conf file from the dovecot-example.conf file that
222 + # the dovecot folks nicely left for us....
223 + local conf="${ED}/etc/dovecot/dovecot.conf"
224 + local confd="${ED}/etc/dovecot/conf.d"
225 +
226 + insinto /etc/dovecot
227 + doins doc/example-config/*.{conf,ext}
228 + insinto /etc/dovecot/conf.d
229 + doins doc/example-config/conf.d/*.{conf,ext}
230 + fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
231 + rm -f "${confd}/../README"
232 +
233 + # .maildir is the Gentoo default
234 + local mail_location="maildir:~/.maildir"
235 + sed -i -e \
236 + "s|#mail_location =|mail_location = ${mail_location}|" \
237 + "${confd}/10-mail.conf" \
238 + || die "failed to update mail location settings in 10-mail.conf"
239 +
240 + # We're using pam files (imap and pop3) provided by mailbase
241 + if use pam; then
242 + sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
243 + "${confd}/auth-system.conf.ext" \
244 + || die "failed to update PAM settings in auth-system.conf.ext"
245 + # mailbase does not provide a sieve pam file
246 + use managesieve && dosym imap /etc/pam.d/sieve
247 + sed -i -e \
248 + 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
249 + "${confd}/10-auth.conf" \
250 + || die "failed to update PAM settings in 10-auth.conf"
251 + fi
252 +
253 + # Disable ipv6 if necessary
254 + if ! use ipv6; then
255 + sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
256 + || die "failed to update listen settings in dovecot.conf"
257 + fi
258 +
259 + # Update ssl cert locations
260 + sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
261 + || die "ssl conf failed"
262 + sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
263 + -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
264 + "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
265 +
266 + # Install SQL configuration
267 + if use mysql || use postgres; then
268 + sed -i -e \
269 + 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
270 + "${confd}/10-auth.conf" || die "failed to update SQL settings in \
271 + 10-auth.conf"
272 + fi
273 +
274 + # Install LDAP configuration
275 + if use ldap; then
276 + sed -i -e \
277 + 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
278 + "${confd}/10-auth.conf" \
279 + || die "failed to update ldap settings in 10-auth.conf"
280 + fi
281 +
282 + if use vpopmail; then
283 + sed -i -e \
284 + 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
285 + "${confd}/10-auth.conf" \
286 + || die "failed to update vpopmail settings in 10-auth.conf"
287 + fi
288 +
289 + if use sieve || use managesieve ; then
290 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
291 + emake DESTDIR="${ED}" install
292 + sed -i -e \
293 + 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
294 + || die "failed to update sieve settings in 15-lda.conf"
295 + rm -rf "${ED}"/usr/share/doc/dovecot
296 + docinto example-config/conf.d
297 + dodoc doc/example-config/conf.d/*.conf
298 + insinto /etc/dovecot/conf.d
299 + doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
300 + use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
301 + docinto sieve/rfc
302 + dodoc doc/rfc/*.txt
303 + docinto sieve/devel
304 + dodoc doc/devel/DESIGN
305 + docinto plugins
306 + dodoc doc/plugins/*.txt
307 + docinto extensions
308 + dodoc doc/extensions/*.txt
309 + docinto locations
310 + dodoc doc/locations/*.txt
311 + doman doc/man/*.{1,7}
312 + fi
313 +
314 + use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
315 +}
316 +
317 +pkg_postinst() {
318 + # Let's not make a new certificate if we already have one
319 + if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
320 + -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
321 + einfo "Creating SSL certificate"
322 + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
323 + install_cert /etc/ssl/dovecot/server
324 + fi
325 +
326 + elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
327 +}