Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/courier-imap/, net-mail/courier-imap/files/
Date: Mon, 02 May 2016 22:24:19
Message-Id: 1462227707.90ed5084795deceaf8f77100072807d0fb4432a8.wizardedit@gentoo
1 commit: 90ed5084795deceaf8f77100072807d0fb4432a8
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 2 21:26:15 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Mon May 2 22:21:47 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90ed5084
7
8 net-mail/courier-imap: use #!/sbin/openrc-run instead of #!/sbin/runscript
9
10 Gentoo-Bug: https://bugs.gentoo.org/573846
11
12 Package-Manager: portage-2.2.26
13
14 net-mail/courier-imap/courier-imap-4.15-r2.ebuild | 230 +++++++++++++++++++++
15 .../courier-imap/courier-imap-4.16.0-r1.ebuild | 219 ++++++++++++++++++++
16 .../courier-imap/courier-imap-4.16.2-r1.ebuild | 219 ++++++++++++++++++++
17 .../courier-imap-4.0.6-r1-courier-imapd-ssl.rc6 | 4 +-
18 .../files/courier-imap-4.0.6-r1-courier-imapd.rc6 | 4 +-
19 .../courier-imap-4.0.6-r1-courier-pop3d-ssl.rc6 | 4 +-
20 .../files/courier-imap-4.0.6-r1-courier-pop3d.rc6 | 4 +-
21 7 files changed, 676 insertions(+), 8 deletions(-)
22
23 diff --git a/net-mail/courier-imap/courier-imap-4.15-r2.ebuild b/net-mail/courier-imap/courier-imap-4.15-r2.ebuild
24 new file mode 100644
25 index 0000000..f58f093
26 --- /dev/null
27 +++ b/net-mail/courier-imap/courier-imap-4.15-r2.ebuild
28 @@ -0,0 +1,230 @@
29 +# Copyright 1999-2016 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=5
34 +
35 +inherit autotools eutils multilib libtool systemd
36 +
37 +DESCRIPTION="An IMAP daemon designed specifically for maildirs"
38 +HOMEPAGE="http://www.courier-mta.org/"
39 +SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
40 +
41 +LICENSE="GPL-3"
42 +SLOT="0"
43 +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
44 +IUSE="berkdb debug fam +gdbm ipv6 selinux gnutls trashquota"
45 +
46 +REQUIRED_USE="|| ( berkdb gdbm )"
47 +
48 +CDEPEND="
49 + gnutls? ( net-libs/gnutls )
50 + !gnutls? ( >=dev-libs/openssl-0.9.6:0= )
51 + >=net-libs/courier-authlib-0.61
52 + >=net-mail/mailbase-0.00-r8
53 + berkdb? ( sys-libs/db:= )
54 + fam? ( virtual/fam )
55 + gdbm? ( >=sys-libs/gdbm-1.8.0 )"
56 +DEPEND="${CDEPEND}
57 + dev-lang/perl
58 + !mail-mta/courier
59 + userland_GNU? ( sys-process/procps )"
60 +RDEPEND="${CDEPEND}
61 + selinux? ( sec-policy/selinux-courier )"
62 +
63 +# get rid of old style virtual - bug 350792
64 +# all blockers really needed?
65 +RDEPEND="${RDEPEND}
66 + !mail-mta/courier
67 + !net-mail/bincimap
68 + !net-mail/cyrus-imapd
69 + !net-mail/uw-imap"
70 +
71 +RC_VER="4.0.6-r1"
72 +INITD_VER="4.0.6-r1"
73 +
74 +src_prepare() {
75 + # Bug #48838. Patch to enable/disable FAM support.
76 + # 20 Aug 2004 langthang@g.o
77 + # This patch should fix bug #51540. fam USE flag is not needed for shared folder support.
78 + epatch "${FILESDIR}"/${P}-disable-fam-configure.ac.patch
79 +
80 + # Kill unneeded call to AC_PROG_SYSCONFTOOL (bug #168206).
81 + epatch "${FILESDIR}"/${P}-aclocal-fix.patch
82 +
83 + # These patches should fix problems detecting BerkeleyDB.
84 + # We now can compile with db4 support.
85 + if use berkdb ; then
86 + epatch \
87 + "${FILESDIR}"/${P}-db4-bdbobj_configure.ac.patch \
88 + "${FILESDIR}"/${P}-db4-configure.ac.patch
89 + fi
90 +
91 + eautoreconf
92 +}
93 +
94 +src_configure() {
95 + local myconf=""
96 +
97 + # 19 Aug 2004 langthang@g.o
98 + # Default to gdbm if both berkdb and gdbm are present.
99 + if use gdbm ; then
100 + einfo "Building with GDBM support"
101 + myconf="${myconf} --with-db=gdbm"
102 + elif use berkdb ; then
103 + einfo "Building with BerkeleyDB support"
104 + myconf="${myconf} --with-db=db"
105 + fi
106 +
107 + # Disabling unicode is no longer supported
108 + # By default all available character sets are included
109 + # Set ENABLE_UNICODE=iso-8859-1,utf-8,iso-8859-10
110 + # to include only specified translation tables.
111 + if [[ -z "${ENABLE_UNICODE}" ]] ; then
112 + einfo "ENABLE_UNICODE is not set, building with all available character sets"
113 + myconf="${myconf} --enable-unicode"
114 + else
115 + einfo "ENABLE_UNICODE is set, building with unicode=${ENABLE_UNICODE}"
116 + myconf="${myconf} --enable-unicode=${ENABLE_UNICODE}"
117 + fi
118 +
119 + if use trashquota ; then
120 + einfo "Building with Trash Quota Support"
121 + myconf="${myconf} --with-trashquota"
122 + fi
123 +
124 + use debug && myconf="${myconf} debug=true"
125 +
126 + # Do the actual build now
127 + econf \
128 + --disable-root-check \
129 + --bindir=/usr/sbin \
130 + --sysconfdir=/etc/${PN} \
131 + --libexecdir=/usr/$(get_libdir)/${PN} \
132 + --localstatedir=/var/lib/${PN} \
133 + --with-authdaemonvar=/var/lib/${PN}/authdaemon \
134 + --enable-workarounds-for-imap-client-bugs \
135 + --with-mailuser=mail \
136 + --with-mailgroup=mail \
137 + $(use_with fam) \
138 + $(use_with ipv6) \
139 + $(use_with gnutls) \
140 + ${myconf}
141 +
142 + # Change the pem file location.
143 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/imapd.pem:" \
144 + libs/imap/imapd-ssl.dist || \
145 + die "sed failed"
146 +
147 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/pop3d.pem:" \
148 + libs/imap/pop3d-ssl.dist || \
149 + die "sed failed"
150 +}
151 +
152 +src_compile() {
153 + # spurious failures with parallel compiles
154 + emake -j1
155 +}
156 +
157 +src_install() {
158 + dodir /var/lib/${PN} /etc/pam.d
159 + default
160 + rm -Rf "${D}/etc/pam.d" || die
161 +
162 + # Avoid name collisions in /usr/sbin wrt imapd and pop3d
163 + cd "${D}/usr/sbin" || die
164 + for name in imapd pop3d ; do
165 + mv -f "${name}" "courier-${name}" || die "Failed to mv ${name} to courier-${name}"
166 + done
167 +
168 + # Hack /usr/lib/courier-imap/foo.rc to use ${MAILDIR} instead of
169 + # 'Maildir', and to use /usr/sbin/courier-foo names.
170 + cd "${D}/usr/$(get_libdir)/${PN}" || die
171 + for service in {imapd,pop3d}{,-ssl} ; do
172 + sed -i -e 's/Maildir/${MAILDIR}/' "${service}.rc" || die "sed failed"
173 + sed -i -e "s/\/usr\/sbin\/${service}/\/usr\/sbin\/courier-${service}/" "${service}.rc" || die "sed failed"
174 + done
175 +
176 + # Rename the config files correctly and add a value for ${MAILDIR} to them.
177 + cd "${D}/etc/${PN}" || die
178 + for service in {imapd,pop3d}{,-ssl} ; do
179 + mv -f "${service}.dist" "${service}" || die "Failed to mv ${service}.dist to ${service}"
180 + echo -e '\n# Hardwire a value for ${MAILDIR}' >> "${service}"
181 + echo 'MAILDIR=.maildir' >> "${service}"
182 + echo 'MAILDIRPATH=.maildir' >> "${service}"
183 + done
184 + for service in imapd pop3d ; do
185 + echo -e '# Put any program for ${PRERUN} here' >> "${service}"
186 + echo 'PRERUN=' >> "${service}"
187 + echo -e '# Put any program for ${LOGINRUN} here' >> "${service}"
188 + echo -e '# this is for relay-ctrl-allow in 4*' >> "${service}"
189 + echo 'LOGINRUN=' >> "${service}"
190 + done
191 +
192 + cd "${D}/usr/sbin" || die
193 + for x in * ; do
194 + if [[ -L "${x}" ]] ; then
195 + rm -f "${x}" || die "Failed to rm ${x}"
196 + fi
197 + done
198 +
199 + cd ../share || die
200 + mv -f * ../sbin || die
201 + mv -f ../sbin/man . || die
202 + cd .. || die
203 +
204 + for x in mkimapdcert mkpop3dcert ; do
205 + mv -f "${D}/usr/sbin/${x}" "${D}/usr/sbin/${x}.orig" || die "Failed to mv /usr/sbin/${x} to /usr/sbin/${x}.orig"
206 + done
207 +
208 + dosbin "${FILESDIR}/mkimapdcert" "${FILESDIR}/mkpop3dcert"
209 +
210 + dosym /usr/sbin/courierlogger /usr/$(get_libdir)/${PN}/courierlogger
211 +
212 + mkdir "${WORKDIR}/tmp" && cd "${WORKDIR}/tmp" || die
213 +
214 + for initd in courier-{imapd,pop3d}{,-ssl} ; do
215 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${INITD_VER}-${initd}.rc6" > "${initd}" || die "initd libdir-sed failed"
216 + doinitd "${initd}"
217 + done
218 +
219 + systemd_newunit "${FILESDIR}"/courier-authdaemond-r1.service courier-authdaemond.service
220 + systemd_newunit "${FILESDIR}"/courier-imapd-ssl-r1.service courier-imapd-ssl.service
221 + systemd_newunit "${FILESDIR}"/courier-imapd-r1.service courier-imapd.service
222 +
223 + exeinto /usr/$(get_libdir)/${PN}
224 + for exe in gentoo-{imapd,pop3d}{,-ssl}.rc courier-{imapd,pop3d}.indirect ; do
225 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${RC_VER}-${exe}" > "${exe}" || die "exe libdir-sed failed"
226 + doexe "${exe}"
227 + done
228 +
229 + dodir /usr/bin
230 + mv -f "${D}/usr/sbin/maildirmake" "${D}/usr/bin/maildirmake" || die "Failed to mv /usr/sbin/maildirmake to /usr/bin/maildirmake"
231 +
232 + # Bug #45953, more docs.
233 + cd "${S}" || die
234 + dohtml -r "${S}"/*
235 + dodoc "${S}"/{AUTHORS,INSTALL,NEWS,README,ChangeLog} "${FILESDIR}"/${PN}-gentoo.readme
236 + docinto imap
237 + dodoc "${S}"/libs/imap/{ChangeLog,BUGS,BUGS.html,README}
238 + docinto maildir
239 + dodoc "${S}"/libs/maildir/{AUTHORS,INSTALL,README.maildirquota.txt,README.sharedfolders.txt}
240 + docinto tcpd
241 + dodoc "${S}"/libs/tcpd/README.couriertls
242 +}
243 +
244 +pkg_postinst() {
245 + elog "Please read http://www.courier-mta.org/imap/INSTALL.html#upgrading"
246 + elog "and remove TLS_DHPARAMS from configuration files or run mkdhparams"
247 +
248 + elog "For a quick-start howto please refer to"
249 + elog "${PN}-gentoo.readme in /usr/share/doc/${PF}"
250 + # Some users have been reporting that permissions on this directory were
251 + # getting scrambled, so let's ensure that they are sane.
252 + chmod 0755 "${ROOT}/usr/$(get_libdir)/${PN}" || die "Failed to ensure sane permissions on ${ROOT}/usr/$(get_libdir)/${PN}"
253 +}
254 +
255 +src_test() {
256 + ewarn "make check is not supported by this package due to the"
257 + ewarn "--enable-workarounds-for-imap-client-bugs option."
258 +}
259
260 diff --git a/net-mail/courier-imap/courier-imap-4.16.0-r1.ebuild b/net-mail/courier-imap/courier-imap-4.16.0-r1.ebuild
261 new file mode 100644
262 index 0000000..698cd89
263 --- /dev/null
264 +++ b/net-mail/courier-imap/courier-imap-4.16.0-r1.ebuild
265 @@ -0,0 +1,219 @@
266 +# Copyright 1999-2016 Gentoo Foundation
267 +# Distributed under the terms of the GNU General Public License v2
268 +# $Id$
269 +
270 +EAPI=5
271 +
272 +inherit autotools eutils multilib libtool systemd
273 +
274 +DESCRIPTION="An IMAP daemon designed specifically for maildirs"
275 +HOMEPAGE="http://www.courier-mta.org/"
276 +SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
277 +
278 +LICENSE="GPL-3"
279 +SLOT="0"
280 +KEYWORDS="~amd64 ~hppa ~ppc64 ~x86"
281 +IUSE="berkdb debug fam +gdbm ipv6 selinux gnutls trashquota"
282 +
283 +REQUIRED_USE="|| ( berkdb gdbm )"
284 +
285 +CDEPEND="
286 + gnutls? ( net-libs/gnutls )
287 + !gnutls? ( >=dev-libs/openssl-0.9.6:0= )
288 + >=net-libs/courier-authlib-0.61
289 + ~net-libs/courier-unicode-1.1
290 + >=net-mail/mailbase-0.00-r8
291 + berkdb? ( sys-libs/db:= )
292 + fam? ( virtual/fam )
293 + gdbm? ( >=sys-libs/gdbm-1.8.0 )"
294 +DEPEND="${CDEPEND}
295 + dev-lang/perl
296 + !mail-mta/courier
297 + userland_GNU? ( sys-process/procps )"
298 +RDEPEND="${CDEPEND}
299 + selinux? ( sec-policy/selinux-courier )"
300 +
301 +# get rid of old style virtual - bug 350792
302 +# all blockers really needed?
303 +RDEPEND="${RDEPEND}
304 + !mail-mta/courier
305 + !net-mail/bincimap
306 + !net-mail/cyrus-imapd
307 + !net-mail/uw-imap"
308 +
309 +RC_VER="4.0.6-r1"
310 +INITD_VER="4.0.6-r1"
311 +
312 +src_prepare() {
313 + # Bug #48838. Patch to enable/disable FAM support.
314 + # 20 Aug 2004 langthang@g.o
315 + # This patch should fix bug #51540. fam USE flag is not needed for shared folder support.
316 + epatch "${FILESDIR}"/${PN}-4.15-disable-fam-configure.ac.patch
317 +
318 + # Kill unneeded call to AC_PROG_SYSCONFTOOL (bug #168206).
319 + epatch "${FILESDIR}"/${PN}-4.15-aclocal-fix.patch
320 +
321 + # These patches should fix problems detecting BerkeleyDB.
322 + # We now can compile with db4 support.
323 + if use berkdb ; then
324 + epatch \
325 + "${FILESDIR}"/${PN}-4.15-db4-bdbobj_configure.ac.patch \
326 + "${FILESDIR}"/${PN}-4.15-db4-configure.ac.patch
327 + fi
328 +
329 + eautoreconf
330 +}
331 +
332 +src_configure() {
333 + local myconf=""
334 +
335 + # 19 Aug 2004 langthang@g.o
336 + # Default to gdbm if both berkdb and gdbm are present.
337 + if use gdbm ; then
338 + einfo "Building with GDBM support"
339 + myconf="${myconf} --with-db=gdbm"
340 + elif use berkdb ; then
341 + einfo "Building with BerkeleyDB support"
342 + myconf="${myconf} --with-db=db"
343 + fi
344 +
345 + if use trashquota ; then
346 + einfo "Building with Trash Quota Support"
347 + myconf="${myconf} --with-trashquota"
348 + fi
349 +
350 + use debug && myconf="${myconf} debug=true"
351 +
352 + # Do the actual build now
353 + econf \
354 + --disable-root-check \
355 + --bindir=/usr/sbin \
356 + --sysconfdir=/etc/${PN} \
357 + --libexecdir=/usr/$(get_libdir)/${PN} \
358 + --localstatedir=/var/lib/${PN} \
359 + --with-authdaemonvar=/var/lib/${PN}/authdaemon \
360 + --enable-workarounds-for-imap-client-bugs \
361 + --with-mailuser=mail \
362 + --with-mailgroup=mail \
363 + $(use_with fam) \
364 + $(use_with ipv6) \
365 + $(use_with gnutls) \
366 + ${myconf}
367 +
368 + # Change the pem file location.
369 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/imapd.pem:" \
370 + libs/imap/imapd-ssl.dist || \
371 + die "sed failed"
372 +
373 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/pop3d.pem:" \
374 + libs/imap/pop3d-ssl.dist || \
375 + die "sed failed"
376 +}
377 +
378 +src_compile() {
379 + # spurious failures with parallel compiles
380 + emake -j1
381 +}
382 +
383 +src_install() {
384 + dodir /var/lib/${PN} /etc/pam.d
385 + default
386 + rm -Rf "${D}/etc/pam.d" || die
387 +
388 + # Avoid name collisions in /usr/sbin wrt imapd and pop3d
389 + cd "${D}/usr/sbin" || die
390 + for name in imapd pop3d ; do
391 + mv -f "${name}" "courier-${name}" || die "Failed to mv ${name} to courier-${name}"
392 + done
393 +
394 + # Hack /usr/lib/courier-imap/foo.rc to use ${MAILDIR} instead of
395 + # 'Maildir', and to use /usr/sbin/courier-foo names.
396 + cd "${D}/usr/$(get_libdir)/${PN}" || die
397 + for service in {imapd,pop3d}{,-ssl} ; do
398 + sed -i -e 's/Maildir/${MAILDIR}/' "${service}.rc" || die "sed failed"
399 + sed -i -e "s/\/usr\/sbin\/${service}/\/usr\/sbin\/courier-${service}/" "${service}.rc" || die "sed failed"
400 + done
401 +
402 + # Rename the config files correctly and add a value for ${MAILDIR} to them.
403 + cd "${D}/etc/${PN}" || die
404 + for service in {imapd,pop3d}{,-ssl} ; do
405 + mv -f "${service}.dist" "${service}" || die "Failed to mv ${service}.dist to ${service}"
406 + echo -e '\n# Hardwire a value for ${MAILDIR}' >> "${service}"
407 + echo 'MAILDIR=.maildir' >> "${service}"
408 + echo 'MAILDIRPATH=.maildir' >> "${service}"
409 + done
410 + for service in imapd pop3d ; do
411 + echo -e '# Put any program for ${PRERUN} here' >> "${service}"
412 + echo 'PRERUN=' >> "${service}"
413 + echo -e '# Put any program for ${LOGINRUN} here' >> "${service}"
414 + echo -e '# this is for relay-ctrl-allow in 4*' >> "${service}"
415 + echo 'LOGINRUN=' >> "${service}"
416 + done
417 +
418 + cd "${D}/usr/sbin"
419 + for x in * ; do
420 + if [[ -L "${x}" ]] ; then
421 + rm -f "${x}" || die "Failed to rm ${x}"
422 + fi
423 + done
424 +
425 + cd ../share
426 + mv -f * ../sbin
427 + mv -f ../sbin/man .
428 + cd ..
429 +
430 + for x in mkimapdcert mkpop3dcert ; do
431 + mv -f "${D}/usr/sbin/${x}" "${D}/usr/sbin/${x}.orig" || die "Failed to mv /usr/sbin/${x} to /usr/sbin/${x}.orig"
432 + done
433 +
434 + dosbin "${FILESDIR}/mkimapdcert" "${FILESDIR}/mkpop3dcert"
435 +
436 + dosym /usr/sbin/courierlogger /usr/$(get_libdir)/${PN}/courierlogger
437 +
438 + mkdir "${WORKDIR}/tmp" ; cd "${WORKDIR}/tmp"
439 +
440 + for initd in courier-{imapd,pop3d}{,-ssl} ; do
441 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${INITD_VER}-${initd}.rc6" > "${initd}" || die "initd libdir-sed failed"
442 + doinitd "${initd}"
443 + done
444 +
445 + systemd_newunit "${FILESDIR}"/courier-authdaemond-r1.service courier-authdaemond.service
446 + systemd_newunit "${FILESDIR}"/courier-imapd-ssl-r1.service courier-imapd-ssl.service
447 + systemd_newunit "${FILESDIR}"/courier-imapd-r1.service courier-imapd.service
448 +
449 + exeinto /usr/$(get_libdir)/${PN}
450 + for exe in gentoo-{imapd,pop3d}{,-ssl}.rc courier-{imapd,pop3d}.indirect ; do
451 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${RC_VER}-${exe}" > "${exe}" || die "exe libdir-sed failed"
452 + doexe "${exe}"
453 + done
454 +
455 + dodir /usr/bin
456 + mv -f "${D}/usr/sbin/maildirmake" "${D}/usr/bin/maildirmake" || die "Failed to mv /usr/sbin/maildirmake to /usr/bin/maildirmake"
457 +
458 + # Bug #45953, more docs.
459 + cd "${S}" || die
460 + dohtml -r "${S}"/*
461 + dodoc "${S}"/{AUTHORS,INSTALL,NEWS,README,ChangeLog} "${FILESDIR}"/${PN}-gentoo.readme
462 + docinto imap
463 + dodoc "${S}"/libs/imap/{ChangeLog,BUGS,BUGS.html,README}
464 + docinto maildir
465 + dodoc "${S}"/libs/maildir/{AUTHORS,INSTALL,README.maildirquota.txt,README.sharedfolders.txt}
466 + docinto tcpd
467 + dodoc "${S}"/libs/tcpd/README.couriertls
468 +}
469 +
470 +pkg_postinst() {
471 + elog "Please read http://www.courier-mta.org/imap/INSTALL.html#upgrading"
472 + elog "and remove TLS_DHPARAMS from configuration files or run mkdhparams"
473 +
474 + elog "For a quick-start howto please refer to"
475 + elog "${PN}-gentoo.readme in /usr/share/doc/${PF}"
476 + # Some users have been reporting that permissions on this directory were
477 + # getting scrambled, so let's ensure that they are sane.
478 + chmod 0755 "${ROOT}/usr/$(get_libdir)/${PN}" || die "Failed to ensure sane permissions on ${ROOT}/usr/$(get_libdir)/${PN}"
479 +}
480 +
481 +src_test() {
482 + ewarn "make check is not supported by this package due to the"
483 + ewarn "--enable-workarounds-for-imap-client-bugs option."
484 +}
485
486 diff --git a/net-mail/courier-imap/courier-imap-4.16.2-r1.ebuild b/net-mail/courier-imap/courier-imap-4.16.2-r1.ebuild
487 new file mode 100644
488 index 0000000..8a7c2b4
489 --- /dev/null
490 +++ b/net-mail/courier-imap/courier-imap-4.16.2-r1.ebuild
491 @@ -0,0 +1,219 @@
492 +# Copyright 1999-2016 Gentoo Foundation
493 +# Distributed under the terms of the GNU General Public License v2
494 +# $Id$
495 +
496 +EAPI=5
497 +
498 +inherit autotools eutils multilib libtool systemd
499 +
500 +DESCRIPTION="An IMAP daemon designed specifically for maildirs"
501 +HOMEPAGE="http://www.courier-mta.org/"
502 +SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
503 +
504 +LICENSE="GPL-3"
505 +SLOT="0"
506 +KEYWORDS="~amd64 ~hppa ~mips ~ppc64 ~x86"
507 +IUSE="berkdb debug fam +gdbm ipv6 selinux gnutls trashquota"
508 +
509 +REQUIRED_USE="|| ( berkdb gdbm )"
510 +
511 +CDEPEND="
512 + gnutls? ( net-libs/gnutls )
513 + !gnutls? ( >=dev-libs/openssl-0.9.6:0= )
514 + >=net-libs/courier-authlib-0.61
515 + >=net-libs/courier-unicode-1.3
516 + >=net-mail/mailbase-0.00-r8
517 + berkdb? ( sys-libs/db:= )
518 + fam? ( virtual/fam )
519 + gdbm? ( >=sys-libs/gdbm-1.8.0 )"
520 +DEPEND="${CDEPEND}
521 + dev-lang/perl
522 + !mail-mta/courier
523 + userland_GNU? ( sys-process/procps )"
524 +RDEPEND="${CDEPEND}
525 + selinux? ( sec-policy/selinux-courier )"
526 +
527 +# get rid of old style virtual - bug 350792
528 +# all blockers really needed?
529 +RDEPEND="${RDEPEND}
530 + !mail-mta/courier
531 + !net-mail/bincimap
532 + !net-mail/cyrus-imapd
533 + !net-mail/uw-imap"
534 +
535 +RC_VER="4.0.6-r1"
536 +INITD_VER="4.0.6-r1"
537 +
538 +src_prepare() {
539 + # Bug #48838. Patch to enable/disable FAM support.
540 + # 20 Aug 2004 langthang@g.o
541 + # This patch should fix bug #51540. fam USE flag is not needed for shared folder support.
542 + epatch "${FILESDIR}"/${PN}-4.15-disable-fam-configure.ac.patch
543 +
544 + # Kill unneeded call to AC_PROG_SYSCONFTOOL (bug #168206).
545 + epatch "${FILESDIR}"/${PN}-4.15-aclocal-fix.patch
546 +
547 + # These patches should fix problems detecting BerkeleyDB.
548 + # We now can compile with db4 support.
549 + if use berkdb ; then
550 + epatch \
551 + "${FILESDIR}"/${PN}-4.15-db4-bdbobj_configure.ac.patch \
552 + "${FILESDIR}"/${PN}-4.15-db4-configure.ac.patch
553 + fi
554 +
555 + eautoreconf
556 +}
557 +
558 +src_configure() {
559 + local myconf=""
560 +
561 + # 19 Aug 2004 langthang@g.o
562 + # Default to gdbm if both berkdb and gdbm are present.
563 + if use gdbm ; then
564 + einfo "Building with GDBM support"
565 + myconf="${myconf} --with-db=gdbm"
566 + elif use berkdb ; then
567 + einfo "Building with BerkeleyDB support"
568 + myconf="${myconf} --with-db=db"
569 + fi
570 +
571 + if use trashquota ; then
572 + einfo "Building with Trash Quota Support"
573 + myconf="${myconf} --with-trashquota"
574 + fi
575 +
576 + use debug && myconf="${myconf} debug=true"
577 +
578 + # Do the actual build now
579 + econf \
580 + --disable-root-check \
581 + --bindir=/usr/sbin \
582 + --sysconfdir=/etc/${PN} \
583 + --libexecdir=/usr/$(get_libdir)/${PN} \
584 + --localstatedir=/var/lib/${PN} \
585 + --with-authdaemonvar=/var/lib/${PN}/authdaemon \
586 + --enable-workarounds-for-imap-client-bugs \
587 + --with-mailuser=mail \
588 + --with-mailgroup=mail \
589 + $(use_with fam) \
590 + $(use_with ipv6) \
591 + $(use_with gnutls) \
592 + ${myconf}
593 +
594 + # Change the pem file location.
595 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/imapd.pem:" \
596 + libs/imap/imapd-ssl.dist || \
597 + die "sed failed"
598 +
599 + sed -i -e "s:^\(TLS_CERTFILE=\).*:\1/etc/courier-imap/pop3d.pem:" \
600 + libs/imap/pop3d-ssl.dist || \
601 + die "sed failed"
602 +}
603 +
604 +src_compile() {
605 + # spurious failures with parallel compiles
606 + emake -j1
607 +}
608 +
609 +src_install() {
610 + dodir /var/lib/${PN} /etc/pam.d
611 + default
612 + rm -Rf "${D}/etc/pam.d" || die
613 +
614 + # Avoid name collisions in /usr/sbin wrt imapd and pop3d
615 + cd "${D}/usr/sbin" || die
616 + for name in imapd pop3d ; do
617 + mv -f "${name}" "courier-${name}" || die "Failed to mv ${name} to courier-${name}"
618 + done
619 +
620 + # Hack /usr/lib/courier-imap/foo.rc to use ${MAILDIR} instead of
621 + # 'Maildir', and to use /usr/sbin/courier-foo names.
622 + cd "${D}/usr/$(get_libdir)/${PN}" || die
623 + for service in {imapd,pop3d}{,-ssl} ; do
624 + sed -i -e 's/Maildir/${MAILDIR}/' "${service}.rc" || die "sed failed"
625 + sed -i -e "s/\/usr\/sbin\/${service}/\/usr\/sbin\/courier-${service}/" "${service}.rc" || die "sed failed"
626 + done
627 +
628 + # Rename the config files correctly and add a value for ${MAILDIR} to them.
629 + cd "${D}/etc/${PN}" || die
630 + for service in {imapd,pop3d}{,-ssl} ; do
631 + mv -f "${service}.dist" "${service}" || die "Failed to mv ${service}.dist to ${service}"
632 + echo -e '\n# Hardwire a value for ${MAILDIR}' >> "${service}"
633 + echo 'MAILDIR=.maildir' >> "${service}"
634 + echo 'MAILDIRPATH=.maildir' >> "${service}"
635 + done
636 + for service in imapd pop3d ; do
637 + echo -e '# Put any program for ${PRERUN} here' >> "${service}"
638 + echo 'PRERUN=' >> "${service}"
639 + echo -e '# Put any program for ${LOGINRUN} here' >> "${service}"
640 + echo -e '# this is for relay-ctrl-allow in 4*' >> "${service}"
641 + echo 'LOGINRUN=' >> "${service}"
642 + done
643 +
644 + cd "${D}/usr/sbin"
645 + for x in * ; do
646 + if [[ -L "${x}" ]] ; then
647 + rm -f "${x}" || die "Failed to rm ${x}"
648 + fi
649 + done
650 +
651 + cd ../share
652 + mv -f * ../sbin
653 + mv -f ../sbin/man .
654 + cd ..
655 +
656 + for x in mkimapdcert mkpop3dcert ; do
657 + mv -f "${D}/usr/sbin/${x}" "${D}/usr/sbin/${x}.orig" || die "Failed to mv /usr/sbin/${x} to /usr/sbin/${x}.orig"
658 + done
659 +
660 + dosbin "${FILESDIR}/mkimapdcert" "${FILESDIR}/mkpop3dcert"
661 +
662 + dosym /usr/sbin/courierlogger /usr/$(get_libdir)/${PN}/courierlogger
663 +
664 + mkdir "${WORKDIR}/tmp" ; cd "${WORKDIR}/tmp"
665 +
666 + for initd in courier-{imapd,pop3d}{,-ssl} ; do
667 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${INITD_VER}-${initd}.rc6" > "${initd}" || die "initd libdir-sed failed"
668 + doinitd "${initd}"
669 + done
670 +
671 + systemd_newunit "${FILESDIR}"/courier-authdaemond-r1.service courier-authdaemond.service
672 + systemd_newunit "${FILESDIR}"/courier-imapd-ssl-r1.service courier-imapd-ssl.service
673 + systemd_newunit "${FILESDIR}"/courier-imapd-r1.service courier-imapd.service
674 +
675 + exeinto /usr/$(get_libdir)/${PN}
676 + for exe in gentoo-{imapd,pop3d}{,-ssl}.rc courier-{imapd,pop3d}.indirect ; do
677 + sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${RC_VER}-${exe}" > "${exe}" || die "exe libdir-sed failed"
678 + doexe "${exe}"
679 + done
680 +
681 + dodir /usr/bin
682 + mv -f "${D}/usr/sbin/maildirmake" "${D}/usr/bin/maildirmake" || die "Failed to mv /usr/sbin/maildirmake to /usr/bin/maildirmake"
683 +
684 + # Bug #45953, more docs.
685 + cd "${S}" || die
686 + dohtml -r "${S}"/*
687 + dodoc "${S}"/{AUTHORS,INSTALL,NEWS,README,ChangeLog} "${FILESDIR}"/${PN}-gentoo.readme
688 + docinto imap
689 + dodoc "${S}"/libs/imap/{ChangeLog,BUGS,BUGS.html,README}
690 + docinto maildir
691 + dodoc "${S}"/libs/maildir/{AUTHORS,INSTALL,README.maildirquota.txt,README.sharedfolders.txt}
692 + docinto tcpd
693 + dodoc "${S}"/libs/tcpd/README.couriertls
694 +}
695 +
696 +pkg_postinst() {
697 + elog "Please read http://www.courier-mta.org/imap/INSTALL.html#upgrading"
698 + elog "and remove TLS_DHPARAMS from configuration files or run mkdhparams"
699 +
700 + elog "For a quick-start howto please refer to"
701 + elog "${PN}-gentoo.readme in /usr/share/doc/${PF}"
702 + # Some users have been reporting that permissions on this directory were
703 + # getting scrambled, so let's ensure that they are sane.
704 + chmod 0755 "${ROOT}/usr/$(get_libdir)/${PN}" || die "Failed to ensure sane permissions on ${ROOT}/usr/$(get_libdir)/${PN}"
705 +}
706 +
707 +src_test() {
708 + ewarn "make check is not supported by this package due to the"
709 + ewarn "--enable-workarounds-for-imap-client-bugs option."
710 +}
711
712 diff --git a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd-ssl.rc6 b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd-ssl.rc6
713 index 1d62b80..38f69b1 100644
714 --- a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd-ssl.rc6
715 +++ b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd-ssl.rc6
716 @@ -1,5 +1,5 @@
717 -#!/sbin/runscript
718 -# Copyright 1999-2014 Gentoo Foundation
719 +#!/sbin/openrc-run
720 +# Copyright 1999-2016 Gentoo Foundation
721 # Distributed under the terms of the GNU General Public License v2
722 # $Id$
723
724
725 diff --git a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd.rc6 b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd.rc6
726 index 8d78d9a..2c336d7 100644
727 --- a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd.rc6
728 +++ b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd.rc6
729 @@ -1,5 +1,5 @@
730 -#!/sbin/runscript
731 -# Copyright 1999-2014 Gentoo Foundation
732 +#!/sbin/openrc-run
733 +# Copyright 1999-2016 Gentoo Foundation
734 # Distributed under the terms of the GNU General Public License v2
735 # $Id$
736
737
738 diff --git a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d-ssl.rc6 b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d-ssl.rc6
739 index edd157b..ba32da5 100644
740 --- a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d-ssl.rc6
741 +++ b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d-ssl.rc6
742 @@ -1,5 +1,5 @@
743 -#!/sbin/runscript
744 -# Copyright 1999-2014 Gentoo Foundation
745 +#!/sbin/openrc-run
746 +# Copyright 1999-2016 Gentoo Foundation
747 # Distributed under the terms of the GNU General Public License v2
748 # $Id$
749
750
751 diff --git a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d.rc6 b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d.rc6
752 index 7f3da57..9a4ecf6 100644
753 --- a/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d.rc6
754 +++ b/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-pop3d.rc6
755 @@ -1,5 +1,5 @@
756 -#!/sbin/runscript
757 -# Copyright 1999-2014 Gentoo Foundation
758 +#!/sbin/openrc-run
759 +# Copyright 1999-2016 Gentoo Foundation
760 # Distributed under the terms of the GNU General Public License v2
761 # $Id$