Gentoo Archives: gentoo-commits

From: "Eray Aslan (eras)" <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-mail/dovecot: dovecot-2.2.16-r1.ebuild ChangeLog
Date: Tue, 28 Apr 2015 19:39:34
Message-Id: 20150428193926.F351199F@oystercatcher.gentoo.org
1 eras 15/04/28 19:39:25
2
3 Modified: ChangeLog
4 Added: dovecot-2.2.16-r1.ebuild
5 Log:
6 Security bump - bug #547872
7
8 (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
9
10 Revision Changes Path
11 1.503 net-mail/dovecot/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.503&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.503&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?r1=1.502&r2=1.503
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v
20 retrieving revision 1.502
21 retrieving revision 1.503
22 diff -u -r1.502 -r1.503
23 --- ChangeLog 23 Mar 2015 16:02:40 -0000 1.502
24 +++ ChangeLog 28 Apr 2015 19:39:25 -0000 1.503
25 @@ -1,6 +1,12 @@
26 # ChangeLog for net-mail/dovecot
27 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.502 2015/03/23 16:02:40 eras Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.503 2015/04/28 19:39:25 eras Exp $
30 +
31 +*dovecot-2.2.16-r1 (28 Apr 2015)
32 +
33 + 28 Apr 2015; Eray Aslan <eras@g.o> +dovecot-2.2.16-r1.ebuild,
34 + +files/CVE-2015-3420.patch:
35 + Security bump - bug #547872
36
37 23 Mar 2015; Eray Aslan <eras@g.o> -dovecot-2.2.13.ebuild,
38 -dovecot-2.2.14-r1.ebuild, -dovecot-2.2.14.ebuild, -dovecot-2.2.15-r1.ebuild,
39
40
41
42 1.1 net-mail/dovecot/dovecot-2.2.16-r1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/dovecot-2.2.16-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/dovecot-2.2.16-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: dovecot-2.2.16-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2015 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/dovecot-2.2.16-r1.ebuild,v 1.1 2015/04/28 19:39:25 eras Exp $
52
53 EAPI=5
54 inherit eutils multilib ssl-cert systemd user versionator
55
56 MY_P="${P/_/.}"
57 major_minor="$(get_version_component_range 1-2)"
58 sieve_version="0.4.7"
59 if [[ ${PV} == *_rc* ]] ; then
60 rc_dir="rc/"
61 else
62 rc_dir=""
63 fi
64 SRC_URI="http://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
65 sieve? (
66 http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
67 )
68 managesieve? (
69 http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
70 ) "
71 DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
72 HOMEPAGE="http://www.dovecot.org/"
73
74 SLOT="0"
75 LICENSE="LGPL-2.1 MIT"
76 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86"
77
78 IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail"
79 IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox"
80 IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib"
81 IUSE_DOVECOT_OTHER="caps doc ipv6 lucene managesieve selinux sieve solr +ssl static-libs suid tcpd"
82
83 IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
84
85 DEPEND="bzip2? ( app-arch/bzip2 )
86 caps? ( sys-libs/libcap )
87 kerberos? ( virtual/krb5 )
88 ldap? ( net-nds/openldap )
89 lucene? ( >=dev-cpp/clucene-2.3 )
90 lzma? ( app-arch/xz-utils )
91 lz4? ( app-arch/lz4 )
92 mysql? ( virtual/mysql )
93 pam? ( virtual/pam )
94 postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
95 selinux? ( sec-policy/selinux-dovecot )
96 solr? ( net-misc/curl dev-libs/expat )
97 sqlite? ( dev-db/sqlite:* )
98 ssl? ( dev-libs/openssl:* )
99 tcpd? ( sys-apps/tcp-wrappers )
100 vpopmail? ( net-mail/vpopmail )
101 zlib? ( sys-libs/zlib )
102 virtual/libiconv"
103
104 RDEPEND="${DEPEND}
105 net-mail/mailbase"
106
107 S=${WORKDIR}/${MY_P}
108
109 pkg_setup() {
110 if use managesieve && ! use sieve; then
111 ewarn "managesieve USE flag selected but sieve USE flag unselected"
112 ewarn "sieve USE flag will be turned on"
113 fi
114 # default internal user
115 enewgroup dovecot 97
116 enewuser dovecot 97 -1 /dev/null dovecot
117 # default login user
118 enewuser dovenull -1 -1 /dev/null
119 # add "mail" group for suid'ing. Better security isolation.
120 if use suid; then
121 enewgroup mail
122 fi
123 }
124
125 src_prepare() {
126 epatch "${FILESDIR}/CVE-2015-3420.patch"
127 epatch "${FILESDIR}/${PN}-10-ssl.patch"
128
129 epatch_user
130 }
131
132 src_configure() {
133 local conf=""
134
135 if use postgres || use mysql || use sqlite; then
136 conf="${conf} --with-sql"
137 fi
138
139 local storages=""
140 for storage in ${IUSE_DOVECOT_STORAGE//+/}; do
141 use ${storage} && storages="${storage} ${storages}"
142 done
143 [ "${storages}" ] || storages="maildir"
144
145 # turn valgrind tests off. Bug #340791
146 VALGRIND=no econf \
147 --localstatedir="${EPREFIX}/var" \
148 --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
149 --without-stemmer \
150 --with-storages="${storages}" \
151 --disable-rpath \
152 $( systemd_with_unitdir ) \
153 $( use_with bzip2 bzlib ) \
154 $( use_with caps libcap ) \
155 $( use_with kerberos gssapi ) \
156 $( use_with ldap ) \
157 $( use_with lucene ) \
158 $( use_with lz4 ) \
159 $( use_with lzma ) \
160 $( use_with mysql ) \
161 $( use_with pam ) \
162 $( use_with postgres pgsql ) \
163 $( use_with sqlite ) \
164 $( use_with solr ) \
165 $( use_with ssl ) \
166 $( use_with tcpd libwrap ) \
167 $( use_with vpopmail ) \
168 $( use_with zlib ) \
169 $( use_enable static-libs static ) \
170 ${conf}
171
172 if use sieve || use managesieve ; then
173 # The sieve plugin needs this file to be build to determine the plugin
174 # directory and the list of libraries to link to.
175 emake dovecot-config
176 cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
177 econf \
178 $( use_enable static-libs static ) \
179 --localstatedir="${EPREFIX}/var" \
180 --enable-shared \
181 --with-dovecot="../${MY_P}" \
182 $( use_with managesieve )
183 fi
184 }
185
186 src_compile() {
187 default
188 if use sieve || use managesieve ; then
189 cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
190 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
191 fi
192 }
193
194 src_test() {
195 default
196 if use sieve || use managesieve ; then
197 cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
198 default
199 fi
200 }
201
202 src_install () {
203 default
204
205 # insecure:
206 # use suid && fperms u+s /usr/libexec/dovecot/deliver
207 # better:
208 if use suid;then
209 einfo "Changing perms to allow deliver to be suided"
210 fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
211 fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda"
212 fi
213
214 newinitd "${FILESDIR}"/dovecot.init-r4 dovecot
215
216 rm -rf "${ED}"/usr/share/doc/dovecot
217
218 dodoc AUTHORS NEWS README TODO
219 dodoc doc/*.{txt,cnf,xml,sh}
220 docinto example-config
221 dodoc doc/example-config/*.{conf,ext}
222 docinto example-config/conf.d
223 dodoc doc/example-config/conf.d/*.{conf,ext}
224 docinto wiki
225 dodoc doc/wiki/*
226 doman doc/man/*.{1,7}
227
228 # Create the dovecot.conf file from the dovecot-example.conf file that
229 # the dovecot folks nicely left for us....
230 local conf="${ED}/etc/dovecot/dovecot.conf"
231 local confd="${ED}/etc/dovecot/conf.d"
232
233 insinto /etc/dovecot
234 doins doc/example-config/*.{conf,ext}
235 insinto /etc/dovecot/conf.d
236 doins doc/example-config/conf.d/*.{conf,ext}
237 fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext
238 rm -f "${confd}/../README"
239
240 # .maildir is the Gentoo default
241 local mail_location="maildir:~/.maildir"
242 if ! use maildir; then
243 if use mbox; then
244 mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
245 keepdir /var/dovecot
246 sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \
247 "${confd}/10-mail.conf" || die "sed failed"
248 elif use mdbox ; then
249 mail_location="mdbox:~/.mdbox"
250 elif use sdbox ; then
251 mail_location="sdbox:~/.sdbox"
252 fi
253 fi
254 sed -i -e \
255 "s|#mail_location =|mail_location = ${mail_location}|" \
256 "${confd}/10-mail.conf" \
257 || die "failed to update mail location settings in 10-mail.conf"
258
259 # We're using pam files (imap and pop3) provided by mailbase
260 if use pam; then
261 sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
262 "${confd}/auth-system.conf.ext" \
263 || die "failed to update PAM settings in auth-system.conf.ext"
264 # mailbase does not provide a sieve pam file
265 use managesieve && dosym imap /etc/pam.d/sieve
266 sed -i -e \
267 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
268 "${confd}/10-auth.conf" \
269 || die "failed to update PAM settings in 10-auth.conf"
270 fi
271
272 # Disable ipv6 if necessary
273 if ! use ipv6; then
274 sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
275 || die "failed to update listen settings in dovecot.conf"
276 fi
277
278 # Update ssl cert locations
279 if use ssl; then
280 sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
281 || die "ssl conf failed"
282 sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
283 -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
284 "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
285 fi
286
287 # Install SQL configuration
288 if use mysql || use postgres; then
289 sed -i -e \
290 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
291 "${confd}/10-auth.conf" || die "failed to update SQL settings in \
292 10-auth.conf"
293 fi
294
295 # Install LDAP configuration
296 if use ldap; then
297 sed -i -e \
298 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
299 "${confd}/10-auth.conf" \
300 || die "failed to update ldap settings in 10-auth.conf"
301 fi
302
303 if use vpopmail; then
304 sed -i -e \
305 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \
306 "${confd}/10-auth.conf" \
307 || die "failed to update vpopmail settings in 10-auth.conf"
308 fi
309
310 if use sieve || use managesieve ; then
311 cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
312 emake DESTDIR="${ED}" install
313 sed -i -e \
314 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \
315 || die "failed to update sieve settings in 15-lda.conf"
316 rm -rf "${ED}"/usr/share/doc/dovecot
317 dodoc doc/*.txt
318 docinto example-config/conf.d
319 dodoc doc/example-config/conf.d/*.conf
320 insinto /etc/dovecot/conf.d
321 doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf
322 use managesieve && doins doc/example-config/conf.d/20-managesieve.conf
323 docinto sieve/rfc
324 dodoc doc/rfc/*.txt
325 docinto sieve/devel
326 dodoc doc/devel/DESIGN
327 doman doc/man/*.{1,7}
328 fi
329
330 use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete
331 }
332
333 pkg_postinst() {
334 if use ssl; then
335 # Let's not make a new certificate if we already have one
336 if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
337 -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
338 einfo "Creating SSL certificate"
339 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
340 install_cert /etc/ssl/dovecot/server
341 fi
342 fi
343
344 elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes."
345 }