# Description: Perl Digest::SHA1
# URL: https://metacpan.org/pod/Digest::SHA1
# Maintainer: John McQuah, jmcquah at disroot dot org

name=p5-digest-sha1
version=2.13
release=3
source=(https://www.cpan.org/modules/by-module/Digest/Digest-SHA1-$version.tar.gz)

build() {
	cd Digest-SHA1-$version

	perl Makefile.PL
	make OPTIMIZE="$CFLAGS"

	make install DESTDIR=$PKG

	# Remove perlcrap
	find $PKG -type f \( \
		-name '.packlist' -or \
		-name '*.bs' -or \
		-name 'autosplit.ix' -or \
		-name 'perllocal.pod' \) -delete

	# Remove empty directories
	find $PKG -depth -empty -delete
	# Fix perms
	find $PKG -type f -a ! -perm -u+w -exec chmod u+w '{}' +
}
