# $Id: PKGBUILD 97806 2013-09-29 22:09:14Z jsteel $
# Maintainer: Jonathan Steel <jsteel@aur.archlinux.org>
# Contributor: Justin Davis (juster) <jrcd83@gmail.com>

pkgname=perl-sub-install
pkgver=0.926
pkgrel=2
pkgdesc="Install subroutines into packages easily"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
url="https://metacpan.org/release/Sub-Install"
source=(http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Sub-Install-$pkgver.tar.gz)
md5sums=('89a7f82dd840bc2401f281b5f24732b9')

build() (
  cd "$srcdir/Sub-Install-$pkgver"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps

  unset PERL5LIB PERL_MM_OPT
  /usr/bin/perl Makefile.PL
  make
)

check() (
  cd "$srcdir/Sub-Install-$pkgver"
  export PERL_MM_USE_DEFAULT=1

  unset PERL5LIB
  make test
)

package() (
  cd "$srcdir/Sub-Install-$pkgver"

  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
)
