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