# Automatically generated by apkbuild-cpan, template 3
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=perl-local-lib
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=local-lib
pkgver=2.000029
pkgrel=0
pkgdesc="Create and use a local lib/ directory for Perl modules with PERL5LIB"
url="https://metacpan.org/release/local-lib/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-module-build"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-$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="
4b5370fed9975b702aa13bb58665f4b05f60e5665ec01be2051d5cc38d9953199bce9ad62788689c2520b5b0d84c438458f78728fd2e6915447dc1c8678978b1  local-lib-2.000029.tar.gz
"
