1 |
commit: b5749f59d491b07f85c359b9b1595e24e80db913 |
2 |
Author: Johannes Huber <johu <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 12 13:08:31 2020 +0000 |
4 |
Commit: Johannes Huber <johu <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 12 13:08:31 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5749f59 |
7 |
|
8 |
mail-filter/bogofilter: EAPI 7 |
9 |
|
10 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
11 |
Signed-off-by: Johannes Huber <johu <AT> gentoo.org> |
12 |
|
13 |
mail-filter/bogofilter/bogofilter-1.2.4-r3.ebuild | 131 ++++++++++++++++++++++ |
14 |
1 file changed, 131 insertions(+) |
15 |
|
16 |
diff --git a/mail-filter/bogofilter/bogofilter-1.2.4-r3.ebuild b/mail-filter/bogofilter/bogofilter-1.2.4-r3.ebuild |
17 |
new file mode 100644 |
18 |
index 00000000000..278f265ab73 |
19 |
--- /dev/null |
20 |
+++ b/mail-filter/bogofilter/bogofilter-1.2.4-r3.ebuild |
21 |
@@ -0,0 +1,131 @@ |
22 |
+# Copyright 1999-2020 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI=7 |
26 |
+ |
27 |
+inherit autotools db-use flag-o-matic toolchain-funcs |
28 |
+ |
29 |
+DESCRIPTION="Bayesian spam filter designed with fast algorithms, and tuned for speed" |
30 |
+HOMEPAGE="http://bogofilter.sourceforge.net/" |
31 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" |
32 |
+ |
33 |
+LICENSE="GPL-2" |
34 |
+SLOT="0" |
35 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86" |
36 |
+IUSE="berkdb sqlite tokyocabinet" |
37 |
+ |
38 |
+# pax needed for bf_tar |
39 |
+DEPEND=" |
40 |
+ app-arch/pax |
41 |
+ sci-libs/gsl:= |
42 |
+ virtual/libiconv |
43 |
+ berkdb? ( >=sys-libs/db-3.2:* ) |
44 |
+ !berkdb? ( |
45 |
+ sqlite? ( >=dev-db/sqlite-3.6.22 ) |
46 |
+ !sqlite? ( |
47 |
+ tokyocabinet? ( dev-db/tokyocabinet ) |
48 |
+ !tokyocabinet? ( >=sys-libs/db-3.2:* ) |
49 |
+ ) |
50 |
+ ) |
51 |
+" |
52 |
+RDEPEND="${DEPEND}" |
53 |
+ |
54 |
+PATCHES=( "${FILESDIR}/${P}-test-env.patch" ) |
55 |
+ |
56 |
+pkg_setup() { |
57 |
+ has_version mail-filter/bogofilter || return 0 |
58 |
+ if ( use berkdb && ! has_version 'mail-filter/bogofilter[berkdb]' ) || \ |
59 |
+ ( ! use berkdb && has_version 'mail-filter/bogofilter[berkdb]' ) || \ |
60 |
+ ( use sqlite && ! has_version 'mail-filter/bogofilter[sqlite]' ) || \ |
61 |
+ ( ! use sqlite && has_version 'mail-filter/bogofilter[sqlite]' ) || \ |
62 |
+ ( has_version '>=mail-filter/bogofilter-1.2.1-r1' && \ |
63 |
+ ( use tokyocabinet && ! has_version 'mail-filter/bogofilter[tokyocabinet]' ) || \ |
64 |
+ ( ! use tokyocabinet && has_version 'mail-filter/bogofilter[tokyocabinet]' ) |
65 |
+ ) ; then |
66 |
+ ewarn |
67 |
+ ewarn "If you want to switch the database backend, you must dump the wordlist" |
68 |
+ ewarn "with the current version (old use flags) and load it with the new version!" |
69 |
+ ewarn |
70 |
+ fi |
71 |
+} |
72 |
+ |
73 |
+src_prepare() { |
74 |
+ default |
75 |
+ |
76 |
+ # bug 445918 |
77 |
+ sed -i -e 's/ -ggdb//' configure.ac || die |
78 |
+ |
79 |
+ # bug 421747 |
80 |
+ chmod +x src/tests/t.{ctype,leakfind,lexer.qpcr,lexer.eoh,message_id,queue_id} || die |
81 |
+ |
82 |
+ # bug 654990 |
83 |
+ sed -i -e 's/t.bulkmode//' \ |
84 |
+ -e 's/t.dump.load//' \ |
85 |
+ -e 's/t.nonascii.replace//' \ |
86 |
+ src/tests/Makefile.am || die |
87 |
+ |
88 |
+ eautoreconf |
89 |
+} |
90 |
+ |
91 |
+src_configure() { |
92 |
+ local myconf="" berkdb=true |
93 |
+ myconf="--without-included-gsl" |
94 |
+ |
95 |
+ # determine backend: berkdb *is* default |
96 |
+ if use berkdb && use sqlite ; then |
97 |
+ elog "Both useflags berkdb and sqlite are in USE:" |
98 |
+ elog "Using berkdb as database backend." |
99 |
+ elif use berkdb && use tokyocabinet ; then |
100 |
+ elog "Both useflags berkdb and tokyocabinet are in USE:" |
101 |
+ elog "Using berkdb as database backend." |
102 |
+ elif use sqlite && use tokyocabinet ; then |
103 |
+ elog "Both useflags sqlite and tokyocabinet are in USE:" |
104 |
+ elog "Using sqlite as database backend." |
105 |
+ myconf="${myconf} --with-database=sqlite" |
106 |
+ berkdb=false |
107 |
+ elif use sqlite ; then |
108 |
+ myconf="${myconf} --with-database=sqlite" |
109 |
+ berkdb=false |
110 |
+ elif use tokyocabinet ; then |
111 |
+ myconf="${myconf} --with-database=tokyocabinet" |
112 |
+ berkdb=false |
113 |
+ elif ! use berkdb ; then |
114 |
+ elog "Neither berkdb nor sqlite nor tokyocabinet are in USE:" |
115 |
+ elog "Using berkdb as database backend." |
116 |
+ fi |
117 |
+ |
118 |
+ # Include the right berkdb headers for FreeBSD |
119 |
+ if ${berkdb} ; then |
120 |
+ append-cppflags "-I$(db_includedir)" |
121 |
+ fi |
122 |
+ |
123 |
+ econf ${myconf} |
124 |
+} |
125 |
+ |
126 |
+src_test() { |
127 |
+ emake -C src/ check |
128 |
+} |
129 |
+ |
130 |
+src_install() { |
131 |
+ emake DESTDIR="${D}" install |
132 |
+ |
133 |
+ exeinto /usr/share/${PN}/contrib |
134 |
+ doexe contrib/{bogofilter-qfe,parmtest,randomtrain}.sh \ |
135 |
+ contrib/{bfproxy,bogominitrain,mime.get.rfc822,printmaildir}.pl \ |
136 |
+ contrib/{spamitarium,stripsearch}.pl |
137 |
+ |
138 |
+ insinto /usr/share/${PN}/contrib |
139 |
+ doins contrib/{README.*,dot-qmail-bogofilter-default} \ |
140 |
+ contrib/{bogogrep.c,bogo.R,bogofilter-milter.pl,*.example} \ |
141 |
+ contrib/vm-bogofilter.el \ |
142 |
+ contrib/{trainbogo,scramble}.sh |
143 |
+ |
144 |
+ dodoc AUTHORS NEWS README RELEASE.NOTES* TODO GETTING.STARTED \ |
145 |
+ doc/integrating-with-* doc/README.{db,sqlite} |
146 |
+ |
147 |
+ dodoc -r doc/*.html |
148 |
+ |
149 |
+ dodir /usr/share/doc/${PF}/samples |
150 |
+ mv "${D}"/etc/bogofilter.cf.example "${D}"/usr/share/doc/${PF}/samples/ || die |
151 |
+ rmdir "${D}"/etc || die |
152 |
+} |