aboutsummaryrefslogtreecommitdiffstats
path: root/main/spamassassin/APKBUILD
blob: 31c3ffb3901328bb375df39c3c767c04fce498fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=spamassassin
_pkgreal=Mail-SpamAssassin
pkgver=3.4.1
pkgrel=3
pkgdesc="The Powerful #1 Open-Source Spam Filter"
url="http://search.cpan.org/dist/Mail-SpamAssassin/"
arch="noarch"
license="apache_2_0"
cpandepends="perl-html-parser perl-digest-sha1 perl-netaddr-ip perl-net-dns perl-mail-dkim
	perl-mime-base64 perl-db_file perl-time-hires perl-libwww"
cpanmakedepends="$cpandepends"
depends="perl-mail-$pkgname"
makedepends="perl-dev $cpanmakedepends"
subpackages="$pkgname-doc $pkgname-client $pkgname-compiler perl-mail-$pkgname:cpan"
source="http://search.cpan.org/CPAN/authors/id/K/KM/KMCGRAIL/${_pkgreal#*-}/$_pkgreal-$pkgver.tar.gz
	spamd.initd
	spamd.confd
	spamd.crond
	"

_builddir="$srcdir"/$_pkgreal-$pkgver

prepare() {
	cd "$_builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	rm t/dnsbl_subtests.t
}

build() {
	cd "$_builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make && make test || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
	install -Dm755 "$srcdir"/spamd.crond "$pkgdir"/etc/periodic/daily/$pkgname-update
	install -Dm755 "$srcdir"/spamd.initd "$pkgdir"/etc/init.d/spamd
	install -Dm644 "$srcdir"/spamd.confd "$pkgdir"/etc/conf.d/spamd
	mkdir -p "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/spamd "$pkgdir"/usr/sbin/spamd
}

client() {
	arch="all"
	depends=""
	pkgdesc="SpamAssassin client"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/spamc "$subpkgdir"/usr/bin
}

compiler() {
	pkgdesc="SpamAssassin rules compiler"
	depends="re2c gcc perl-dev perl-mail-$pkgname"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/sa-compile "$subpkgdir"/usr/bin/
}

cpan() {
	pkgdesc="SpamAssassin perl library"
	depends="perl gnupg $cpandepends"
	mkdir -p "$subpkgdir"/usr "$subpkgdir"/etc "$subpkgdir"/var/lib/$pkgname
	mv "$pkgdir"/etc/mail "$subpkgdir"/etc
	mv "$pkgdir"/usr/lib "$pkgdir"/usr/share "$subpkgdir"/usr
	find "$subpkgdir" -name *.pod -delete
	mv "$subpkgdir"/usr/share/$pkgname/user_prefs.template \
		"$subpkgdir"/etc/mail/$pkgname/user_prefs
	sed -i '/^#\*/d' "$subpkgdir"/etc/mail/$pkgname/user_prefs
}

md5sums="76eca1f38c11635d319e62c26d5b034b  Mail-SpamAssassin-3.4.1.tar.gz
c3c92982a4631b2d43f501537852e532  spamd.initd
d72f889cdbcd1289b773db3c00651a9c  spamd.confd
d11273ff56e329842174cc1f68e91555  spamd.crond"
sha256sums="9b7a95a594cdca4f265707364478b57813b82a0ec7e520d9bc818bfbcafdd726  Mail-SpamAssassin-3.4.1.tar.gz
163599ac085244ea626613ca55fcb75c1b7591a6e72f801869943e8e17556d95  spamd.initd
6533298faf4b0f50f9d7fcf32d60366c02ecc27deeb2725265035fe3267277f5  spamd.confd
39487360aa9ee536e6f04f8fb86ed755f0536143b792f134667e5cd2a0e0846b  spamd.crond"
sha512sums="6a074f1a4177e1969cef575fe3b1b844d27c813d48fe1e07a46f56ffa728fc780897597d00f11acb269317a6308f284f0dee544d504da874d93b0549d094a6a3  Mail-SpamAssassin-3.4.1.tar.gz
75189ee20fc6cb006af3ced26030cdd2d4fe7052b1eea123a7104c57d162e2c429ed0efb68f15e0be48f38c0a383a9956db26ba188d74d89850a2f83c60fd421  spamd.initd
274d3aa0d9aab05e83c8d5ad3e93a457649360021a67c8cb19088365bed681ebe26889cfa86f8c46a6044c7ee969231f2a71e3227adf8ad9e38d0286b9caf48d  spamd.confd
c8c00e4281cefd5e5e15507c8890264a25aa59663c57ccdf7a77905e2550999cfbbfa7271189a9491b0a0e98dff432361f13becdb99e1b583cd9d45d68022a47  spamd.crond"