# Automatically generated by apkbuild-cpan, template 2
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-datetime-timezone
_pkgreal=DateTime-TimeZone
pkgver=2.15
pkgrel=0
pkgdesc="Time zone object base class and factory"
url="http://search.cpan.org/dist/DateTime-TimeZone/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-class-singleton perl-params-validationcompiler perl-namespace-autoclean perl-try-tiny perl-module-runtime perl-specio"
cpanmakedepends=""
cpancheckdepends="perl-test-requires perl-test-fatal"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
options="!check" # disable due to circular dependency with perl-datetime
#checkdepends="perl-datetime $cpancheckdepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
}

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

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

check() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

sha512sums="2109f7e166931cf9d5fb97705572363615334bb392082e93087b40ac88d9f25c8f8ef7ba8df2cecfba5a7cd6f05bed6d6777cae2e1451b1a364a84077473bb09  DateTime-TimeZone-2.15.tar.gz"
