# Automatically generated by apkbuild-cpan, template 4
# Contributor: Timothy Legge <timlegge@gmail.com>
# Maintainer: Timothy Legge <timlegge@gmail.com>
pkgname=perl-alien-build
pkgver=2.84
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Alien-Build
pkgdesc="Build external dependencies for use in CPAN"
url="https://metacpan.org/release/Alien-Build/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-file-chdir perl-path-tiny perl-capture-tiny perl-ffi-checklib perl-file-which"
makedepends="perl-dev perl-file-which"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-Build-$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="
48f67543e44651f73d4f7668ea4e34d2b522cf8ca6cf4eb0713f13809d5876ed1c1439340e3f0277cac989e17bc03fc0d7671bc26272a39e7fbeb7cef5862784  Alien-Build-2.84.tar.gz
"
