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: Fri, 17 Sep 2021 05:44:51
Message-Id: 1631857362.0140456685343d85704fd8f4fa6a2530df4cffbb.eras@gentoo
1 commit: 0140456685343d85704fd8f4fa6a2530df4cffbb
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 17 05:42:42 2021 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 17 05:42:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01404566
7
8 net-mail/dovecot: add stemmer USE flag
9
10 Package-Manager: Portage-3.0.23, Repoman-3.0.3
11 Signed-off-by: Eray Aslan <eras <AT> gentoo.org>
12
13 net-mail/dovecot/dovecot-2.3.16-r1.ebuild | 307 ++++++++++++++++++++++++++++++
14 net-mail/dovecot/metadata.xml | 1 +
15 2 files changed, 308 insertions(+)
16
17 diff --git a/net-mail/dovecot/dovecot-2.3.16-r1.ebuild b/net-mail/dovecot/dovecot-2.3.16-r1.ebuild
18 new file mode 100644
19 index 00000000000..944c319e573
20 --- /dev/null
21 +++ b/net-mail/dovecot/dovecot-2.3.16-r1.ebuild
22 @@ -0,0 +1,307 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=8
27 +
28 +LUA_COMPAT=( lua5-1 lua5-3 )
29 +# do not add a ssl USE flag. ssl is mandatory
30 +SSL_DEPS_SKIP=1
31 +inherit autotools flag-o-matic lua-single ssl-cert systemd toolchain-funcs
32 +
33 +MY_P="${P/_/.}"
34 +#MY_S="${PN}-ce-${PV}"
35 +major_minor="$(ver_cut 1-2)"
36 +sieve_version="0.5.16"
37 +if [[ ${PV} == *_rc* ]]; then
38 + rc_dir="rc/"
39 +else
40 + rc_dir=""
41 +fi
42 +SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz
43 + sieve? (
44 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
45 + )
46 + managesieve? (
47 + https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz
48 + ) "
49 +DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
50 +HOMEPAGE="https://www.dovecot.org/"
51 +
52 +SLOT="0"
53 +LICENSE="LGPL-2.1 MIT"
54 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
55 +
56 +IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite"
57 +IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib zstd"
58 +IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 lucene managesieve rpc
59 + selinux sieve solr static-libs stemmer suid systemd tcpd textcat unwind"
60 +
61 +IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}"
62 +
63 +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
64 +
65 +DEPEND="
66 + dev-libs/icu:=
67 + dev-libs/openssl:0=
68 + virtual/libiconv
69 + argon2? ( dev-libs/libsodium:= )
70 + bzip2? ( app-arch/bzip2 )
71 + caps? ( sys-libs/libcap )
72 + kerberos? ( virtual/krb5 )
73 + ldap? ( net-nds/openldap )
74 + lua? ( ${LUA_DEPS} )
75 + lucene? ( >=dev-cpp/clucene-2.3 )
76 + lz4? ( app-arch/lz4 )
77 + lzma? ( app-arch/xz-utils )
78 + mysql? ( dev-db/mysql-connector-c:0= )
79 + pam? ( sys-libs/pam:= )
80 + postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] )
81 + rpc? ( net-libs/libtirpc:= net-libs/rpcsvc-proto )
82 + selinux? ( sec-policy/selinux-dovecot )
83 + solr? ( net-misc/curl dev-libs/expat )
84 + sqlite? ( dev-db/sqlite:* )
85 + stemmer? ( dev-libs/snowball-stemmer:= )
86 + suid? ( acct-group/mail )
87 + systemd? ( sys-apps/systemd:= )
88 + tcpd? ( sys-apps/tcp-wrappers )
89 + textcat? ( app-text/libexttextcat )
90 + unwind? ( sys-libs/libunwind:= )
91 + zlib? ( sys-libs/zlib:= )
92 + zstd? ( app-arch/zstd:= )
93 + virtual/libcrypt:=
94 + "
95 +
96 +RDEPEND="
97 + ${DEPEND}
98 + acct-group/dovecot
99 + acct-group/dovenull
100 + acct-user/dovecot
101 + acct-user/dovenull
102 + net-mail/mailbase
103 + "
104 +
105 +S="${WORKDIR}/${MY_P}"
106 +
107 +PATCHES=(
108 + "${FILESDIR}/${PN}"-autoconf-lua-version-v2.patch
109 + "${FILESDIR}/${PN}"-socket-name-too-long.patch
110 +)
111 +
112 +pkg_setup() {
113 + use lua && lua-single_pkg_setup
114 + if use managesieve && ! use sieve; then
115 + ewarn "managesieve USE flag selected but sieve USE flag unselected"
116 + ewarn "sieve USE flag will be turned on"
117 + fi
118 +}
119 +
120 +src_prepare() {
121 + default
122 + # bug 657108
123 + #elibtoolize
124 + eautoreconf
125 +
126 + # Bug #727244
127 + append-cflags -fasynchronous-unwind-tables
128 +}
129 +
130 +src_configure() {
131 + local conf=""
132 +
133 + if use postgres || use mysql || use sqlite; then
134 + conf="${conf} --with-sql"
135 + fi
136 +
137 + # turn valgrind tests off. Bug #340791
138 + VALGRIND=no \
139 + LUAPC="${ELUA}" \
140 + systemdsystemunitdir="$(systemd_get_systemunitdir)" \
141 + econf \
142 + --with-rundir="${EPREFIX}/run/dovecot" \
143 + --with-statedir="${EPREFIX}/var/lib/dovecot" \
144 + --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \
145 + --disable-rpath \
146 + --without-libbsd \
147 + --with-icu \
148 + --with-ssl \
149 + $( use_with argon2 sodium ) \
150 + $( use_with bzip2 bzlib ) \
151 + $( use_with caps libcap ) \
152 + $( use_with kerberos gssapi ) \
153 + $( use_with lua ) \
154 + $( use_with ldap ) \
155 + $( use_with lucene ) \
156 + $( use_with lz4 ) \
157 + $( use_with lzma ) \
158 + $( use_with mysql ) \
159 + $( use_with pam ) \
160 + $( use_with postgres pgsql ) \
161 + $( use_with sqlite ) \
162 + $( use_with solr ) \
163 + $( use_with stemmer ) \
164 + $( use_with systemd ) \
165 + $( use_with tcpd libwrap ) \
166 + $( use_with textcat ) \
167 + $( use_with unwind libunwind ) \
168 + $( use_with zlib ) \
169 + $( use_with zstd ) \
170 + $( use_enable static-libs static ) \
171 + ${conf}
172 +
173 + if use sieve || use managesieve; then
174 + # The sieve plugin needs this file to be build to determine the plugin
175 + # directory and the list of libraries to link to.
176 + emake dovecot-config
177 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
178 + econf \
179 + $( use_enable static-libs static ) \
180 + --localstatedir="${EPREFIX}/var" \
181 + --enable-shared \
182 + --with-dovecot="${S}" \
183 + $( use_with ldap ) \
184 + $( use_with managesieve )
185 + fi
186 +}
187 +
188 +src_compile() {
189 + default
190 + if use sieve || use managesieve; then
191 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
192 + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
193 + fi
194 +}
195 +
196 +src_test() {
197 + default
198 + if use sieve || use managesieve; then
199 + cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed"
200 + default
201 + fi
202 +}
203 +
204 +src_install() {
205 + default
206 +
207 + # insecure:
208 + # use suid && fperms u+s /usr/libexec/dovecot/deliver
209 + # better:
210 + if use suid; then
211 + einfo "Changing perms to allow deliver to be suided"
212 + fowners root:mail "/usr/libexec/dovecot/dovecot-lda"
213 + fperms 4750 "/usr/libexec/dovecot/dovecot-lda"
214 + fi
215 +
216 + newinitd "${FILESDIR}"/dovecot.init-r6 dovecot
217 +
218 + rm -rf "${ED}"/usr/share/doc/dovecot
219 +
220 + dodoc AUTHORS NEWS README TODO
221 + dodoc doc/*.{txt,cnf,xml,sh}
222 + docinto example-config
223 + dodoc doc/example-config/*.{conf,ext}
224 + docinto example-config/conf.d
225 + dodoc doc/example-config/conf.d/*.{conf,ext}
226 + docinto wiki
227 + dodoc doc/wiki/*
228 + doman doc/man/*.{1,7}
229 +
230 + # Create the dovecot.conf file from the dovecot-example.conf file that
231 + # the dovecot folks nicely left for us....
232 + local conf="${ED}/etc/dovecot/dovecot.conf"
233 + local confd="${ED}/etc/dovecot/conf.d"
234 +
235 + insinto /etc/dovecot
236 + doins doc/example-config/*.{conf,ext}
237 + insinto /etc/dovecot/conf.d
238 + doins doc/example-config/conf.d/*.{conf,ext}
239 + fperms 0600 /etc/dovecot/dovecot-{ldap,sql}.conf.ext
240 + rm -f "${confd}/../README"
241 +
242 + # .maildir is the Gentoo default
243 + local mail_location="maildir:~/.maildir"
244 + sed -i -e \
245 + "s|#mail_location =|mail_location = ${mail_location}|" \
246 + "${confd}/10-mail.conf" \
247 + || die "failed to update mail location settings in 10-mail.conf"
248 +
249 + # We're using pam files (imap and pop3) provided by mailbase
250 + if use pam; then
251 + sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
252 + "${confd}/auth-system.conf.ext" \
253 + || die "failed to update PAM settings in auth-system.conf.ext"
254 + # mailbase does not provide a sieve pam file
255 + use managesieve && dosym imap /etc/pam.d/sieve
256 + sed -i -e \
257 + 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \
258 + "${confd}/10-auth.conf" \
259 + || die "failed to update PAM settings in 10-auth.conf"
260 + fi
261 +
262 + # Disable ipv6 if necessary
263 + if ! use ipv6; then
264 + sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \
265 + || die "failed to update listen settings in dovecot.conf"
266 + fi
267 +
268 + # Update ssl cert locations
269 + sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \
270 + || die "ssl conf failed"
271 + sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \
272 + -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \
273 + "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf"
274 +
275 + # Install SQL configuration
276 + if use mysql || use postgres; then
277 + sed -i -e \
278 + 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \
279 + "${confd}/10-auth.conf" || die "failed to update SQL settings in \
280 + 10-auth.conf"
281 + fi
282 +
283 + # Install LDAP configuration
284 + if use ldap; then
285 + sed -i -e \
286 + 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \
287 + "${confd}/10-auth.conf" \
288 + || die "failed to update ldap 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 + # Let's not make a new certificate if we already have one
321 + if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
322 + -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
323 + einfo "Creating SSL certificate"
324 + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
325 + install_cert /etc/ssl/dovecot/server
326 + fi
327 +
328 + elog "Please read https://doc.dovecot.org/installation_guide/upgrading/ for upgrade notes."
329 +}
330
331 diff --git a/net-mail/dovecot/metadata.xml b/net-mail/dovecot/metadata.xml
332 index 13530f3e601..ad663f242b9 100644
333 --- a/net-mail/dovecot/metadata.xml
334 +++ b/net-mail/dovecot/metadata.xml
335 @@ -13,6 +13,7 @@
336 <flag name="lzma">Add support for lzma (de)compression</flag>
337 <flag name="rpc">Add support for NFS quotas</flag>
338 <flag name="solr">Add solr full text search (FTS) support</flag>
339 + <flag name="stemmer">Add libstemmer support (for FTS)</flag>
340 <flag name="textcat">Add libtextcat language guessing support for full text search (FTS)</flag>
341 <flag name="zstd">Add support for zstd (de)compression</flag>
342 </use>