# Automatically generated by apkbuild-cpan, template 4
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=perl-graph
pkgver=0.9732
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Graph
pkgdesc="Perl module for Graph"
url="https://metacpan.org/release/Graph/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-heap perl-set-object"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/E/ET/ETJ/Graph-$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="
67d092b641942603c095af9305a919cc3b6dad811c6aa5dca55e85c2a8a7dc94c5957689eb473f03ab334611999d4b43902992f9d7596d9711cbd3f49beb4ac0  Graph-0.9732.tar.gz
"
