# 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.901
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="
510a3f76ada26eb4b04d72e195ddcfac75d8948a2e74ede6fe3de00d1d799f08563ac22c44c38e2a82ec438c3ee110f94386298d1db0305ce6ad801e40f6e667  MCE-1.901.tar.gz
"
