# Automatically generated by apkbuild-cpan, template 2
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=perl-dbd-pg
_pkgreal=DBD-Pg
pkgver=3.7.4
pkgrel=0
pkgdesc="DBI PostgreSQL interface"
url="http://search.cpan.org/dist/DBD-Pg/"
arch="all"
license="GPL PerlArtistic"
cpandepends="perl-dbi"
cpanmakedepends="perl-dbi"
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev postgresql-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare || return 1

	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 || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

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

sha512sums="77c629ce89233345f7893b0cc2799a5efc646e86b62ee91986678f196380ac772ece7b9f6c98dae588fbf8f29def1f997335fa85874562ab648af8665cd9add8  DBD-Pg-3.7.4.tar.gz"
