# Automatically generated by apkbuild-cpan, template 4
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-mce
pkgver=1.900
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=MCE
pkgdesc="Many-Core Engine for Perl providing parallel processing capabilities"
url="https://metacpan.org/release/MCE/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MA/MARIOROY/MCE-$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="
b9924275d478dfeffbf739744da19806cf6a51d5b9ee0038df02b39318cbf28cc026b8d05d0c9c6f0381ae93f39573a307f741f595bc1558c34bf2a7e35b5845  MCE-1.900.tar.gz
"
