# Automatically generated by apkbuild-cpan, template 4
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-net-dns
pkgver=1.48
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Net-DNS
pkgdesc="Perl Interface to the Domain Name System"
url="https://metacpan.org/release/Net-DNS/"
arch="noarch"
license="MIT"
depends="perl perl-digest-hmac"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/N/NL/NLNETLABS/Net-DNS-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL \
		INSTALLDIRS=vendor \
		NO_PACKLIST=1 \
		NO_PERLLOCAL=1
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	local file; find "$pkgdir" -name "*.pod" | while read -r file; do
		amove "${file#"$pkgdir"}"
	done
	default_doc
}

sha512sums="
386cb9774ccb31359a65deb45b818d37f0dd55c397034f302171d181147ca90fb994ee38d841c5930e7dfd4e0f7157c6aa6ced0257aa334253cb3b9ee4b34187  Net-DNS-1.48.tar.gz
"
