# Contributor: Elias Werberich <elias@werberich.de>
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=amavisd-milter
pkgver=1.7.2
pkgrel=0
pkgdesc="sendmail milter for amavisd-new using the AM.PDP protocol"
url="https://github.com/prehor/amavisd-milter"
arch="all"
license="BSD-3-Clause"
depends="amavis"
makedepends="libmilter-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="
	https://github.com/prehor/amavisd-milter/releases/download/$pkgver/amavisd-milter-$pkgver.tar.gz
	amavisd-milter.initd
	amavisd-milter.confd
	"

prepare() {
	default_prepare

	update_config_sub
	chmod +x aclocal/install-sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-dependency-tracking
	make
}

check() {
	make check
}

package() {
	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="
639a5a4f92131f9b8d004255819e36dedd529ec95f8290663c6ea5860dbbce049a822ba0e68158228716778265009b93024e9102defdf9250d4e889157008181  amavisd-milter-1.7.2.tar.gz
3f631248da7ecc36790123bad82b0d17a110947dd84aa03fc1e81c3ed99db43ae52d3cef10c048a9147d86973a8d730494b6c289f96195dbafab2804538191fd  amavisd-milter.initd
f44ab528c65050e23a2e78dafd937dae5bc73bd83ff780d7a193d47744674f3991c9d1ae99c4fb8ce1762c50ed6ca5fb604eb2c4cf69fe2e27e8a4076b6f2eec  amavisd-milter.confd
"
