# Description: Efficient generation of subroutines via string eval
# URL: http://search.cpan.org/~haarg/Sub-Quote/
# Maintainer: Petar Petrov, slackalaxy at gmail dot com
# Depends on: perl
# Optional: p5-sub-name

name=p5-sub-quote
version=2.006008
release=1
source=(http://search.cpan.org/CPAN/authors/id/H/HA/HAARG/Sub-Quote-${version}.tar.gz)

build() {
	cd Sub-Quote-$version

	# PERL_MM_USE_DEFAULT=1 \
	perl Makefile.PL
	make OPTIMIZE="$CFLAGS" DESTDIR="$PKG" install

	find "$PKG" -depth \
		-type f \( -name .packlist -o -name \*.bs -o -name perllocal.pod \) -delete , \
		-type f -name autosplit.ix \( -exec grep -q '^[[:space:]]*package' {} \; -o -delete \) , \
		-type d -empty -exec rmdir {} +
}