1 |
commit: 0db8a6d79a3476eb5d50ba98709b7a70af213439 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 20 12:38:00 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 24 10:29:39 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0db8a6d7 |
7 |
|
8 |
net-mail/dovecot: Use acct-group/mail |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
net-mail/dovecot/dovecot-2.3.6-r1.ebuild | 291 +++++++++++++++++++++++++++++++ |
13 |
1 file changed, 291 insertions(+) |
14 |
|
15 |
diff --git a/net-mail/dovecot/dovecot-2.3.6-r1.ebuild b/net-mail/dovecot/dovecot-2.3.6-r1.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..20f2b5332e0 |
18 |
--- /dev/null |
19 |
+++ b/net-mail/dovecot/dovecot-2.3.6-r1.ebuild |
20 |
@@ -0,0 +1,291 @@ |
21 |
+# Copyright 1999-2019 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=6 |
25 |
+ |
26 |
+# do not add a ssl USE flag. ssl is mandatory |
27 |
+SSL_DEPS_SKIP=1 |
28 |
+inherit autotools eapi7-ver ssl-cert systemd user |
29 |
+ |
30 |
+MY_P="${P/_/.}" |
31 |
+#MY_S="${PN}-ce-${PV}" |
32 |
+major_minor="$(ver_cut 1-2)" |
33 |
+sieve_version="0.5.6" |
34 |
+if [[ ${PV} == *_rc* ]] ; then |
35 |
+ rc_dir="rc/" |
36 |
+else |
37 |
+ rc_dir="" |
38 |
+fi |
39 |
+SRC_URI="https://dovecot.org/releases/${major_minor}/${rc_dir}${MY_P}.tar.gz |
40 |
+ sieve? ( |
41 |
+ https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
42 |
+ ) |
43 |
+ managesieve? ( |
44 |
+ https://pigeonhole.dovecot.org/releases/${major_minor}/${rc_dir}${PN}-${major_minor}-pigeonhole-${sieve_version}.tar.gz |
45 |
+ ) " |
46 |
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind" |
47 |
+HOMEPAGE="https://www.dovecot.org/" |
48 |
+ |
49 |
+SLOT="0" |
50 |
+LICENSE="LGPL-2.1 MIT" |
51 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" |
52 |
+ |
53 |
+IUSE_DOVECOT_AUTH="kerberos ldap lua mysql pam postgres sqlite vpopmail" |
54 |
+IUSE_DOVECOT_COMPRESS="bzip2 lzma lz4 zlib" |
55 |
+IUSE_DOVECOT_OTHER="argon2 caps doc ipv6 libressl lucene managesieve selinux sieve solr static-libs suid tcpd textcat" |
56 |
+ |
57 |
+IUSE="${IUSE_DOVECOT_AUTH} ${IUSE_DOVECOT_STORAGE} ${IUSE_DOVECOT_COMPRESS} ${IUSE_DOVECOT_OTHER}" |
58 |
+ |
59 |
+DEPEND="argon2? ( dev-libs/libsodium ) |
60 |
+ bzip2? ( app-arch/bzip2 ) |
61 |
+ caps? ( sys-libs/libcap ) |
62 |
+ kerberos? ( virtual/krb5 ) |
63 |
+ ldap? ( net-nds/openldap ) |
64 |
+ lua? ( dev-lang/lua:* ) |
65 |
+ lucene? ( >=dev-cpp/clucene-2.3 ) |
66 |
+ lzma? ( app-arch/xz-utils ) |
67 |
+ lz4? ( app-arch/lz4 ) |
68 |
+ mysql? ( dev-db/mysql-connector-c:0= ) |
69 |
+ pam? ( virtual/pam ) |
70 |
+ postgres? ( dev-db/postgresql:* !dev-db/postgresql[ldap,threads] ) |
71 |
+ selinux? ( sec-policy/selinux-dovecot ) |
72 |
+ solr? ( net-misc/curl dev-libs/expat ) |
73 |
+ sqlite? ( dev-db/sqlite:* ) |
74 |
+ !libressl? ( dev-libs/openssl:0 ) |
75 |
+ libressl? ( dev-libs/libressl ) |
76 |
+ suid? ( acct-group/mail ) |
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 |
+PATCHES=( |
88 |
+ "${FILESDIR}/${PN}-userdb-passwd-fix.patch" |
89 |
+) |
90 |
+ |
91 |
+pkg_setup() { |
92 |
+ if use managesieve && ! use sieve; then |
93 |
+ ewarn "managesieve USE flag selected but sieve USE flag unselected" |
94 |
+ ewarn "sieve USE flag will be turned on" |
95 |
+ fi |
96 |
+ # default internal user |
97 |
+ enewgroup dovecot 97 |
98 |
+ enewuser dovecot 97 -1 /dev/null dovecot |
99 |
+ # default login user |
100 |
+ enewuser dovenull -1 -1 /dev/null |
101 |
+} |
102 |
+ |
103 |
+src_prepare() { |
104 |
+ default |
105 |
+ # bug 657108 |
106 |
+ elibtoolize |
107 |
+ #eautoreconf |
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 |
+ # turn valgrind tests off. Bug #340791 |
118 |
+ VALGRIND=no econf \ |
119 |
+ --with-rundir="${EPREFIX}/run/dovecot" \ |
120 |
+ --with-statedir="${EPREFIX}/var/lib/dovecot" \ |
121 |
+ --with-moduledir="${EPREFIX}/usr/$(get_libdir)/dovecot" \ |
122 |
+ --without-stemmer \ |
123 |
+ --disable-rpath \ |
124 |
+ --without-libbsd \ |
125 |
+ --with-icu \ |
126 |
+ --with-ssl \ |
127 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \ |
128 |
+ $( use_with argon2 sodium ) \ |
129 |
+ $( use_with bzip2 bzlib ) \ |
130 |
+ $( use_with caps libcap ) \ |
131 |
+ $( use_with kerberos gssapi ) \ |
132 |
+ $( use_with lua ) \ |
133 |
+ $( use_with ldap ) \ |
134 |
+ $( use_with lucene ) \ |
135 |
+ $( use_with lz4 ) \ |
136 |
+ $( use_with lzma ) \ |
137 |
+ $( use_with mysql ) \ |
138 |
+ $( use_with pam ) \ |
139 |
+ $( use_with postgres pgsql ) \ |
140 |
+ $( use_with sqlite ) \ |
141 |
+ $( use_with solr ) \ |
142 |
+ $( use_with tcpd libwrap ) \ |
143 |
+ $( use_with textcat ) \ |
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="${S}" \ |
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-r6 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 |
+ sed -i -e \ |
220 |
+ "s|#mail_location =|mail_location = ${mail_location}|" \ |
221 |
+ "${confd}/10-mail.conf" \ |
222 |
+ || die "failed to update mail location settings in 10-mail.conf" |
223 |
+ |
224 |
+ # We're using pam files (imap and pop3) provided by mailbase |
225 |
+ if use pam; then |
226 |
+ sed -i -e '/driver = pam/,/^[ \t]*}/ s|#args = dovecot|args = "\*"|' \ |
227 |
+ "${confd}/auth-system.conf.ext" \ |
228 |
+ || die "failed to update PAM settings in auth-system.conf.ext" |
229 |
+ # mailbase does not provide a sieve pam file |
230 |
+ use managesieve && dosym imap /etc/pam.d/sieve |
231 |
+ sed -i -e \ |
232 |
+ 's/#!include auth-system.conf.ext/!include auth-system.conf.ext/' \ |
233 |
+ "${confd}/10-auth.conf" \ |
234 |
+ || die "failed to update PAM settings in 10-auth.conf" |
235 |
+ fi |
236 |
+ |
237 |
+ # Disable ipv6 if necessary |
238 |
+ if ! use ipv6; then |
239 |
+ sed -i -e 's/^#listen = \*, ::/listen = \*/g' "${conf}" \ |
240 |
+ || die "failed to update listen settings in dovecot.conf" |
241 |
+ fi |
242 |
+ |
243 |
+ # Update ssl cert locations |
244 |
+ sed -i -e 's:^#ssl = yes:ssl = yes:' "${confd}/10-ssl.conf" \ |
245 |
+ || die "ssl conf failed" |
246 |
+ sed -i -e 's:^ssl_cert =.*:ssl_cert = </etc/ssl/dovecot/server.pem:' \ |
247 |
+ -e 's:^ssl_key =.*:ssl_key = </etc/ssl/dovecot/server.key:' \ |
248 |
+ "${confd}/10-ssl.conf" || die "failed to update SSL settings in 10-ssl.conf" |
249 |
+ |
250 |
+ # Install SQL configuration |
251 |
+ if use mysql || use postgres; then |
252 |
+ sed -i -e \ |
253 |
+ 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/' \ |
254 |
+ "${confd}/10-auth.conf" || die "failed to update SQL settings in \ |
255 |
+ 10-auth.conf" |
256 |
+ fi |
257 |
+ |
258 |
+ # Install LDAP configuration |
259 |
+ if use ldap; then |
260 |
+ sed -i -e \ |
261 |
+ 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' \ |
262 |
+ "${confd}/10-auth.conf" \ |
263 |
+ || die "failed to update ldap settings in 10-auth.conf" |
264 |
+ fi |
265 |
+ |
266 |
+ if use vpopmail; then |
267 |
+ sed -i -e \ |
268 |
+ 's/#!include auth-vpopmail.conf.ext/!include auth-vpopmail.conf.ext/' \ |
269 |
+ "${confd}/10-auth.conf" \ |
270 |
+ || die "failed to update vpopmail settings in 10-auth.conf" |
271 |
+ fi |
272 |
+ |
273 |
+ if use sieve || use managesieve ; then |
274 |
+ cd "../dovecot-${major_minor}-pigeonhole-${sieve_version}" || die "cd failed" |
275 |
+ emake DESTDIR="${ED}" install |
276 |
+ sed -i -e \ |
277 |
+ 's/^[[:space:]]*#mail_plugins = $mail_plugins/mail_plugins = sieve/' "${confd}/15-lda.conf" \ |
278 |
+ || die "failed to update sieve settings in 15-lda.conf" |
279 |
+ rm -rf "${ED}"/usr/share/doc/dovecot |
280 |
+ docinto example-config/conf.d |
281 |
+ dodoc doc/example-config/conf.d/*.conf |
282 |
+ insinto /etc/dovecot/conf.d |
283 |
+ doins doc/example-config/conf.d/90-sieve{,-extprograms}.conf |
284 |
+ use managesieve && doins doc/example-config/conf.d/20-managesieve.conf |
285 |
+ docinto sieve/rfc |
286 |
+ dodoc doc/rfc/*.txt |
287 |
+ docinto sieve/devel |
288 |
+ dodoc doc/devel/DESIGN |
289 |
+ docinto plugins |
290 |
+ dodoc doc/plugins/*.txt |
291 |
+ docinto extensions |
292 |
+ dodoc doc/extensions/*.txt |
293 |
+ docinto locations |
294 |
+ dodoc doc/locations/*.txt |
295 |
+ doman doc/man/*.{1,7} |
296 |
+ fi |
297 |
+ |
298 |
+ use static-libs || find "${ED}"/usr/lib* -name '*.la' -delete |
299 |
+} |
300 |
+ |
301 |
+pkg_postinst() { |
302 |
+ # Let's not make a new certificate if we already have one |
303 |
+ if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \ |
304 |
+ -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then |
305 |
+ einfo "Creating SSL certificate" |
306 |
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}" |
307 |
+ install_cert /etc/ssl/dovecot/server |
308 |
+ fi |
309 |
+ |
310 |
+ elog "Please read http://wiki2.dovecot.org/Upgrading/ for upgrade notes." |
311 |
+} |