#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>

# _cpanname is the module name as provided in CPAN.
# For example: Archive-Zip
# The corresponding package will be named: perl-Archive-Zip
_cpanname=Module-ScanDeps
pkgname=perl-${_cpanname}
pkgver=1.29
pkgrel=1gv
source=("https://cpan.metacpan.org/authors/id/R/RS/RSCHUPP/Module-ScanDeps-$pkgver.tar.gz")
docs=("readme" "install" "license" "changes" "authors" "news" "todo")
url=https://metacpan.org/pod/Module::ScanDeps

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"perl-Module-ScanDeps (Recursively scan Perl code for dependencies)"
"Module::ScanDeps scans potential modules used by perl programs, and"
"returns a hash reference; its keys are the module names as appears in"
"%INC."
)


build() {
	cd $startdir/src/${_cpanname}-$pkgver

	perl Makefile.PL || exit 1
	make OPTIMIZE="$CFLAGS" || exit 1
	make install INSTALLDIRS=vendor DESTDIR=$startdir/pkg || exit 1

	# Remove perllocal.pod and .packlist if present in the package
	( for i in perllocal.pod .packlist; do
	        find $startdir/pkg -name "$i" -exec rm -rf {} \;
		  done
	) || exit 1
}