# Contributor: Elias Werberich <elias@werberich.de>
# Maintainer:
pkgname=amavisd-milter
pkgver=1.6.1
pkgrel=1
pkgdesc="sendmail milter for amavisd-new using the AM.PDP protocol"
url="http://amavisd-milter.sourceforge.net/"
arch="all"
license="BSD"
depends="amavisd-new libmilter"
makedepends="libmilter-dev"
subpackages="$pkgname-doc"
source="
	https://downloads.sourceforge.net/amavisd-milter/amavisd-milter/amavisd-milter-1.6.1/amavisd-milter-1.6.1.tar.gz
	amavisd-milter.initd
	amavisd-milter.confd
	"
builddir="$srcdir/${pkgname}-${pkgver}"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target="" \
		--prefix=/usr
	make
}

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

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="28f505a8e130e67decc6c6ff8526f82db24b1b27a11e69f1a112e3e6103f303d333743c2ceaf12bad86979c987cde64f41afb4794c1ca1222cf11a2c3b03c8a5  amavisd-milter-1.6.1.tar.gz
3e45a8766f6b5bbb089bcb508efe99d17f107d544b2d50d12437a6b7103e2ce143eef9c6ecc0e2a9ced37b153d122e1eb8f171e4000e4e56a7f2a210587c2d68  amavisd-milter.initd
f44ab528c65050e23a2e78dafd937dae5bc73bd83ff780d7a193d47744674f3991c9d1ae99c4fb8ce1762c50ed6ca5fb604eb2c4cf69fe2e27e8a4076b6f2eec  amavisd-milter.confd"
