# 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-test-trap
_pkgreal=Test-Trap
pkgver=v0.3.3
pkgrel=0
pkgdesc="Trap exit codes, exceptions, output, etc."
url="http://search.cpan.org/dist/Test-Trap/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-data-dump"
cpanmakedepends=""
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev perl-module-build $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/E/EB/EBHANSSEN/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	perl Build.PL installdirs=vendor
}

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

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

check() {
	cd "$builddir"
	./Build test
}

sha512sums="3a79bb0e201f2c740ea87baffda29141fc41e29b310bc9291da0e1cac0cf7f62a8c5cc70b94b68542cac7d6844d76c7fc1d3bbb91d86f8ba26a489d39883dd1e  Test-Trap-v0.3.3.tar.gz"
