# 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.49
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="
6976e01ee1e790f897635021dd2364131657455364eada7b8cdf0f0d975216007bfadbff01eeff89ad5c744e73bc22ebe01ec753b5751df12d7b799d7cae2107  Net-DNS-1.49.tar.gz
"
