1 |
commit: eb98f47c62a9e04bb0ac97d8c3d8cd6df38fbd1f |
2 |
Author: Eray Aslan <eras <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 30 09:35:06 2015 +0000 |
4 |
Commit: Eray Aslan <eras <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 30 09:35:06 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb98f47c |
7 |
|
8 |
net-mail/dovecot: fix automagic libexttextcat dependency |
9 |
|
10 |
Gentoo-Bug: 563998 |
11 |
|
12 |
Package-Manager: portage-2.2.23 |
13 |
|
14 |
net-mail/dovecot/dovecot-2.2.19-r1.ebuild | 308 ++++++++++++++++++++++++++++++ |
15 |
net-mail/dovecot/metadata.xml | 1 + |
16 |
2 files changed, 309 insertions(+) |
17 |
|
18 |
diff --git a/net-mail/dovecot/dovecot-2.2.19-r1.ebuild b/net-mail/dovecot/dovecot-2.2.19-r1.ebuild |
19 |
new file mode 100644 |
20 |
index 0000000..0d1ca87 |
21 |
--- /dev/null |
22 |
+++ b/net-mail/dovecot/dovecot-2.2.19-r1.ebuild |
23 |
@@ -0,0 +1,308 @@ |
24 |
+# Copyright 1999-2015 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+# $Id$ |
27 |
+ |
28 |
+EAPI=5 |
29 |
+inherit eutils multilib ssl-cert systemd user versionator |
30 |
+ |
31 |
+MY_P="${P/_/.}" |
32 |
+major_minor="$(get_version_component_range 1-2)" |
33 |
+sieve_version="0.4.9" |
34 |
+if [[ ${PV} == *_rc* ]] ; then |
35 |
+ rc_dir="rc/" |
36 |
+else |
37 |
+ rc_dir="" |
38 |
+fi |
39 |
+SRC_URI="http://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz |
40 |
+ sieve? ( |
41 |
+ http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
42 |
+ ) |
43 |
+ managesieve? ( |
44 |
+ http://pigeonhole.dovecot.org/releases/${major_minor}/${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
45 |
+ ) " |
46 |
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind" |
47 |
+HOMEPAGE="http://www.dovecot.org/" |
48 |
+ |
49 |
+SLOT="0" |
50 |
+LICENSE="LGPL-2.1 MIT" |
51 |
+KEYWORDS="~amd64 ~arm ~ppc ~x86" |
52 |
+ |
53 |
+IUSE_DOVECOT_AUTH="kerberos ldap mysql pam postgres sqlite vpopmail" |
54 |
+IUSE_DOVECOT_STORAGE="cydir imapc +maildir mbox mdbox pop3c sdbox" |
55 |
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib" |
56 |
+IUSE_DOVECOT_OTHER="caps doc ipv6 libressl lucene managesieve selinux sieve solr +ssl static-libs suid tcpd textcat" |
57 |
+ |
58 |
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}" |
59 |
+ |
60 |
+DEPEND="bzip2? ( app-arch/bzip2 ) |
61 |
+ caps? ( sys-libs/libcap ) |
62 |
+ kerberos? ( virtual/krb5 ) |
63 |
+ ldap? ( net-nds/openldap ) |
64 |
+ lucene? ( >=dev-cpp/clucene-2.3 ) |
65 |
+ lzma? ( app-arch/xz-utils ) |
66 |
+ lz4? ( app-arch/lz4 ) |
67 |
+ mysql? ( virtual/mysql ) |
68 |
+ pam? ( virtual/pam ) |
69 |
+ postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] ) |
70 |
+ selinux? ( sec-policy/selinux-dovecot ) |
71 |
+ solr? ( net-misc/curl dev-libs/expat ) |
72 |
+ sqlite? ( dev-db/sqlite:* ) |
73 |
+ ssl? ( |
74 |
+ !libressl? ( dev-libs/openssl:0 ) |
75 |
+ libressl? ( dev-libs/libressl ) |
76 |
+ ) |
77 |
+ tcpd? ( sys-apps/tcp-wrappers ) |
78 |
+ textcat? ( app-text/libexttextcat ) |
79 |
+ vpopmail? ( net-mail/vpopmail ) |
80 |
+ zlib? ( sys-libs/zlib ) |
81 |
+ virtual/libiconv |
82 |
+ dev-libs/icu:=" |
83 |
+ |
84 |
+RDEPEND="${DEPEND} |
85 |
+ net-mail/mailbase" |
86 |
+ |
87 |
+S=${WORKDIR}/${MY_P} |
88 |
+ |
89 |
+pkg_setup() { |
90 |
+ if use managesieve && ! use sieve; then |
91 |
+ ewarn "managesieve USE flag selected but sieve USE flag unselected" |
92 |
+ ewarn "sieve USE flag will be turned on" |
93 |
+ fi |
94 |
+ # default internal user |
95 |
+ enewgroup dovecot 97 |
96 |
+ enewuser dovecot 97 -1 /dev/null dovecot |
97 |
+ # default login user |
98 |
+ enewuser dovenull -1 -1 /dev/null |
99 |
+ # add "mail" group for suid'ing. Better security isolation. |
100 |
+ if use suid; then |
101 |
+ enewgroup mail |
102 |
+ fi |
103 |
+} |
104 |
+ |
105 |
+src_prepare() { |
106 |
+ epatch "${FILESDIR}/${PN}-10-ssl.patch" |
107 |
+ epatch_user |
108 |
+} |
109 |
+ |
110 |
+src_configure() { |
111 |
+ local conf="" |
112 |
+ |
113 |
+ if use postgres || use mysql || use sqlite; then |
114 |
+ conf="${conf} --with-sql" |
115 |
+ fi |
116 |
+ |
117 |
+ local storages="" |
118 |
+ for storage in ${IUSE_DOVECOT_STORAGE//+/}; do |
119 |
+ use ${storage} && storages="${storage} ${storages}" |
120 |
+ done |
121 |
+ [ "${storages}" ] || storages="maildir" |
122 |
+ |
123 |
+ # turn valgrind tests off. Bug #340791 |
124 |
+ VALGRIND=no econf \ |
125 |
+ --localstatedir="${EPREFIX}/var" \ |
126 |
+ --runstatedir="${EPREFIX}/run" \ |
127 |
+ --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \ |
128 |
+ --without-stemmer \ |
129 |
+ --with-storages="${storages}" \ |
130 |
+ --disable-rpath \ |
131 |
+ --with-icu \ |
132 |
+ $( systemd_with_unitdir ) \ |
133 |
+ $( use_with bzip2 bzlib ) \ |
134 |
+ $( use_with caps libcap ) \ |
135 |
+ $( use_with kerberos gssapi ) \ |
136 |
+ $( use_with ldap ) \ |
137 |
+ $( use_with lucene ) \ |
138 |
+ $( use_with lz4 ) \ |
139 |
+ $( use_with lzma ) \ |
140 |
+ $( use_with mysql ) \ |
141 |
+ $( use_with pam ) \ |
142 |
+ $( use_with postgres pgsql ) \ |
143 |
+ $( use_with sqlite ) \ |
144 |
+ $( use_with solr ) \ |
145 |
+ $( use_with ssl ) \ |
146 |
+ $( use_with tcpd libwrap ) \ |
147 |
+ $( use_with textcat ) \ |
148 |
+ $( use_with vpopmail ) \ |
149 |
+ $( use_with zlib ) \ |
150 |
+ $( use_enable static-libs static ) \ |
151 |
+ ${conf} |
152 |
+ |
153 |
+ if use sieve || use managesieve ; then |
154 |
+ # The sieve plugin needs this file to be build to determine the plugin |
155 |
+ # directory and the list of libraries to link to. |
156 |
+ emake dovecot-config |
157 |
+ cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
158 |
+ econf \ |
159 |
+ $( use_enable static-libs static ) \ |
160 |
+ --localstatedir="${EPREFIX}/var" \ |
161 |
+ --enable-shared \ |
162 |
+ --with-dovecot="../${MY_P}" \ |
163 |
+ $( use_with managesieve ) |
164 |
+ fi |
165 |
+} |
166 |
+ |
167 |
+src_compile() { |
168 |
+ default |
169 |
+ if use sieve || use managesieve ; then |
170 |
+ cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
171 |
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" |
172 |
+ fi |
173 |
+} |
174 |
+ |
175 |
+src_test() { |
176 |
+ default |
177 |
+ if use sieve || use managesieve ; then |
178 |
+ cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
179 |
+ default |
180 |
+ fi |
181 |
+} |
182 |
+ |
183 |
+src_install () { |
184 |
+ default |
185 |
+ |
186 |
+ # insecure: |
187 |
+ # use suid && fperms u+s /usr/libexec/dovecot/deliver |
188 |
+ # better: |
189 |
+ if use suid;then |
190 |
+ einfo "Changing perms to allow deliver to be suided" |
191 |
+ fowners root:mail "${EPREFIX}/usr/libexec/dovecot/dovecot-lda" |
192 |
+ fperms 4750 "${EPREFIX}/usr/libexec/dovecot/dovecot-lda" |
193 |
+ fi |
194 |
+ |
195 |
+ newinitd "${FILESDIR}"/dovecot.init-r4 dovecot |
196 |
+ |
197 |
+ rm -rf "${ED}"/usr/share/doc/dovecot |
198 |
+ |
199 |
+ dodoc AUTHORS NEWS README TODO |
200 |
+ dodoc doc/*.{txt,cnf,xml,sh} |
201 |
+ docinto example-config |
202 |
+ dodoc doc/example-config/*.{conf,ext} |
203 |
+ docinto example-config/conf.d |
204 |
+ dodoc doc/example-config/conf.d/*.{conf,ext} |
205 |
+ docinto wiki |
206 |
+ dodoc doc/wiki/* |
207 |
+ doman doc/man/*.{1,7} |
208 |
+ |
209 |
+ # Create the dovecot.conf file from the dovecot-example.conf file that |
210 |
+ # the dovecot folks nicely left for us.... |
211 |
+ local conf="${ED}/etc/dovecot/dovecot.conf" |
212 |
+ local confd="${ED}/etc/dovecot/conf.d" |
213 |
+ |
214 |
+ insinto /etc/dovecot |
215 |
+ doins doc/example-config/*.{conf,ext} |
216 |
+ insinto /etc/dovecot/conf.d |
217 |
+ doins doc/example-config/conf.d/*.{conf,ext} |
218 |
+ fperms 0600 "${EPREFIX}"/etc/dovecot/dovecot-{ldap,sql}.conf.ext |
219 |
+ rm -f "${confd}/../README" |
220 |
+ |
221 |
+ # .maildir is the Gentoo default |
222 |
+ local mail_location="maildir:~/.maildir" |
223 |
+ if ! use maildir; then |
224 |
+ if use mbox; then |
225 |
+ mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u" |
226 |
+ keepdir /var/dovecot |
227 |
+ sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' \ |
228 |
+ "${confd}/10-mail.conf" || die "sed failed" |
229 |
+ elif use mdbox ; then |
230 |
+ mail_location="mdbox:~/.mdbox" |
231 |
+ elif use sdbox ; then |
232 |
+ mail_location="sdbox:~/.sdbox" |
233 |
+ fi |
234 |
+ fi |
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 |
+ if use ssl; then |
261 |
+ sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \ |
262 |
+ || die "ssl conf failed" |
263 |
+ sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \ |
264 |
+ -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \ |
265 |
+ "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf" |
266 |
+ fi |
267 |
+ |
268 |
+ # Install SQL configuration |
269 |
+ if use mysql || use postgres; then |
270 |
+ sed -i -e \ |
271 |
+ 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \ |
272 |
+ "${confd}/10-auth.conf" || die "failed to update SQL settings in \ |
273 |
+ 10-auth.conf" |
274 |
+ fi |
275 |
+ |
276 |
+ # Install LDAP configuration |
277 |
+ if use ldap; then |
278 |
+ sed -i -e \ |
279 |
+ 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \ |
280 |
+ "${confd}/10-auth.conf" \ |
281 |
+ || die "failed to update ldap settings in 10-auth.conf" |
282 |
+ fi |
283 |
+ |
284 |
+ if use vpopmail; then |
285 |
+ sed -i -e \ |
286 |
+ 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \ |
287 |
+ "${confd}/10-auth.conf" \ |
288 |
+ || die "failed to update vpopmail settings in 10-auth.conf" |
289 |
+ fi |
290 |
+ |
291 |
+ if use sieve || use managesieve ; then |
292 |
+ cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
293 |
+ emake DESTDIR="${ED}" install |
294 |
+ sed -i -e \ |
295 |
+ 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \ |
296 |
+ || die "failed to update sieve settings in 15-lda.conf" |
297 |
+ rm -rf "${ED}"/usr/share/doc/dovecot |
298 |
+ docinto example-config/conf.d |
299 |
+ dodoc doc/example-config/conf.d/*.conf |
300 |
+ insinto /etc/dovecot/conf.d |
301 |
+ doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf |
302 |
+ use managesieve && doins doc/example-config/conf.d/20-managesieve.conf |
303 |
+ docinto sieve/rfc |
304 |
+ dodoc doc/rfc/*.txt |
305 |
+ docinto sieve/devel |
306 |
+ dodoc doc/devel/DESIGN |
307 |
+ docinto plugins |
308 |
+ dodoc doc/plugins/*.txt |
309 |
+ docinto extensions |
310 |
+ dodoc doc/extensions/*.txt |
311 |
+ docinto locations |
312 |
+ dodoc doc/locations/*.txt |
313 |
+ doman doc/man/*.{1,7} |
314 |
+ fi |
315 |
+ |
316 |
+ use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete |
317 |
+} |
318 |
+ |
319 |
+pkg_postinst() { |
320 |
+ if use ssl; then |
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 |
+ fi |
329 |
+ |
330 |
+ elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes." |
331 |
+} |
332 |
|
333 |
diff --git a/net-mail/dovecot/metadata.xml b/net-mail/dovecot/metadata.xml |
334 |
index 8c79919..d42dc8d 100644 |
335 |
--- a/net-mail/dovecot/metadata.xml |
336 |
+++ b/net-mail/dovecot/metadata.xml |
337 |
@@ -19,5 +19,6 @@ |
338 |
<flag name="lzma">Add support for lzma (de)compression</flag> |
339 |
<flag name="lz4">Add support for lz4 (de)compression</flag> |
340 |
<flag name="solr">Add solr full text search (FTS) support</flag> |
341 |
+ <flag name="textcat">Add libtextcat language guessing support for full text search (FTS)</flag> |
342 |
</use> |
343 |
</pkgmetadata> |