# Contributor: Wen Heping <wenheping2000@hotmail.com>
# Maintainer: Wen Heping <wenheping2000@hotmail.com>
pkgname=perl-catalyst-plugin-authentication
pkgver=0.10024
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Catalyst-Plugin-Authentication
pkgdesc="Infrastructure plugin for the Catalyst authentication framework"
url="https://metacpan.org/release/Catalyst-Plugin-Authentication/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="
	perl perl-catalyst-runtime perl-mro-compat perl-moose perl-moosex-emulate-class-accessor-fast
	perl-string-rewriteprefix perl-try-tiny perl-namespace-autoclean
	"
checkdepends="perl-test-fatal"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/J/JJ/JJNAPIORK/Catalyst-Plugin-Authentication-$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="
882f3e2c1b6e6f3a896915dcd82ab67fad5816f1869ded03cfa63516ffb18e2bd1ca07f0a851c7c2270ce5bf2874c2aec6376b0a64ffe44c71fe08d762954e03  Catalyst-Plugin-Authentication-0.10024.tar.gz
"
