# Automatically generated by apkbuild-cpan, template 2
# Contributor: Nick Andrew <nick@nick-andrew.net>
# Maintainer: Nick Andrew <nick@nick-andrew.net>
pkgname=perl-gearman
_pkgreal=Gearman
pkgver=2.004.008
pkgrel=0
pkgdesc="Client and worker libraries for gearman job dispatch dispatch. Server is in separate package."
url="http://search.cpan.org/dist/Gearman/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends="perl-list-moreutils perl-string-crc32 perl-io-socket-ssl"
cpanmakedepends="perl-file-which perl-test-tcp perl-test-timer perl-proc-guard perl-io-socket-ssl perl-test-exception"
cpancheckdepends=""
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends"
checkdepends="$cpancheckdepends"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/P/PA/PALIK/$_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
}

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="43484b2ef7cdce607736c429d18f37251b925cee14b3577409c487a1beab647b017d501e3b109ad842a8c16905dad4a3f78972fb076a13dc3e22c6a386a4c9c8  Gearman-2.004.008.tar.gz"
