# 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-class-c3
_pkgreal=Class-C3
pkgver=0.33
pkgrel=0
pkgdesc="A pragma to use the C3 method resolution order algorithm"
url="http://search.cpan.org/dist/Class-C3/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-algorithm-c3"
cpanmakedepends=""
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$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="f72cff75c1222d7b42041b44b5ec7c8ff79e8c53f84ff11e1976a69dcde49093c52e66ebc19ce72f70c99332a9528a07a7d9eab7c74f5b6ce77464434b36cd7b  Class-C3-0.33.tar.gz"
