diff options
author | Patrick Lauer <patrick@gentoo.org> | 2009-09-12 13:10:28 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2009-09-12 13:10:28 +0000 |
commit | ddc2cc935da0b3e2975971f7fe546da66763f170 (patch) | |
tree | a77692d27ea0237d94838cb7f11aafa9c28efb10 /mail-filter/dovecot-antispam | |
parent | Migrate to EAPI 2 in order to nuke built_with_use call. (diff) | |
download | gentoo-2-ddc2cc935da0b3e2975971f7fe546da66763f170.tar.gz gentoo-2-ddc2cc935da0b3e2975971f7fe546da66763f170.tar.bz2 gentoo-2-ddc2cc935da0b3e2975971f7fe546da66763f170.zip |
Bump to 1.2. Fixes compilation issues with dovecot-1.2. Thanks to Oliver Sucker and Dennis Schridde for the patch. Closes #276111
(Portage version: 2.2_rc40/cvs/Linux x86_64)
Diffstat (limited to 'mail-filter/dovecot-antispam')
3 files changed, 125 insertions, 1 deletions
diff --git a/mail-filter/dovecot-antispam/ChangeLog b/mail-filter/dovecot-antispam/ChangeLog index 45e0b697fe16..3daf2ff6b9f2 100644 --- a/mail-filter/dovecot-antispam/ChangeLog +++ b/mail-filter/dovecot-antispam/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for mail-filter/dovecot-antispam # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dovecot-antispam/ChangeLog,v 1.14 2009/09/12 12:58:57 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dovecot-antispam/ChangeLog,v 1.15 2009/09/12 13:10:28 patrick Exp $ + +*dovecot-antispam-1.2 (12 Sep 2009) + + 12 Sep 2009; Patrick Lauer <patrick@gentoo.org> + +files/dovecot-antispam-dovecot1.2-compilefix.patch, + +dovecot-antispam-1.2.ebuild: + Bump to 1.2. Fixes compilation issues with dovecot-1.2. Thanks to Oliver + Sucker and Dennis Schridde for the patch. Closes #276111 12 Sep 2009; Patrick Lauer <patrick@gentoo.org> dovecot-antispam-1.1.ebuild: diff --git a/mail-filter/dovecot-antispam/dovecot-antispam-1.2.ebuild b/mail-filter/dovecot-antispam/dovecot-antispam-1.2.ebuild new file mode 100644 index 000000000000..8983e6c18aca --- /dev/null +++ b/mail-filter/dovecot-antispam/dovecot-antispam-1.2.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dovecot-antispam/dovecot-antispam-1.2.ebuild,v 1.1 2009/09/12 13:10:28 patrick Exp $ + +EAPI="1" + +inherit confutils + +DESCRIPTION="A dovecot antispam plugin supporting multiple backends" +HOMEPAGE="http://johannes.sipsolutions.net/Projects/dovecot-antispam" +SRC_URI="http://johannes.sipsolutions.net/download/dovecot-antispam/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug +dspam crm114 mailtrain signature-log syslog" + +DEPEND="net-mail/dovecot + dspam? ( mail-filter/dspam ) + crm114? ( app-text/crm114 )" +RDEPEND="${DEPEND}" + +# we need this to prevent errors from dovecot-config +top_builddir() { + return +} + +pkg_setup() { + confutils_require_one dspam signature-log mailtrain crm114 + confutils_use_depend_all syslog debug +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # make it compile with dovecot 1.2 + epatch "${FILESDIR}"/dovecot-antispam-dovecot1.2-compilefix.patch +} + +src_compile() { + source "${ROOT}"/usr/lib/dovecot/dovecot-config || \ + die "cannot find dovecot-config" + + echo DOVECOT=${dovecot_incdir} > .config + echo INSTALLDIR=${moduledir}/imap/ >> .config + echo PLUGINNAME=antispam >> .config + echo USER=root >> .config + echo GROUP=root >> .config + + use dspam && echo BACKEND=dspam-exec >> .config + use signature-log && echo BACKEND=signature-log >> .config + use mailtrain && echo BACKEND=mailtrain >> .config + use crm114 && echo BACKEND=crm114-exec >> .config + + if use debug; then + if use syslog; then + echo DEBUG=syslog >> .config + else + echo DEBUG=stderr >> .config + fi + fi + + emake || die "make failed" +} + +src_install() { + source "${ROOT}"/usr/lib/dovecot/dovecot-config || \ + die "cannot find dovecot-config" + + dodir "${moduledir}"/imap/ + make DESTDIR="${D}" install || die "make install failed" + + newman antispam.7 dovecot-antispam.7 + dodoc NOTES README +} diff --git a/mail-filter/dovecot-antispam/files/dovecot-antispam-dovecot1.2-compilefix.patch b/mail-filter/dovecot-antispam/files/dovecot-antispam-dovecot1.2-compilefix.patch new file mode 100644 index 000000000000..e1de0c14c0e6 --- /dev/null +++ b/mail-filter/dovecot-antispam/files/dovecot-antispam-dovecot1.2-compilefix.patch @@ -0,0 +1,40 @@ +From af0f8f8de27901e2efb9560a1fc66c7af3cd810b Mon Sep 17 00:00:00 2001 +From: Johannes Berg <johannes@sipsolutions.net> +Date: Thu, 2 Jul 2009 14:17:54 +0200 +Subject: [PATCH 1/1] make it compile with dovecot 1.2 + +--- + antispam-plugin.h | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +diff --git a/antispam-plugin.h b/antispam-plugin.h +index df59e88..493fd1e 100644 +--- a/antispam-plugin.h ++++ b/antispam-plugin.h +@@ -113,11 +113,23 @@ o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED) + return o_stream_create_fd(fd, 0, TRUE); + } + ++#if DOVECOT_VERSION_CODE(1, 2) == DOVECOT_VERSION ++# include <stdlib.h> ++static inline struct dict * ++string_dict_init(const char *uri, const char *username) ++{ ++ const char *base_dir = getenv("BASE_DIR"); ++ if (base_dir == NULL) ++ base_dir = "/var/run/dovecot"; ++ return dict_init(uri, DICT_DATA_TYPE_STRING, username, base_dir); ++} ++#else /* 1.1 */ + static inline struct dict * + string_dict_init(const char *uri, const char *username) + { + return dict_init(uri, DICT_DATA_TYPE_STRING, username); + } ++#endif + #elif DOVECOT_VERSION_CODE(1, 0) == DOVECOT_VERSION + #define ME(err) + #define PLUGIN_ID +-- +1.6.3.3 + |