# Automatically generated by apkbuild-cpan, template 3
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=perl-db_file
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=DB_File
pkgver=1.859
pkgrel=1
pkgdesc="Perl5 access to Berkeley DB version 1.x"
url="https://metacpan.org/release/DB_File/"
# x86: tests segfault
arch="all !x86"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev db-dev"
checkdepends="perl-test-cpan-meta perl-test-pod"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PM/PMQS/DB_File-$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
	make
}

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

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

sha512sums="
7feab666e75eb1eea80de7e0a9cad80726f8e762ed12c40ff466effa269945580adef3c60f8203146ccee808b85d7fe1d7b1f508db9e78b736a33e1064ba9448  DB_File-1.859.tar.gz
"
