# Automatically generated by apkbuild-cpan, template 2
# Contributor: Nick Andrew <nick@nick-andrew.net>
# Maintainer: Nick Andrew <nick@nick-andrew.net>
pkgname=perl-anyevent-http
_pkgreal=AnyEvent-HTTP
pkgver=2.23
pkgrel=0
pkgdesc="simple but non-blocking HTTP/HTTPS client"
url="http://search.cpan.org/dist/AnyEvent-HTTP/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-anyevent perl-dancer-plugin-swig"
cpanmakedepends=""
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/$_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="ba28bb01c042c6fbf51c7055ddf38dbea1b6a7e84a8a8c8ec845bf63f16f9919a388e092c59f07a9588972da45b87de3627dc66dd2b2b958b731c6b699197d90  AnyEvent-HTTP-2.23.tar.gz"
