# Automatically generated by apkbuild-cpan, template 2
# Contributor: Kiyoshi Aman <kiyoshi.aman@gmail.com>
# Maintainer: Kiyoshi Aman <kiyoshi.aman@gmail.com>
pkgname=perl-moo
_pkgreal=Moo
pkgver=2.003003
pkgrel=0
pkgdesc="Minimalist Object Orientation (with Moose compatibility)"
url="http://search.cpan.org/dist/Moo/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-module-runtime perl-sub-quote perl-role-tiny perl-devel-globaldestruction perl-class-method-modifiers"
cpanmakedepends=""
cpancheckdepends="perl-test-fatal"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="perl-strictures $cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/H/HA/HAARG/$_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="f1b2aa2f3dee8749cd2c772b65b8c48dbf67358e62dff856d980422e87c74751013376f82488bff7e8b8b0a707c54cedce8e0da873904b712138cba2c9a7f1c7  Moo-2.003003.tar.gz"
