# Automatically generated by apkbuild-cpan, template 4
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-test-files
pkgver=0.26
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Test-Files
pkgdesc="Test::Builder based module to ease testing with files and dirs"
url="https://metacpan.org/release/Test-Files/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="
	perl perl-class-xsaccessor perl-const-fast perl-data-compare
	perl-file-chdir perl-padwalker perl-path-tiny perl-text-diff
	"
checkdepends="
	perl-archive-zip perl-file-copy-recursive perl-test-expander
	"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/J/JS/JSF/Test-Files-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

	rm -v lib/.perlcriticrc
}

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="
72bdac0290230993b5364ee674d5b8289feef5f98abb0a9595574e49642be1183fd0dace03693e63ca001ea9131d2f1e8f7625843fb00e9fcce321d5e5149aec  Test-Files-0.26.tar.gz
"
