# Automatically generated by apkbuild-cpan, template 1
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-datetime
_pkgreal=DateTime
pkgver=1.44
pkgrel=0
pkgdesc="A date and time object for Perl"
url="http://search.cpan.org/dist/DateTime/"
arch="all"
license="Artistic-2.0"
cpandepends="perl-datetime-locale perl-try-tiny perl-dist-checkconflicts perl-params-validationcompiler perl-datetime-timezone perl-namespace-autoclean perl-specio"
cpanmakedepends="  perl-test-warnings perl-cpan-meta-check perl-test-fatal "
depends="$cpandepends"
makedepends="perl-dev perl-file-sharedir $cpanmakedepends"
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 Makefile.PL INSTALLDIRS=vendor
}

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

check() {
	cd "$builddir"
	make test
}

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

sha512sums="a256efc26ad1f2859f3371b70e5edd0d962d2c19c54b746178e3945b1dc665621d09b7ac6be279c7e92b8aa91763c5df2d8ccbca1832ba69ac810feb8533ca71  DateTime-1.44.tar.gz"
