1 # Maintainer: Florian Pritz <bluewind@xinu.at>
2 # Contributor: Dale Blount <dale@archlinux.org>
3 # Contributor: Manolis Tzanidakis
7 pkgdesc="A mail filter to identify spam."
10 url="https://spamassassin.apache.org"
11 depends=('openssl' 'zlib' 're2c' 'perl-net-dns' 'perl-io-socket-ssl'
12 'perl-libwww' 'perl-mail-spf' 'perl-http-message' 'perl-net-http'
13 'perl-io-socket-inet6' 'perl-mail-dkim' 'perl-crypt-ssleay')
14 makedepends=('razor' 'perl-dbi')
15 optdepends=('razor: to identify collaborately-flagged spam'
16 'make: to use sa-compile'
17 'gcc: to use sa-compile')
18 backup=('etc/mail/spamassassin/local.cf'
19 'etc/mail/spamassassin/init.pre'
20 'etc/mail/spamassassin/v310.pre'
21 'etc/mail/spamassassin/v312.pre'
22 'etc/mail/spamassassin/v320.pre'
23 'etc/mail/spamassassin/v330.pre'
24 'etc/mail/spamassassin/v340.pre'
25 'etc/mail/spamassassin/v341.pre'
26 'etc/mail/spamassassin/v342.pre'
27 'etc/mail/spamassassin/v343.pre')
28 install="${pkgname}.install"
29 source=("https://ftp.fau.de/apache/${pkgname}/source/Mail-SpamAssassin-${pkgver}.tar.gz"
30 "https://www.apache.org/dist/${pkgname}/source/Mail-SpamAssassin-${pkgver}.tar.gz.asc"
31 'spamassassin.tmpfiles.d'
32 'spamassassin.service')
33 validpgpkeys=(D8099BC79E17D7E49BC21E31FDE52F40F7D39814)
34 sha512sums=('7910852f04463a7363a2fc3b70a35adadf5714552e57c5b8ca57beaa534ee18d9f06526cdbcf8bcd5781e5ca778f98d2f84ef2efd1872fa550cfe1689440364a'
36 '994ebb2b6c127521676f35879017112a33da53ad99431837d06973a9abfc4aa0434ea2c9b19073ff2cc877ebe3a5a7fe8525bc93222fd05956069ce73e5ae389'
37 '5ad6aa8d992375b0989413d36ff0485f792ac9211a47e6a2a7fa5c0b9eb353aa6efe6f55da3ff4480bdef24beb4fa456c64c5a5ce72e8ad6c93c171c969fd6ee')
40 cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
42 sed -i t/sa_compile.t \
43 -e 's#^my $temp_binpath = $Config{sitebinexp};#my $temp_binpath = "/bin/site_perl/";#'
47 cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
49 # install module in vendor directories.
50 export PERL_USE_UNSAFE_INC=1
51 PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor \
52 CONTACT_ADDRESS=root@localhost ENABLE_SSL=yes PERL_TAINT=no
57 cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
59 # parallel tests cause lots of failures; disable for now
60 #export HARNESS_OPTIONS="j$(echo $MAKEFLAGS | sed 's/.*-j\([0-9][0-9]*\).*/\1/')"
66 cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
67 make DESTDIR="${pkgdir}" install
69 install -D -m644 "${srcdir}/spamassassin.service" "${pkgdir}/usr/lib/systemd/system/spamassassin.service"
70 install -d -o 182 -g 182 -m 755 "$pkgdir/var/lib/spamassassin"
72 echo 'u spamd 182 - /var/lib/spamassassin' |
73 install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
75 install -Dm644 "$srcdir/spamassassin.tmpfiles.d" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
78 for file in "$pkgdir/etc/mail/spamassassin/"*.pre; do
79 clean_file="${file#"$pkgdir/"}"
80 if ! in_array "$clean_file" "${backup[@]}"; then
81 echo "ERROR: backup array is missing an entry for '$clean_file'" >&2
85 if ((backup_incomplete)); then