summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Veller <tove@gentoo.org>2010-04-12 18:01:05 +0000
committerTorsten Veller <tove@gentoo.org>2010-04-12 18:01:05 +0000
commit4e79270027157a98ab64827b6ac1855ff8fb375d (patch)
treeddc2980289fd6fe02ea4a22878646ad78c0d10ed /mail-filter/bogofilter
parentremove unused use flag (diff)
downloadgentoo-2-4e79270027157a98ab64827b6ac1855ff8fb375d.tar.gz
gentoo-2-4e79270027157a98ab64827b6ac1855ff8fb375d.tar.bz2
gentoo-2-4e79270027157a98ab64827b6ac1855ff8fb375d.zip
Add tokyocabinet support
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'mail-filter/bogofilter')
-rw-r--r--mail-filter/bogofilter/ChangeLog10
-rw-r--r--mail-filter/bogofilter/bogofilter-1.2.1-r1.ebuild109
-rw-r--r--mail-filter/bogofilter/metadata.xml1
3 files changed, 118 insertions, 2 deletions
diff --git a/mail-filter/bogofilter/ChangeLog b/mail-filter/bogofilter/ChangeLog
index a14794059784..7f64f7cc9ae0 100644
--- a/mail-filter/bogofilter/ChangeLog
+++ b/mail-filter/bogofilter/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for mail-filter/bogofilter
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/bogofilter/ChangeLog,v 1.128 2009/11/03 12:30:09 tove Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/bogofilter/ChangeLog,v 1.129 2010/04/12 18:01:05 tove Exp $
+
+*bogofilter-1.2.1-r1 (12 Apr 2010)
+
+ 12 Apr 2010; Torsten Veller <tove@gentoo.org> +bogofilter-1.2.1-r1.ebuild,
+ metadata.xml:
+ Add tokyocabinet support
03 Nov 2009; Torsten Veller <tove@gentoo.org> -bogofilter-1.2.0.ebuild:
Cleanup
diff --git a/mail-filter/bogofilter/bogofilter-1.2.1-r1.ebuild b/mail-filter/bogofilter/bogofilter-1.2.1-r1.ebuild
new file mode 100644
index 000000000000..d308f06ec8f3
--- /dev/null
+++ b/mail-filter/bogofilter/bogofilter-1.2.1-r1.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/bogofilter/bogofilter-1.2.1-r1.ebuild,v 1.1 2010/04/12 18:01:05 tove Exp $
+
+inherit db-use flag-o-matic
+
+DESCRIPTION="Bayesian spam filter designed with fast algorithms, and tuned for speed."
+HOMEPAGE="http://bogofilter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="berkdb sqlite tokyocabinet"
+
+DEPEND="virtual/libiconv
+ berkdb? ( >=sys-libs/db-3.2 )
+ !berkdb? (
+ sqlite? ( >=dev-db/sqlite-3.5.4 )
+ !sqlite? (
+ tokyocabinet? ( dev-db/tokyocabinet )
+ !tokyocabinet? ( >=sys-libs/db-3.2 )
+ )
+ )
+ sci-libs/gsl"
+# app-arch/pax" # only needed for bf_tar
+
+pkg_setup() {
+ has_version mail-filter/bogofilter || return 0
+ if ( use berkdb && ! has_version 'mail-filter/bogofilter[berkdb]' ) || \
+ ( ! use berkdb && has_version 'mail-filter/bogofilter[berkdb]' ) || \
+ ( use sqlite && ! has_version 'mail-filter/bogofilter[sqlite]' ) || \
+ ( ! use sqlite && has_version 'mail-filter/bogofilter[sqlite]' ) || \
+ ( has_version '>=mail-filter/bogofilter-1.2.1-r1' && \
+ ( use tokyocabinet && ! has_version 'mail-filter/bogofilter[tokyocabinet]' ) || \
+ ( ! use tokyocabinet && has_version 'mail-filter/bogofilter[tokyocabinet]' )
+ ) ; then
+ ewarn
+ ewarn "If you want to switch the database backend, you must dump the wordlist"
+ ewarn "with the current version (old use flags) and load it with the new version!"
+ ewarn
+ fi
+}
+
+src_compile() {
+ local myconf="" berkdb=true
+ myconf="--without-included-gsl"
+
+ # determine backend: berkdb *is* default
+ if use berkdb && use sqlite ; then
+ elog "Both useflags berkdb and sqlite are in USE:"
+ elog "Using berkdb as database backend."
+ elif use berkdb && use tokyocabinet ; then
+ elog "Both useflags berkdb and tokyocabinet are in USE:"
+ elog "Using berkdb as database backend."
+ elif use sqlite && use tokyocabinet ; then
+ elog "Both useflags sqlite and tokyocabinet are in USE:"
+ elog "Using sqlite as database backend."
+ myconf="${myconf} --with-database=sqlite"
+ berkdb=false
+ elif use sqlite ; then
+ myconf="${myconf} --with-database=sqlite"
+ berkdb=false
+ elif use tokyocabinet ; then
+ myconf="${myconf} --with-database=tokyocabinet"
+ berkdb=false
+ elif ! use berkdb ; then
+ elog "Neither berkdb nor sqlite nor tokyocabinet are in USE:"
+ elog "Using berkdb as database backend."
+ fi
+
+ # Include the right berkdb headers for FreeBSD
+ if ${berkdb} ; then
+ append-flags "-I$(db_includedir)"
+ fi
+
+ econf ${myconf} || die "configure failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ exeinto /usr/share/${PN}/contrib
+ doexe contrib/{bogofilter-qfe,parmtest,randomtrain}.sh \
+ contrib/{bfproxy,bogominitrain,mime.get.rfc822,printmaildir}.pl \
+ contrib/{spamitarium,stripsearch}.pl || die "doexec failed"
+
+ insinto /usr/share/${PN}/contrib
+ doins contrib/{README.*,dot-qmail-bogofilter-default} \
+ contrib/{bogogrep.c,bogo.R,bogofilter-milter.pl,*.example} \
+ contrib/vm-bogofilter.el \
+ contrib/{trainbogo,scramble}.sh || die "doins failed"
+
+ dodoc AUTHORS NEWS README RELEASE.NOTES* TODO GETTING.STARTED \
+ doc/integrating-with-* doc/README.{db,sqlite} || die "dodoc failed"
+
+ dohtml doc/*.html
+
+ dodir /usr/share/doc/${PF}/samples
+ mv "${D}"/etc/bogofilter.cf.example "${D}"/usr/share/doc/${PF}/samples/
+ rmdir "${D}"/etc
+}
+
+pkg_postinst() {
+ echo
+ elog "If you need \"${ROOT}usr/bin/bf_tar\" please install app-arch/pax."
+ echo
+}
diff --git a/mail-filter/bogofilter/metadata.xml b/mail-filter/bogofilter/metadata.xml
index 00acb1c62c7b..32d2b6ec580b 100644
--- a/mail-filter/bogofilter/metadata.xml
+++ b/mail-filter/bogofilter/metadata.xml
@@ -7,4 +7,5 @@
by a statistical analysis of the message's header and content (body). The
program is able to learn from the user's classifications and corrections.
</longdescription>
+<use><flag name="tokyocabinet">Enable Tokyo Cabinet database support</flag></use>
</pkgmetadata>