# Automatically generated by apkbuild-cpan, template 3
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-module-cpanfile
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Module-CPANfile
pkgver=1.1004
pkgrel=0
pkgdesc="Parse cpanfile"
url="https://metacpan.org/release/Module-CPANfile/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
checkdepends="perl-file-pushd"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/Module-CPANfile-$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
	make
}

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

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

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

sha512sums="
cb2261c3d055d8010955456b8dfdb3abbc07318b1c7ff72848788e3d24f15ecf39ede28f84a30b391a5d52bb5d92eab2ab0af6d7d53a5723be2d23bff074d6cb  Module-CPANfile-1.1004.tar.gz
"
