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/cyrus-imapd/, net-mail/cyrus-imapd/files/
Date: Wed, 06 Sep 2017 12:26:44
Message-Id: 1504700794.b930b70fa5a5f5b011610d81c19a6fc5f761b84b.eras@gentoo
1 commit: b930b70fa5a5f5b011610d81c19a6fc5f761b84b
2 Author: Eray Aslan <eras <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 6 12:25:52 2017 +0000
4 Commit: Eray Aslan <eras <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 6 12:26:34 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b930b70f
7
8 net-mail/cyrus-imapd: version bump to 3.0.4
9
10 Also sync cyrus and imapd socket locations and have the socket directory
11 created during startup - bug 627804
12
13 Package-Manager: Portage-2.3.8, Repoman-2.3.3
14
15 net-mail/cyrus-imapd/Manifest | 1 +
16 net-mail/cyrus-imapd/cyrus-imapd-3.0.4.ebuild | 220 ++++++++++++++++++++++++++
17 net-mail/cyrus-imapd/files/cyrus.rc8 | 34 ++++
18 3 files changed, 255 insertions(+)
19
20 diff --git a/net-mail/cyrus-imapd/Manifest b/net-mail/cyrus-imapd/Manifest
21 index d64ddbe28af..da4c847f44e 100644
22 --- a/net-mail/cyrus-imapd/Manifest
23 +++ b/net-mail/cyrus-imapd/Manifest
24 @@ -1,3 +1,4 @@
25 DIST cyrus-imapd-2.5.10.tar.gz 3103914 SHA256 b38f4fd72825a298ac47426dcd2a50c8437c2947864ba50d79a9a53fe9845c5f SHA512 78b85e37c63f1dbb60898da229f70f45810326a01244067d23b1317e2c2ae3326e48b6944787d59024e44c48c441ed2b848d6a83c451c192a3bb95c8f37880fa WHIRLPOOL d2167900596c1b6f8e595de7aec499a7fbd6228537d7a27bec4fe0bda6a74b861303c4e9691ca829994972b099f29c362f9692f266df66d76c05a69629b52dfd
26 DIST cyrus-imapd-2.5.11.tar.gz 3109188 SHA256 36a79117b320c78d62bc6842c3024d970d3bec7aa12908f862d92cf1d63397d5 SHA512 bbb0e11f31d91d85037306321165e3608f8d5e2699b971fc4fbdd1630ec0a1485c8f6f17900142dec584ab41b0ec0c65c11cfaf8c5bbf1054b194a8f5f361538 WHIRLPOOL e6aaedb642b634d9fc0c56f7ddd06e15130091bd21f4e089ae46168fb2976c7e1fa281f8c6fc0f3e171e70bbfeb5cec8f6cc613f62d5b769fb8b6af4dede6e67
27 DIST cyrus-imapd-3.0.3.tar.gz 10819454 SHA256 6a76d8d00b26a2c9d03c65197724a28ab6d044527d7e230e6331f8de79af889a SHA512 0b5c3167d80d91371e3f07e64b8bc8c085481946e6536dd407976f6f8ae66405fd1f6d2ff5ad51e5e0eb827a64d90d93daf72d5a1afa409782a287bec29665df WHIRLPOOL 6d543b09d3f18d10c481133fafb78f82a6e2d0dd3fb7c4cdb1d181d906acef7db4c6da5dcc86254a836f69fc7cbd54034f889b0808da060a083f35dd8ee40434
28 +DIST cyrus-imapd-3.0.4.tar.gz 10819487 SHA256 ed17b4321bbe54df2c9b8832e189f52de4561f51e199f7c620216e79910c73a0 SHA512 9ceb7ac837c932c70fa0c1583bf8700b3ec27568d72538ae8d59f2f551e3007b3c2fc68fd29c009597c3949345dbe1bf2eb614bea038d70a5b49e5507df6b69a WHIRLPOOL a67a9d033ddb601608590f085f513a6f8b220cf5a0df786c68dcb642bb9f72018ca220ce8abdc57221aac81c60e3bddee7c8dd3ad8b1fb61ead8d653400f8b51
29
30 diff --git a/net-mail/cyrus-imapd/cyrus-imapd-3.0.4.ebuild b/net-mail/cyrus-imapd/cyrus-imapd-3.0.4.ebuild
31 new file mode 100644
32 index 00000000000..9b55bcb7b8f
33 --- /dev/null
34 +++ b/net-mail/cyrus-imapd/cyrus-imapd-3.0.4.ebuild
35 @@ -0,0 +1,220 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +inherit autotools pam ssl-cert user
41 +
42 +MY_P=${P/_/}
43 +
44 +DESCRIPTION="The Cyrus IMAP Server"
45 +HOMEPAGE="http://www.cyrusimap.org/"
46 +SRC_URI="ftp://ftp.cyrusimap.org/cyrus-imapd/${MY_P}.tar.gz"
47 +
48 +LICENSE="BSD-with-attribution"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
51 +IUSE="afs backup calalarm caps clamav http jmap kerberos ldap lmdb \
52 + mysql nntp pam perl postgres replication +server sieve snmp \
53 + sphinx sqlite ssl static-libs tcpd test xapian"
54 +
55 +# virtual/mysql-5.5 added for the --variable= option below
56 +CDEPEND="sys-libs/zlib
57 + dev-libs/libpcre
58 + >=dev-libs/cyrus-sasl-2.1.13
59 + dev-libs/jansson
60 + dev-libs/icu:=
61 + afs? ( net-fs/openafs )
62 + caps? ( sys-libs/libcap )
63 + clamav? ( app-antivirus/clamav )
64 + http? ( dev-libs/libxml2 dev-libs/libical )
65 + kerberos? ( virtual/krb5 )
66 + ldap? ( net-nds/openldap )
67 + lmdb? ( dev-db/lmdb )
68 + mysql? ( >=virtual/mysql-5.5 )
69 + nntp? ( !net-nntp/leafnode )
70 + pam? (
71 + virtual/pam
72 + >=net-mail/mailbase-1
73 + )
74 + perl? ( dev-lang/perl:= )
75 + postgres? ( dev-db/postgresql:* )
76 + snmp? ( >=net-analyzer/net-snmp-5.2.2-r1 )
77 + ssl? ( >=dev-libs/openssl-1.0.1e:0[-bindist] )
78 + sqlite? ( dev-db/sqlite:3 )
79 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 snmp? ( net-analyzer/net-snmp[tcpd=] ) )
80 + xapian? ( >=dev-libs/xapian-1.4.0 )"
81 +
82 +DEPEND="${CDEPEND}
83 + test? ( dev-util/cunit )"
84 +
85 +# all blockers really needed?
86 +RDEPEND="${CDEPEND}
87 + !mail-mta/courier
88 + !net-mail/bincimap
89 + !net-mail/courier-imap
90 + !net-mail/uw-imap
91 + !net-mail/cyrus-imap-admin"
92 +
93 +REQUIRED_USE="afs? ( kerberos )
94 + backup? ( sqlite )
95 + calalarm? ( http )
96 + http? ( sqlite )
97 + jmap? ( http xapian )
98 + sphinx? ( mysql )"
99 +
100 +S=${WORKDIR}/${MY_P}
101 +
102 +pkg_setup() {
103 + enewuser cyrus -1 -1 /usr/cyrus mail
104 +}
105 +
106 +src_prepare() {
107 + # bug 604470
108 + eapply -p1 "${FILESDIR}/${PN}-sieve-libs-v4.patch"
109 + eapply -p1 "${FILESDIR}/${PN}-libcap-libs.patch"
110 + eapply -p1 "${FILESDIR}/${PN}-fix-tests.patch"
111 + # Fix master(8)->cyrusmaster(8) manpage.
112 + for i in `grep -rl -e 'master\.8' -e 'master(8)' "${S}"` ; do
113 + sed -i -e 's:master\.8:cyrusmaster.8:g' \
114 + -e 's:master(8):cyrusmaster(8):g' \
115 + "${i}" || die "sed failed" || die "sed failed"
116 + done
117 + mv man/master.8 man/cyrusmaster.8 || die "mv failed"
118 + sed -i -e "s:MASTER:CYRUSMASTER:g" \
119 + -e "s:Master:Cyrusmaster:g" \
120 + -e "s:master:cyrusmaster:g" \
121 + man/cyrusmaster.8 || die "sed failed"
122 +
123 + # lock.h to afs/lock.h
124 + sed -i -e '/lock.h/s:lock.h:afs/lock.h:' \
125 + ptclient/afskrb.c || die
126 +
127 + eapply_user
128 + eautoreconf
129 +}
130 +
131 +src_configure() {
132 + local myconf
133 + if use afs ; then
134 + myconf+=" --with-afs-libdir=/usr/$(get_libdir)"
135 + myconf+=" --with-afs-incdir=/usr/include/afs"
136 + fi
137 + econf \
138 + --enable-unit-tests \
139 + --enable-murder \
140 + --enable-idled \
141 + --enable-event-notification \
142 + --enable-autocreate \
143 + --enable-pcre \
144 + --with-cyrus-user=cyrus \
145 + --with-cyrus-group=mail \
146 + --with-com_err=yes \
147 + --with-sasl \
148 + --without-krb \
149 + --without-krbdes \
150 + --enable-squat \
151 + --with-zlib \
152 + $(use_enable afs) \
153 + $(use_enable afs krb5afspts) \
154 + $(use_enable backup) \
155 + $(use_enable calalarm calalarmd) \
156 + $(use_with caps libcap) \
157 + $(use_with clamav) \
158 + $(use_enable jmap) \
159 + $(use_enable nntp) \
160 + $(use_enable http) \
161 + $(use_enable replication) \
162 + $(use_enable kerberos gssapi) \
163 + $(use_with ldap) \
164 + $(use_with lmdb) \
165 + $(use_with mysql) \
166 + $(use_with postgres pgsql) \
167 + $(use_with perl) \
168 + $(use_with sqlite) \
169 + $(use_with ssl openssl) \
170 + $(use_enable server) \
171 + $(use_enable sieve) \
172 + $(use_with snmp) \
173 + $(use_enable sphinx) \
174 + $(use_enable static-libs static) \
175 + $(use_with tcpd libwrap) \
176 + $(use_enable xapian) \
177 + ${myconf}
178 +}
179 +
180 +src_install() {
181 + emake DESTDIR="${D}" INSTALLDIRS=vendor install
182 +
183 + dodoc README*
184 + dodoc -r doc
185 + cp -r contrib tools "${D}/usr/share/doc/${PF}"
186 + rm -f doc/text/Makefile*
187 +
188 + mv "${D}"usr/libexec/{master,cyrusmaster} || die
189 +
190 + insinto /etc
191 + newins "${D}usr/share/doc/${PF}/doc/examples/cyrus_conf/normal.conf" cyrus.conf
192 + newins "${D}usr/share/doc/${PF}/doc/examples/imapd_conf/normal.conf" imapd.conf
193 +
194 + sed -i -e '/^configdirectory/s|/var/.*|/var/imap|' \
195 + -e '/^partition-default/s|/var/.*|/var/spool/imap|' \
196 + -e '/^sievedir/s|/var/.*|/var/imap/sieve|' \
197 + "${D}"etc/imapd.conf
198 +
199 + sed -i -e 's|/var/imap/socket/lmtp|/run/cyrus/socket/lmtp|' \
200 + -e 's|/var/imap/socket/notify|/run/cyrus/socket/notify|' \
201 + "${D}"etc/cyrus.conf
202 +
203 + # turn off sieve if not installed
204 + if ! use sieve; then
205 + sed -i -e "/sieve/s/^/#/" "${D}/etc/cyrus.conf" || die
206 + fi
207 + # same thing for http(s) as well
208 + if ! use http; then
209 + sed -i -e "/http/s/^/#/" "${D}/etc/cyrus.conf" || die
210 + fi
211 +
212 + newinitd "${FILESDIR}/cyrus.rc8" cyrus
213 + newconfd "${FILESDIR}/cyrus.confd" cyrus
214 + newpamd "${FILESDIR}/cyrus.pam-include" sieve
215 +
216 + for subdir in imap/{,db,log,msg,proc,socket,sieve} spool/imap/{,stage.} ; do
217 + keepdir "/var/${subdir}"
218 + fowners cyrus:mail "/var/${subdir}"
219 + fperms 0750 "/var/${subdir}"
220 + done
221 + for subdir in imap/{user,quota,sieve} spool/imap ; do
222 + for i in a b c d e f g h i j k l m n o p q r s t v u w x y z ; do
223 + keepdir "/var/${subdir}/${i}"
224 + fowners cyrus:mail "/var/${subdir}/${i}"
225 + fperms 0750 "/var/${subdir}/${i}"
226 + done
227 + done
228 +}
229 +
230 +pkg_preinst() {
231 + if ! has_version ${CATEGORY}/${PN} ; then
232 + elog "For correct logging add the following to /etc/syslog.conf:"
233 + elog " local6.* /var/log/imapd.log"
234 + elog " auth.debug /var/log/auth.log"
235 + echo
236 +
237 + elog "You have to add user cyrus to the sasldb2. Do this with:"
238 + elog " saslpasswd2 cyrus"
239 + fi
240 +}
241 +
242 +pkg_postinst() {
243 + # do not install server.{key,pem) if they exist
244 + if use ssl ; then
245 + if [ ! -f "${ROOT}"etc/ssl/cyrus/server.key ]; then
246 + install_cert /etc/ssl/cyrus/server
247 + chown cyrus:mail "${ROOT}"etc/ssl/cyrus/server.{key,pem}
248 + fi
249 + fi
250 +
251 + echo
252 + ewarn "Please see http://www.cyrusimap.org/imap/download/upgrade.html"
253 + ewarn "for upgrade instructions."
254 + echo
255 +}
256
257 diff --git a/net-mail/cyrus-imapd/files/cyrus.rc8 b/net-mail/cyrus-imapd/files/cyrus.rc8
258 new file mode 100644
259 index 00000000000..9d9e9452f56
260 --- /dev/null
261 +++ b/net-mail/cyrus-imapd/files/cyrus.rc8
262 @@ -0,0 +1,34 @@
263 +#!/sbin/openrc-run
264 +# Copyright 1999-2017 Gentoo Foundation
265 +# Distributed under the terms of the GNU General Public License v2
266 +
267 +depend() {
268 + use net
269 + use dns logger
270 + after drac saslauthd
271 +}
272 +
273 +checkdirs() {
274 + for dir in /run/cyrus/{,proc,lock,socket,sync}
275 + do
276 + checkpath -q -d -o cyrus:mail -m 0750 "${dir}" || {
277 + eerror "Failed to create directory at $dir"
278 + return 1
279 + }
280 + done
281 +}
282 +
283 +
284 +start() {
285 + checkdirs || return 1
286 + ebegin "Starting cyrus imapd"
287 + start-stop-daemon --start --quiet --background \
288 + --exec /usr/libexec/cyrusmaster -- ${CYRUS_OPTS}
289 + eend $?
290 +}
291 +
292 +stop() {
293 + ebegin "Stopping cyrus imapd"
294 + start-stop-daemon --stop --quiet --pidfile /run/cyrus-master.pid
295 + eend $?
296 +}