PKGBUILD 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Maintainer (Arch): AndyRTR <andyrtr@archlinux.org>
  2. # Contributor (Arch): tobias <tobias@archlinux.org>
  3. # Contributor (Arch): Low Kian Seong <fastmail_low@speedymail.org>
  4. # Maintainer: Luke Shumaker <lukeshu@parabola.nu>
  5. # Justification for being in [libre]: The source tarball contains
  6. # nonfree documentation files. This does not affect the resulting
  7. # package, but it is an FSDG violation, so we must repack the source
  8. # tarball.
  9. pkgname=bogofilter
  10. pkgver=1.2.4
  11. pkgrel=4
  12. pkgrel+=.par1
  13. pkgdesc="A fast Bayesian spam filtering tool, without noncommercial files"
  14. _srcrel=1 # increment this to rebuild the sourceball without bumping pkgver
  15. pkgdesc="A fast Bayesian spam filtering tool"
  16. arch=('x86_64')
  17. arch+=('i686' 'armv7h')
  18. license=('GPL3')
  19. url="http://bogofilter.sourceforge.net"
  20. depends=('db' 'perl' 'gsl') # 'sqlite'
  21. makedepends=('valgrind' 'xmlto')
  22. backup=('etc/bogofilter/bogofilter.cf')
  23. source=(https://repo.parabola.nu/other/bogofilter-libre/${pkgname}-${pkgver}-libre${_srcrel}.tar.gz
  24. bogofilter-1.2.4-test-env.patch)
  25. sha256sums=('6637eb34f41f99b1c1caf839589896ef0070f2063ad5fe2b3a849be08f64310e'
  26. 'e24638d2187074f48cfc19e1146b5f5b37167fa3c6576e2f8920295414fbfe0c')
  27. replaces=(bogofilter-libre)
  28. conflicts=(bogofilter-libre)
  29. mksource=(https://sourceforge.net/projects/${pkgname}/files/${pkgname}-current/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.bz2)
  30. mksha256sums=('e10287a58d135feaea26880ce7d4b9fa2841fb114a2154bf7da8da98aab0a6b4')
  31. mksource() {
  32. # Several of the documentation files are nonfree
  33. rm "${srcdir}/${pkgname}-${pkgver}"/doc/bogofilter-SA-{2005-0{1,2},2010-01}
  34. }
  35. # keep Berkeley DB as backend for now
  36. # sqlite3 based backend doesn't allow
  37. # to use db-transaction option that is
  38. # used to bf_compact the wordlist.db
  39. # other backend aren't available
  40. # currently in Arch repos
  41. prepare() {
  42. cd ${pkgname}-${pkgver}
  43. # taken from Gentoo
  44. patch -Np1 -i $srcdir/bogofilter-1.2.4-test-env.patch
  45. chmod +x src/tests/t.{ctype,leakfind,lexer.qpcr,lexer.eoh,message_id,queue_id}
  46. autoreconf -vfi
  47. }
  48. build() {
  49. cd ${pkgname}-${pkgver}
  50. ./configure --prefix=/usr \
  51. --sysconfdir=/etc/bogofilter \
  52. --localstatedir=/var \
  53. --enable-transactions \
  54. --with-database=db #--help
  55. make
  56. }
  57. check() {
  58. cd $pkgname-$pkgver
  59. BF_RUN_VALGRIND=1 make -k -C src check || /bin/true
  60. }
  61. package() {
  62. cd ${pkgname}-${pkgver}
  63. make DESTDIR="${pkgdir}" install
  64. mv "${pkgdir}/etc/bogofilter/bogofilter.cf.example" "${pkgdir}/etc/bogofilter/bogofilter.cf"
  65. install -dm755 "${pkgdir}/usr/share/${pkgname}/contrib"
  66. install -m644 contrib/* "${pkgdir}/usr/share/${pkgname}/contrib/"
  67. }