1 |
eras 11/04/30 20:48:43 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: dovecot-2.0.12-r2.ebuild |
5 |
Log: |
6 |
Backport sdbox patch - bug #365445. Thanks to Kerin Millar. |
7 |
|
8 |
(Portage version: 2.1.9.46/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.294 net-mail/dovecot/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.294&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.294&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/ChangeLog?r1=1.293&r2=1.294 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v |
20 |
retrieving revision 1.293 |
21 |
retrieving revision 1.294 |
22 |
diff -u -r1.293 -r1.294 |
23 |
--- ChangeLog 15 Apr 2011 21:52:46 -0000 1.293 |
24 |
+++ ChangeLog 30 Apr 2011 20:48:43 -0000 1.294 |
25 |
@@ -1,6 +1,12 @@ |
26 |
# ChangeLog for net-mail/dovecot |
27 |
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.293 2011/04/15 21:52:46 eras Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.294 2011/04/30 20:48:43 eras Exp $ |
30 |
+ |
31 |
+*dovecot-2.0.12-r2 (30 Apr 2011) |
32 |
+ |
33 |
+ 30 Apr 2011; Eray Aslan <eras@g.o> +dovecot-2.0.12-r2.ebuild, |
34 |
+ +files/dovecot-2.0.12-sdbox.patch: |
35 |
+ Backport sdbox patch - bug #365445. Thanks to Kerin Millar. |
36 |
|
37 |
*dovecot-2.0.12-r1 (15 Apr 2011) |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
1.1 net-mail/dovecot/dovecot-2.0.12-r2.ebuild |
43 |
|
44 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/dovecot-2.0.12-r2.ebuild?rev=1.1&view=markup |
45 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/dovecot/dovecot-2.0.12-r2.ebuild?rev=1.1&content-type=text/plain |
46 |
|
47 |
Index: dovecot-2.0.12-r2.ebuild |
48 |
=================================================================== |
49 |
# Copyright 1999-2011 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.0.12-r2.ebuild,v 1.1 2011/04/30 20:48:43 eras Exp $ |
52 |
|
53 |
EAPI="3" |
54 |
|
55 |
inherit eutils versionator ssl-cert |
56 |
|
57 |
MY_P="${P/_/.}" |
58 |
major_minor="$( get_version_component_range 1-2 )" |
59 |
sieve_version="0.2.3" |
60 |
SRC_URI="http://dovecot.org/releases/${major_minor}/${MY_P}.tar.gz |
61 |
sieve? ( |
62 |
http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
63 |
) |
64 |
managesieve? ( |
65 |
http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
66 |
) " |
67 |
DESCRIPTION="An IMAP and POP3 server written with security primarily in mind" |
68 |
HOMEPAGE="http://www.dovecot.org/" |
69 |
|
70 |
SLOT="0" |
71 |
LICENSE="LGPL-2.1 MIT" |
72 |
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd" |
73 |
|
74 |
IUSE="berkdb bzip2 caps cydir sdbox doc ipv6 kerberos ldap +maildir managesieve mbox mdbox mysql pam postgres sieve sqlite +ssl suid vpopmail zlib" |
75 |
|
76 |
DEPEND="berkdb? ( sys-libs/db ) |
77 |
caps? ( sys-libs/libcap ) |
78 |
kerberos? ( virtual/krb5 ) |
79 |
ldap? ( net-nds/openldap ) |
80 |
mysql? ( virtual/mysql ) |
81 |
pam? ( virtual/pam ) |
82 |
postgres? ( dev-db/postgresql-base ) |
83 |
sqlite? ( dev-db/sqlite ) |
84 |
ssl? ( dev-libs/openssl ) |
85 |
vpopmail? ( net-mail/vpopmail ) |
86 |
virtual/libiconv" |
87 |
|
88 |
RDEPEND="${DEPEND} |
89 |
>=net-mail/mailbase-0.00-r8" |
90 |
|
91 |
S=${WORKDIR}/${MY_P} |
92 |
|
93 |
pkg_setup() { |
94 |
if use managesieve && ! use sieve; then |
95 |
ewarn "managesieve USE flag selected but sieve USE flag unselected" |
96 |
ewarn "sieve USE flag will be turned on" |
97 |
fi |
98 |
|
99 |
# Add user and group for login process (same as for fedora/redhat) |
100 |
# default internal user |
101 |
enewgroup dovecot 97 |
102 |
enewuser dovecot 97 -1 /dev/null dovecot |
103 |
# add "mail" group for suid'ing. Better security isolation. |
104 |
if use suid; then |
105 |
enewgroup mail |
106 |
fi |
107 |
# default login user |
108 |
enewuser dovenull -1 -1 /dev/null |
109 |
} |
110 |
|
111 |
src_prepare() { |
112 |
epatch "${FILESDIR}/${P}-sdbox.patch" |
113 |
} |
114 |
|
115 |
src_configure() { |
116 |
local conf="" |
117 |
|
118 |
if use postgres || use mysql || use sqlite; then |
119 |
conf="${conf} --with-sql" |
120 |
fi |
121 |
|
122 |
local storages="" |
123 |
for storage in cydir sdbox mdbox maildir mbox; do |
124 |
use ${storage} && storages="${storage} ${storages}" |
125 |
done |
126 |
[ "${storages}" ] || storages="maildir" |
127 |
|
128 |
# turn valgrind tests off. Bug #340791 |
129 |
VALGRIND=no econf \ |
130 |
--localstatedir="${EPREFIX}/var" \ |
131 |
--with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \ |
132 |
$( use_with bzip2 bzlib ) \ |
133 |
$( use_with caps libcap ) \ |
134 |
$( use_with kerberos gssapi ) \ |
135 |
$( use_with ldap ) \ |
136 |
$( use_with mysql ) \ |
137 |
$( use_with pam ) \ |
138 |
$( use_with postgres pgsql ) \ |
139 |
$( use_with sqlite ) \ |
140 |
$( use_with ssl ) \ |
141 |
$( use_with vpopmail ) \ |
142 |
$( use_with zlib ) \ |
143 |
--with-storages="${storages}" \ |
144 |
--disable-rpath \ |
145 |
--without-systemdsystemunitdir \ |
146 |
${conf} |
147 |
|
148 |
if use sieve || use managesieve ; then |
149 |
# The sieve plugin needs this file to be build to determine the plugin |
150 |
# directory and the list of libraries to link to. |
151 |
emake dovecot-config || die "emake dovecot-config failed" |
152 |
cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
153 |
econf \ |
154 |
--localstatedir="${EPREFIX}/var" \ |
155 |
--enable-shared \ |
156 |
--with-dovecot="../${MY_P}" \ |
157 |
$( use_with managesieve ) |
158 |
fi |
159 |
} |
160 |
|
161 |
src_compile() { |
162 |
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed" |
163 |
|
164 |
if use sieve || use managesieve ; then |
165 |
cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
166 |
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make sieve failed" |
167 |
fi |
168 |
} |
169 |
|
170 |
src_test() { |
171 |
default_src_test |
172 |
if use sieve || use managesieve ; then |
173 |
cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
174 |
default_src_test |
175 |
fi |
176 |
} |
177 |
|
178 |
src_install () { |
179 |
emake DESTDIR="${ED}" install || die "make install failed" |
180 |
|
181 |
# insecure: |
182 |
# use suid && fperms u+s /usr/libexec/dovecot/deliver |
183 |
# better: |
184 |
if use suid;then |
185 |
einfo "Changing perms to allow deliver to be suided" |
186 |
fowners root:mail "${ED}"/usr/libexec/dovecot/deliver |
187 |
fperms 4750 "${ED}"/usr/libexec/dovecot/deliver |
188 |
fi |
189 |
|
190 |
newinitd "${FILESDIR}"/dovecot.init-r2 dovecot |
191 |
|
192 |
rm -rf "${ED}"/usr/share/doc/dovecot |
193 |
|
194 |
dodoc AUTHORS NEWS README TODO || die "basic dodoc failed" |
195 |
dodoc doc/*.{txt,cnf,xml,sh} || die "dodoc doc failed" |
196 |
docinto example-config |
197 |
dodoc doc/example-config/*.{conf,ext} || die "dodoc example failed" |
198 |
docinto example-config/conf.d |
199 |
dodoc doc/example-config/conf.d/*.{conf,ext} || die "dodoc conf.d failed" |
200 |
docinto wiki |
201 |
dodoc doc/wiki/* || die "dodoc wiki failed" |
202 |
doman doc/man/*.{1,7} |
203 |
|
204 |
# Create the dovecot.conf file from the dovecot-example.conf file that |
205 |
# the dovecot folks nicely left for us.... |
206 |
local conf="${ED}/etc/dovecot/dovecot.conf" |
207 |
local confd="${ED}/etc/dovecot/conf.d" |
208 |
|
209 |
insinto /etc/dovecot |
210 |
doins doc/example-config/*.{conf,ext} |
211 |
insinto /etc/dovecot/conf.d |
212 |
doins doc/example-config/conf.d/*.{conf,ext} |
213 |
fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext |
214 |
sed -i -e "s:/usr/share/doc/dovecot/:/usr/share/doc/${PF}/:" \ |
215 |
"${confd}/../README" || die "sed failed" |
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 sdbox ; then |
226 |
mail_location="sdbox:~/.sdbox" |
227 |
elif use mdbox ; then |
228 |
mail_location="mdbox:~/.mdbox" |
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 || die "make install failed (sieve)" |
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 |
|
308 |
pkg_preinst() { |
309 |
if has_version "<${CATEGORY}/${PN}-2" ; then |
310 |
elog "There are a lot of changes in configuration files in dovecot-2.0." |
311 |
elog "Please read http://wiki.dovecot.org/Upgrading and" |
312 |
elog "check the conf files in ${ROOT}etc/dovecot." |
313 |
elog "You can also run doveconf -n before running etc-update or" |
314 |
elog "dispatch-conf to get an idea about what needs to be changed." |
315 |
ewarn "\nDo NOT {re}start dovecot without checking your conf files" |
316 |
ewarn "and making the necessary changes.\n" |
317 |
fi |
318 |
} |
319 |
|
320 |
pkg_postinst() { |
321 |
if use ssl; then |
322 |
# Let's not make a new certificate if we already have one |
323 |
if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \ |
324 |
-e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then |
325 |
einfo "Creating SSL certificate" |
326 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}" |
327 |
install_cert /etc/ssl/dovecot/server |
328 |
fi |
329 |
fi |
330 |
} |