# Automatically generated by apkbuild-cpan, template 1
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=perl-gd
_pkgreal=GD
pkgver=2.67
pkgrel=0
pkgdesc="Perl module for GD"
url="http://search.cpan.org/dist/GD/"
arch="all"
license="GPL PerlArtistic"
cpandepends=""
cpanmakedepends="perl-extutils-pkgconfig"
depends="$cpandepends"
makedepends="perl-dev $cpanmakedepends gd-dev libjpeg-turbo-dev zlib-dev libpng-dev freetype-dev libwebp-dev"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/R/RU/RURBAN/$_pkgreal-$pkgver.tar.gz"

builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	cd "$builddir"
	if [ -e Build.PL ]; then
		perl Build.PL installdirs=vendor
	else
		PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	fi
}

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

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

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

sha512sums="dd9b7bbbbc5cffb42dafab9f1a5585d1a6bb315a251bad10cc31e382fef87306f22b1b1061778c79f9b60e8a36ff6784677ddf454ffe962bc32ce7d3b94c6e52  GD-2.67.tar.gz"
