# Packager: Justin "juster" Davis <jrcd83@gmail.com>
# $Id: PKGBUILD 65649 2012-02-21 18:43:03Z juster $

pkgname=perl-local-lib
pkgver=1.008004
pkgrel=2
pkgdesc="create and use a local lib/ for perl modules with PERL5LIB"
arch=(any)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=('perl>=5.8.1')
url=https://metacpan.org/release/local-lib
source=("http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-${pkgver}.tar.gz")
md5sums=(6244fa9d77e818594acbaf572aece326)
sha512sums=(4ed2bf88a0cd5bcbe7cf04bf0cd24fea7ddc7bfa4c18700b4a49ccb9111bf57cab6ea06fb59bd7914cb24d4786bedb73ac2f02cb00faaa61118fe1d771932984)
_distdir="${srcdir}/local-lib-${pkgver}"

build()
(
    export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_distdir"
    /usr/bin/perl Makefile.PL
    make
)

check()
(
    export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd "$_distdir"
    make test
)

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

# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et:
