# Contributor: TBK <tbk@jjtc.eu>
pkgname=perl-string-util
_pkgreal=String-Util
pkgver=1.26
pkgrel=0
pkgdesc="String processing utilities"
url="http://search.cpan.org/dist/String-Util/"
arch="noarch"
license="GPL PerlArtistic"
depends="perl perl-number-misc perl-test-toolbox"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/M/MI/MIKO/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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="27f4d9a36814695ca2123473f073577cc4ab31c0c1f9feccff8b9af0324c697df45efde981d638ed407521bb8348cf5512ebe1c9a5bfd5149df17b12014ed808  String-Util-1.26.tar.gz"