# 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-clone-pp
_pkgreal=Clone-PP
pkgver=1.07
pkgrel=1
pkgdesc="Recursively copy Perl datatypes"
url="http://search.cpan.org/dist/Clone-PP/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends=""
cpanmakedepends=""
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/N/NE/NEILB/$_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="28faae5dc42ff5ae850fe9f664dca8b52ff77823c5f157c62c52254fa4f1e217d3344f6e79a2ddad169f934e7be262dc79f32e885cb1d25db182050800ac805a  Clone-PP-1.07.tar.gz"
