archrelease: copy trunk to extra-x86_64
[arch-packages.git] / bogofilter / trunk / PKGBUILD
blobc3199ff10b7bed3878c0f0c6ff82c195f4a1b9d7
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
2 # Contributor: tobias <tobias@archlinux.org>
3 # Contributor: Low Kian Seong <fastmail_low@speedymail.org>
5 pkgname=bogofilter
6 pkgver=1.2.5
7 pkgrel=7
8 pkgdesc="A fast Bayesian spam filtering tool"
9 arch=('x86_64')
10 license=('GPL3')
11 url="https://bogofilter.sourceforge.io/"
12 depends=('db5.3' 'perl' 'gsl') # 'sqlite'
13 makedepends=('valgrind' 'xmlto')
14 backup=('etc/bogofilter/bogofilter.cf')
15 source=(https://downloads.sourceforge.net/project/${pkgname}/${pkgname}-stable/${pkgname}-${pkgver}.tar.xz{,.asc}
16         bdb_5.3.patch) # asc file doesn't  work with pacman
17 sha1sums=('c779c3afb3e57ae0208ee503a854aff716b0cafd'
18           'SKIP'
19           'd42a6517a4d90835f1d54517056e704f7c01ea19')
20 sha256sums=('3248a1373bff552c500834adbea4b6caee04224516ae581fb25a4c6a6dee89ea'
21             'SKIP'
22             '5adb184d81a302ec13cf6320ce30ef177432ba346373b56febf5ab9b1f449999')
23 validpgpkeys=('DC4A655BD993CD4871FA8210E412B156EFF3855A') # "Matthias Andree <mandree@FreeBSD.org>"
25 # note: build system doesn't allow easy overlinking prevention - no libtool hack possible
27 prepare() {
28   cd "$pkgname-$pkgver"
29   patch -Np1 -i ../bdb_5.3.patch
30   autoreconf -vfi 
33 # keep Berkeley DB as backend for now
34 # sqlite3 based backend doesn't allow
35 # to use db-transaction option that is
36 # used to bf_compact the wordlist.db
37 # other backend aren't available 
38 # currently in Arch repos
39 # as of 1.2.5 new backend can be KyotoCabinet and lmdb
41 build() {
42   cd "${pkgname}"-${pkgver}
43   ./configure CFLAGS="$CFLAGS -I/usr/include/db5.3" \
44               --prefix=/usr \
45               --sysconfdir=/etc/bogofilter  \
46               --localstatedir=/var \
47               --enable-transactions \
48               --with-database=db  #--help
49   make
52 check() {
53   cd "$pkgname"-$pkgver
54   BF_RUN_VALGRIND=1 make -k -C src check || /bin/true
57 package() {
58   cd "${pkgname}"-${pkgver}
59   make DESTDIR="${pkgdir}" install
61   mv "${pkgdir}/etc/bogofilter/bogofilter.cf.example" "${pkgdir}/etc/bogofilter/bogofilter.cf"
63   install -dm755 "${pkgdir}/usr/share/${pkgname}/contrib"
64   install -m644 contrib/* "${pkgdir}/usr/share/${pkgname}/contrib/"
65   rm "${pkgdir}"/usr/share/${pkgname}/contrib/bogogrep.o