# Automatically generated by apkbuild-cpan, template 4
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-protocol-database-postgresql
pkgver=2.001
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Protocol-Database-PostgreSQL
pkgdesc="PostgreSQL wire protocol implementation"
url="https://metacpan.org/release/Protocol-Database-PostgreSQL/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="
	perl perl-adapter-async perl-check-unitcheck
	perl-future perl-indirect perl-log-any perl-ryu
	perl-sub-identify perl-unicode-utf8
	"
checkdepends="
	perl-log-any-adapter-tap perl-test-checkdeps
	perl-test-fatal perl-test-hexstring perl-test-refcount
	"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/T/TE/TEAM/Protocol-Database-PostgreSQL-$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="
6b37a2e6b0632e87e381704f06a800cf1008a59127152f38ec2c245b988337753d922294569bceb36ad8af65b9a5002868188af133cff7403f7808d1118e6a77  Protocol-Database-PostgreSQL-2.001.tar.gz
"
