# Automatically generated by apkbuild-cpan, template 2
# Contributor: 
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-net-dns-resolver-mock
_pkgreal=Net-DNS-Resolver-Mock
pkgver=1.20170814
pkgrel=0
pkgdesc="Mock a DNS Resolver object for testing"
url="http://search.cpan.org/dist/Net-DNS-Resolver-Mock/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-net-dns"
cpanmakedepends=""
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/M/MB/MBRADSHAW/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

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

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

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

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

sha512sums="a1394b83d12dea9d34aea7b1b7378db1e0cce955359051e41bbaa4d656f9a603ee998b6a9f29a71524b8abde94619624b681fc72f620ec23eb471a3f06cde82f  Net-DNS-Resolver-Mock-1.20170814.tar.gz"
