summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2010-04-07 16:32:04 +0000
committerPatrick Lauer <patrick@gentoo.org>2010-04-07 16:32:04 +0000
commite8fb782cde94cbf203726c0880fd210ed194ad53 (patch)
tree738a0bb6a7830801053e4886159d46df7f2bdd33 /net-mail
parentAs discussed with maintainers, convert to EAPI3 & add prefix keywords (diff)
downloadhistorical-e8fb782cde94cbf203726c0880fd210ed194ad53.tar.gz
historical-e8fb782cde94cbf203726c0880fd210ed194ad53.tar.bz2
historical-e8fb782cde94cbf203726c0880fd210ed194ad53.zip
Small fixes for managesieve, create SSL cert in postinstall if it doesn't exist. Thanks to Eray Aslan for the improvements.
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'net-mail')
-rw-r--r--net-mail/dovecot/ChangeLog8
-rw-r--r--net-mail/dovecot/Manifest4
-rw-r--r--net-mail/dovecot/dovecot-1.2.11-r1.ebuild262
3 files changed, 272 insertions, 2 deletions
diff --git a/net-mail/dovecot/ChangeLog b/net-mail/dovecot/ChangeLog
index b0b54261b2fa..6a1d94c1aecc 100644
--- a/net-mail/dovecot/ChangeLog
+++ b/net-mail/dovecot/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-mail/dovecot
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.233 2010/03/29 18:45:38 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.234 2010/04/07 16:32:04 patrick Exp $
+
+*dovecot-1.2.11-r1 (07 Apr 2010)
+
+ 07 Apr 2010; Patrick Lauer <patrick@gentoo.org> +dovecot-1.2.11-r1.ebuild:
+ Small fixes for managesieve, create SSL cert in postinstall if it doesn't
+ exist. Thanks to Eray Aslan for the improvements.
*dovecot-1.2.11 (29 Mar 2010)
diff --git a/net-mail/dovecot/Manifest b/net-mail/dovecot/Manifest
index 131151bf4921..90ed5bcc3d17 100644
--- a/net-mail/dovecot/Manifest
+++ b/net-mail/dovecot/Manifest
@@ -21,6 +21,7 @@ DIST dovecot-1.2-sieve-0.1.14.tar.gz 992724 RMD160 b61c9448c876062f2b1fd3d1cf72c
DIST dovecot-1.2-sieve-0.1.15.tar.gz 1051262 RMD160 7fd3d23d5ef93d443cdedc8512dab649b2a99694 SHA1 2827df60028639ec15422a86f48a1c9b2a78431a SHA256 edddc49237d5cb07a7938de9850b475b071e9350b2035f99a15db7a56882295c
DIST dovecot-1.2.10-managesieve-0.11.11.diff.gz 6415 RMD160 875011115ac4050a57f1c96725628ca531ccb61f SHA1 11ff602015221300f291001daa09965e3e199428 SHA256 ef95762d0788869435c6a8d2bf9c416770e50b0f12267897a11d1a5331ac727e
DIST dovecot-1.2.10.tar.gz 2864295 RMD160 0b508502b7c2e9aecd274bf15f1ec5adbb1843a7 SHA1 b717de1ab63f3d521c93385cbd20c49293921079 SHA256 a5d609e9e21aa0c727be2c48db662f0a5ff0824e28167a8d7779f5ccbbaa6ad2
+DIST dovecot-1.2.11-managesieve-0.11.11.diff.gz 6454 RMD160 bfd7593b8ffa36ac6062e0ff147c9759447d6352 SHA1 f27d32144e6db35715ac9de3acd7a7d8948f3323 SHA256 fc024e9f68c6ab82f811af3155c94f1609670d85c7240dfbd34aa045e6fc8a8b
DIST dovecot-1.2.11.tar.gz 2878057 RMD160 cb2090a21e99cfaf98d7cbfdc98adbf42df6e2cc SHA1 97e63377be3641d4c7aa5a0c6d4e2bd602d45972 SHA256 2971691d4f8307b7014ca6671f44151cb53379f80746aa4a95cdeb0b846e0474
DIST dovecot-1.2.6-managesieve-0.11.9.diff.gz 6443 RMD160 43408c4090e7c384a30bacfd207453e50583271d SHA1 c2710e09c9b71ce3607e5614683de4748dac6d85 SHA256 4928fea010f3d993d2fc2bb624cf7586680f42aad2f7548f515773ed244a0164
DIST dovecot-1.2.6.tar.gz 2668219 RMD160 e6086e1a57dd3cf75614823916b509fedfc5283d SHA1 02ede3936123252d542da90488a2d189fa39979c SHA256 b8511688a631bbf1ec35e87c685cf4252085404a931ca20e470ace2a28d4c225
@@ -35,10 +36,11 @@ EBUILD dovecot-1.1.16.ebuild 8588 RMD160 aa2eec6ca31112c8b1ed97f48e75f80e06d13c3
EBUILD dovecot-1.1.19.ebuild 8581 RMD160 cd1a9453330399ace695b4d11e7d5f7d7ffa2726 SHA1 f58455afe22adf0d19c5ff5c6c5e0ccd3ca214ab SHA256 34eb5b1d683e33568c1649c399d98326e981456190822221659c4c528cdc6953
EBUILD dovecot-1.1.7-r1.ebuild 8584 RMD160 9e0bf8fdbf8ed699fd131273241bdf3d4d3cb6bc SHA1 565e5a6bee35ccd3540682ac5f37a47d988700c0 SHA256 1a39caa28662acb24ee1413de6ef2efbc2dd093c2cfe717008fc3dc08f938a37
EBUILD dovecot-1.2.10-r1.ebuild 7754 RMD160 a30ddb5aa7ea38d9002cf6d927bb9e434ff1741c SHA1 d000e1db68bb87b60ca6b052ddb575c1634f9156 SHA256 e175c81215bb776a451a63060bbfb0cd4cd6178d5aec0dd8532a3a64d3e88d8c
+EBUILD dovecot-1.2.11-r1.ebuild 8547 RMD160 782409801706a51d4390065ee1dcc074892044b6 SHA1 5572c749aea73751dca5074b34846a240cf2cdfc SHA256 1f9e22a23df832fa92cbcff7bdaeb08d8989f0e30448262a45b23bebfa121109
EBUILD dovecot-1.2.11.ebuild 7752 RMD160 d367c80158305e4d0b7f59d6512105ed1c557c86 SHA1 c84c051f6b7d93bee4adec9cbfaccc0779c90e5d SHA256 b853c8fe80cdeaffca9d7f76ac524eeaaf6f5e6608d1aa9cb7d97d42dd0252ac
EBUILD dovecot-1.2.6.ebuild 7453 RMD160 89e9412d6f3c6ecbb81c5e94c946e466adac1b89 SHA1 9613b755a74a9678752f7aed79d3217eb0341120 SHA256 b2683a86e3415e5f6cf62d4940b341839571d00c53a56cdb03562d955cf1d638
EBUILD dovecot-1.2.7.ebuild 7461 RMD160 20f4b1374d21b530d01b4cfa049ac3e67749a41e SHA1 d46f8b31b04621f65139aa80a7378b6b5e515d7d SHA256 f5f6974b2f16384d5d816c2216c28d0d08cf0d25061f59057edaa25c67a152d6
EBUILD dovecot-1.2.8.ebuild 7747 RMD160 67b002a4c7212e1814df5486e6b2b36a6032fab5 SHA1 18f499c5dcae89e4b9b12dd7f59c964702fb2d23 SHA256 29b9e85bcfc835c961a904c18cb2c6a6f55328ea444c9e268c8516bd8f4284e6
EBUILD dovecot-1.2.9-r1.ebuild 7747 RMD160 fcdbc597a4216903eefce47a3ae592eaaa2848eb SHA1 4be5713548a7306a2c1251bb638a55afb67c11c9 SHA256 20ae2b450ae344c21ddec63c8ae1d2d2b6c060f3baaf4a035cbd985f0d4a0c0c
-MISC ChangeLog 37337 RMD160 2b82895384075c5f30b7d12c7ac9de7b5ca51ddd SHA1 60e97689e6b7afd68595279451d8669e75c86b8d SHA256 98eab3df45b1c08c968be5f780cff1eb5c1de3b335765272520558d1e1d5999a
+MISC ChangeLog 37577 RMD160 25e729494eff728e80ba0cc50c46bdeef3e09be7 SHA1 2464809e34837aea328679bd057bf4d2fe722028 SHA256 847ce4fa8abb88e07b5141ea860321af70d044fa747e8ffec4ae442aaa67e1c9
MISC metadata.xml 519 RMD160 d0eb63c3a021b24ac08c5ea5b3e5dc393a4b25ff SHA1 7138482d992a2348d7d59fa38aa072958c766b17 SHA256 3814d22e317ff83709a577f037a8cfb10e897ebfbe572132a8d1af882c813ce3
diff --git a/net-mail/dovecot/dovecot-1.2.11-r1.ebuild b/net-mail/dovecot/dovecot-1.2.11-r1.ebuild
new file mode 100644
index 000000000000..6f45f7039cfc
--- /dev/null
+++ b/net-mail/dovecot/dovecot-1.2.11-r1.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/dovecot-1.2.11-r1.ebuild,v 1.1 2010/04/07 16:32:04 patrick Exp $
+
+EAPI="2"
+
+inherit eutils versionator ssl-cert
+
+major_minor="$( get_version_component_range 1-2 )"
+sieve_version="0.1.15"
+managesieve_version="0.11.11"
+SRC_URI="http://dovecot.org/releases/${major_minor}/${P}.tar.gz
+ sieve? ( http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-sieve-${sieve_version}.tar.gz )
+ managesieve? (
+ http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${PV}-managesieve-${managesieve_version}.diff.gz
+ http://www.rename-it.nl/dovecot/${major_minor}/dovecot-${major_minor}-managesieve-${managesieve_version}.tar.gz
+ )"
+DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
+HOMEPAGE="http://www.dovecot.org/"
+
+SLOT="0"
+LICENSE="LGPL-2.1" # MIT too?
+KEYWORDS="~alpha ~amd64 ~arm ~sparc ~x86"
+
+IUSE="berkdb bzip2 caps cydir dbox doc ipv6 kerberos ldap +maildir managesieve mbox mysql pam postgres sieve sqlite +ssl suid vpopmail zlib"
+
+DEPEND="berkdb? ( sys-libs/db )
+ caps? ( sys-libs/libcap )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( virtual/postgresql-base )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( dev-libs/openssl )
+ vpopmail? ( net-mail/vpopmail )"
+
+RDEPEND="${DEPEND}
+ >=net-mail/mailbase-0.00-r8"
+
+pkg_setup() {
+ if use managesieve && ! use sieve; then
+ eerror "managesieve USE flag selected but sieve USE flag unselected"
+ die "USE flag problem"
+ fi
+
+ if use dbox && ! use maildir; then
+ eerror "dbox USE flag needs maildir USE flag enabled"
+ die "USE flag problem"
+ fi
+
+ # Add user and group for login process (same as for fedora/redhat)
+ enewgroup dovecot 97
+ enewuser dovecot 97 -1 /dev/null dovecot
+ # add "mail" group for suid'ing. Better security isolation.
+ if use suid; then
+ enewgroup mail
+ fi
+}
+
+src_prepare() {
+ use managesieve && epatch "${WORKDIR}"/dovecot-${PV}-managesieve-${managesieve_version}.diff
+}
+
+src_configure() {
+ local conf=""
+
+ if use postgres || use mysql || use sqlite; then
+ conf="${conf} --with-sql"
+ fi
+
+ local storages=""
+ for storage in cydir dbox maildir mbox; do
+ use ${storage} && storages="${storage} ${storages}"
+ done
+ [ "${storages}" ] || storages="maildir"
+
+ econf \
+ --sysconfdir=/etc/dovecot \
+ --localstatedir=/var \
+ --with-moduledir="/usr/$( get_libdir )/dovecot" \
+ $( use_with berkdb db ) \
+ $( use_with bzip2 bzlib ) \
+ $( use_with caps libcap ) \
+ $( use_with kerberos gssapi ) \
+ $( use_with ldap ) \
+ $( use_with mysql ) \
+ $( use_with pam ) \
+ $( use_with postgres pgsql ) \
+ $( use_with sqlite ) \
+ $( use_with ssl ) \
+ $( use_with vpopmail ) \
+ $( use_with zlib ) \
+ $( use_with ldap) \
+ --with-storages="${storages}" \
+ --with-pic \
+ --enable-header-install \
+ ${conf}
+
+ if use sieve; then
+ # The sieve plugin needs this file to be build to determine the plugin
+ # directory and the list of libraries to link to.
+ emake dovecot-config || die "emake dovecot-config failed"
+ cd "../dovecot-${major_minor}-sieve-${sieve_version}"
+ econf --with-dovecot="${S}"
+
+ if use managesieve; then
+ cd "../dovecot-${major_minor}-managesieve-${managesieve_version}"
+ econf --with-dovecot="${S}" --with-dovecot-sieve="../dovecot-${major_minor}-sieve-${sieve_version}"
+ fi
+ fi
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed"
+
+ if use sieve; then
+ cd "../dovecot-${major_minor}-sieve-${sieve_version}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed"
+
+ if use managesieve; then
+ cd "../dovecot-${major_minor}-managesieve-${managesieve_version}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "make failed"
+ fi
+ fi
+}
+
+src_install () {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ # insecure:
+ #use suid && fperms u+s /usr/libexec/dovecot/deliver
+ #better:
+ if use suid;then
+ einfo "Changing perms to allow deliver to be suided"
+ fowners root:mail /usr/libexec/dovecot/deliver
+ fperms 4750 /usr/libexec/dovecot/deliver
+ fi
+
+ rm -f "${D}"/etc/dovecot/dovecot-{ldap,sql}-example.conf
+
+ newinitd "${FILESDIR}"/dovecot.init-r2 dovecot
+
+ rm -rf "${D}"/usr/share/doc/dovecot
+
+ if use ssl; then
+ sed -i -e 's,^CERTDIR=.*,CERTDIR=\$SSLDIR/dovecot,' \
+ -e 's,^KEYDIR=.*,KEYDIR=\$SSLDIR/dovecot,' \
+ -e 's,^CERTFILE=.*,CERTFILE=\$CERTDIR/server.pem,' \
+ -e 's,^KEYFILE=.*,KEYFILE=\$KEYDIR/server.key,' \
+ doc/mkcert.sh || die "failed to update SSL settings in mkcert.sh"
+ fi
+
+ dodoc AUTHORS NEWS README TODO dovecot-example.conf || die "basic dodoc failed"
+ dodoc doc/* || die "dodoc doc/ failed"
+ docinto wiki
+ dodoc doc/wiki/* || die "dodoc doc/wiki/ failed"
+
+ # Create the dovecot.conf file from the dovecot-example.conf file that
+ # the dovecot folks nicely left for us....
+ local conf="${D}/etc/dovecot/dovecot.conf"
+ mv "${D}"/etc/dovecot/dovecot-example.conf "${D}"/etc/dovecot/dovecot.conf
+
+ # .maildir is the Gentoo default, but we need to support mbox to
+ local mail_location="maildir:~/.maildir"
+ if use mbox; then
+ mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
+ keepdir /var/dovecot
+ sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' "${conf}"
+ fi
+ sed -i -e \
+ "s|#mail_location =|mail_location = ${mail_location}|" "${conf}" \
+ || die "failed to update mail location settings in dovecot.conf"
+
+ # We're using pam files (imap and pop3) provided by mailbase
+ if use pam; then
+ sed -i -e '/passdb pam/, /^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
+ "${conf}" || die "failed to update PAM settings in dovecot.conf"
+ # mailbase does not provide a managesieve pam file
+ use managesieve && dosym imap /etc/pam.d/managesieve
+ fi
+
+ # Listen on ipv6 and ipv4
+ if use ipv6; then
+ sed -i -e 's/^#listen = \*/listen = \*, \[::\]/g' "${conf}" \
+ || die "failed to update listen settings in dovecot.conf"
+ fi
+
+ # Update ssl cert locations
+ if use ssl; then
+ sed -i -e 's,^#ssl_cert_file =.*,ssl_cert_file = /etc/ssl/dovecot/server.pem,' \
+ -e 's,^#ssl_key_file =.*,ssl_key_file = /etc/ssl/dovecot/server.key,' \
+ "${conf}" || die "failed to update SSL settings in dovecot.conf"
+ fi
+
+ # Install SQL configuration
+ if use mysql || use postgres; then
+ cp doc/dovecot-sql-example.conf "${D}"/etc/dovecot/dovecot-sql.conf
+ fperms 600 /etc/dovecot/dovecot-sql.conf
+ sed -i -e '/db sql/,/args/ s|=|= /etc/dovecot-sql.conf|' "${conf}" \
+ || die "failed to update SQL settings in dovecot-sql.conf"
+ dodoc doc/dovecot-sql-example.conf
+ fi
+
+ # Install LDAP configuration
+ if use ldap; then
+ cp doc/dovecot-ldap-example.conf "${D}"/etc/dovecot/dovecot-ldap.conf
+ fperms 600 /etc/dovecot/dovecot-ldap.conf
+ sed -i -e '/db ldap/,/args/ s|=|= /etc/dovecot-ldap.conf|' "${conf}" \
+ || die "failed to update LDAP settings in dovecot-ldap.conf"
+ dodoc doc/dovecot-ldap-example.conf
+ fi
+
+ if use sieve; then
+ cd "../dovecot-${major_minor}-sieve-${sieve_version}"
+ emake DESTDIR="${D}" install || die "make install failed (sieve)"
+
+ if use managesieve; then
+ cd "../dovecot-${major_minor}-managesieve-${managesieve_version}"
+ emake DESTDIR="${D}" install || die "make install failed (managesieve)"
+ fi
+ fi
+
+ dodir /var/run/dovecot
+ fowners root:root /var/run/dovecot
+ fperms 0755 /var/run/dovecot
+ keepdir /var/run/dovecot/login
+ fowners root:dovecot /var/run/dovecot/login
+ fperms 0750 /var/run/dovecot/login
+
+ ewarn "If you are upgrading from Dovecot 1.1, read "
+ ewarn " http://wiki.dovecot.org/Upgrading/1.2"
+ if use sieve; then
+ ewarn " http://wiki.dovecot.org/LDA/Sieve/Dovecot#Migration_from_CMUSieve"
+ ewarn " In particular, do not forget to change cmusieve to sieve"
+ fi
+}
+
+
+pkg_postinst() {
+
+ if use ssl; then
+ # Let's not make a new certificate if we already have one
+ if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
+ -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
+ einfo "Creating SSL certificate"
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
+ install_cert /etc/ssl/dovecot/server
+ chown dovecot:mail "${ROOT}"/etc/ssl/dovecot/server.{key,pem}
+ fi
+ fi
+
+ if grep -q '^ssl_key_password' "${ROOT}"/etc/dovecot/dovecot.conf; then
+ echo
+ ewarn "You have set ssl_key_password in dovecot.conf!"
+ ewarn "You are URGED to read the advice in the current"
+ ewarn "dovecot.conf regarding sensible handling of that"
+ ewarn "password, as it might be readable by any user"
+ ewarn "on your system who can access that file!"
+ fi
+
+}