# Automatically generated by apkbuild-cpan, template 1
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=perl-test-postgresql
_pkgreal=Test-PostgreSQL
pkgver=1.25
pkgrel=0
pkgdesc="PostgreSQL runner for tests"
url="http://search.cpan.org/dist/Test-PostgreSQL/"
arch="noarch"
license="Artistic-2.0"
cpandepends="perl-class-accessor-lite"
cpanmakedepends="perl-test-sharedfork perl-dbd-pg perl-dbi
	perl-test-pod perl-moo perl-type-tiny perl-function-parameters
	perl-file-which perl-tie-hash-method"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends perl-module-install"
checkdepends="perl-try-tiny"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/T/TJ/TJC/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

check() {
	cd "$builddir"
	make test
}

prepare() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="220db567cf53b4128976a7055621bbba548a77b619d87bdf0b73d12adbc47611274a9323897800e8d4524d39522e36f46d4ec34036b742d9f7717a7c80748533  Test-PostgreSQL-1.25.tar.gz"