# 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-netaddr-mac
_pkgreal=NetAddr-MAC
pkgver=0.95
pkgrel=0
pkgdesc="MAC address functions and object"
url="http://search.cpan.org/dist/NetAddr-MAC/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends=""
cpanmakedepends="perl-test-trap"
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/D/DJ/DJZORT/$_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="130a56997eb8b702398412aac29cfcec91931922de7f5feb8978aa88679b61a83f45f37bb7c61070ef2b9fc3134de77c5e6d009d14bb859bec14460f63426f8d  NetAddr-MAC-0.95.tar.gz"
