# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=razor
_realname=razor-agents
pkgver=2.85
pkgrel=6
pkgdesc="Vipul's Razor is a distributed, collaborative spam detection and filtering network"
url="http://razor.sourceforge.net/"
arch="all"
license="Artistic"
depends="perl perl-digest-sha1 perl-getopt-long perl-uri"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/razor/razor-agents/$_realname-$pkgver.tar.bz2"
builddir="$srcdir/$_realname-$pkgver"

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

build() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make -j1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	cd "$builddir"
	make test
}

md5sums="014d08db40187cb1316482191566b012  razor-agents-2.85.tar.bz2"
sha256sums="7fe0afe73e5b3979444dd86e2ad25ea99bc05b23d5648d357544f78f0b6eb6d7  razor-agents-2.85.tar.bz2"
sha512sums="31dded1969dde963389a5939514c29638ad07f45dbb2f4c633cf20ebc4abab94e65e9a6d8885233cdde686ef365aab11fa5eba2ca38d79c5b8fab689143ff5db  razor-agents-2.85.tar.bz2"
