# Automatically generated by apkbuild-cpan, template 3
# Maintainer:
pkgname=perl-sys-cpu
pkgver=0.61
pkgrel=4
pkgdesc="Perl extension for getting CPU information"
url="https://metacpan.org/release/MZSANFORD/Sys-CPU"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MZ/MZSANFORD/Sys-CPU-$pkgver.tar.gz
	unistd.patch
	Sys-CPU.t
	"
builddir="$srcdir/Sys-CPU-$pkgver"

prepare() {
	default_prepare
	cp -v "$srcdir"/Sys-CPU.t t/
}

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
}

sha512sums="
391e113c87d9044cd43c47f9f78a782fab65566a32c028c01f7f3335a5065b6755586ea3143356510c8d28a7d1ad572cc6203ec189eaaa379967bdbd0a0bd7bc  Sys-CPU-0.61.tar.gz
9ae2b76b389e65fdd4331bb97be3e2d7409fa217d53114c8ee00c258d6dde194b1d13981fce0cd0b6d6b7e6fefce9b9527128b75eac043de200e0671e4b6f34a  unistd.patch
6572ee86b9d11a520466cd178c973d16e99eff3c8c750d54ccf09454a61cb53e617c7d5520ba55094437ef350cf63c695f7875f4971df951c87c8e0f6cba9f99  Sys-CPU.t
"
