# Automatically generated by apkbuild-cpan, template 4
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-json-validator
pkgver=5.15
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=JSON-Validator
pkgdesc="Validate data against a JSON schema"
url="https://metacpan.org/release/JSON-Validator/"
arch="noarch"
license="Artistic-2.0"
depends="
	perl perl-data-validate-domain perl-data-validate-ip
	perl-mojolicious perl-net-idn-encode perl-yaml-libyaml
	"
checkdepends="perl-test-deep"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/J/JH/JHTHORSEN/JSON-Validator-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

# no perl-sereal-encoder on 32-bit ARM
case "$CARCH" in
armv7|armhf)
	;;
*)
	depends="$depends perl-sereal-encoder"
	;;
esac

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
}

sha512sums="
ed8cae5a35f1e535296c821660fb41ba0e1a22605f6297431dbf15a39f922415fae1b978a74c21eeb4661ea9989713392a0bcb85bd32141bfafc58769de86502  JSON-Validator-5.15.tar.gz
"
