# Automatically generated by apkbuild-cpan, template 4
# Contributor: Nick Andrew <nick@nick-andrew.net>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-uri-encode-xs
pkgver=0.11
pkgrel=10
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=URI-Encode-XS
pkgdesc="Perl URI encoder/decoder using C"
url="https://metacpan.org/release/URI-Encode-XS/"
arch="all"
license="BSD-2-Clause"
depends="perl"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DF/DFARRELL/URI-Encode-XS-$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
}

sha512sums="
2035723d68e67f3dceadc6f92c95558f7d30531bd559f4de07f7f3240e4512ae35b5452213be41fa1ee3be65b1803ccbd7299587373fc2c339fdab8a42479d93  URI-Encode-XS-0.11.tar.gz
"
