# $Id: PKGBUILD 94213 2013-07-16 19:33:01Z jsteel $
# Maintainer: Jonathan Steel <jsteel@aur.archlinux.org>
# Contributor: Justin Davis <jrcd83@gmail.com>

pkgname=perl-package-stash
pkgver=0.35
pkgrel=1
pkgdesc="Routines for manipulating stashes"
arch=(any)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=('perl>=5.8.1' 'perl-dist-checkconflicts>=0.02'
         'perl-package-deprecationmanager' 'perl-scalar-list-utils'
         'perl-package-stash-xs>=0.24')
makedepends=('perl-extutils-makemaker>=6.30')
checkdepends=('perl-test-fatal' 'perl-test-requires' 'perl-test-simple' 'perl-module-implementation')
url="http://search.cpan.org/dist/Package-Stash"
source=(http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Package-Stash-$pkgver.tar.gz)
md5sums=('423e99f76382cb71119f5f3a69c1e29e')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor"     \
      PERL_MB_OPT="--installdirs vendor" \
      MODULEBUILDRC=/dev/null

    cd Package-Stash-${pkgver}

    /usr/bin/perl Makefile.PL

    make
  )
}

check() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd Package-Stash-${pkgver}

    make test
  )
}

package() {
    cd Package-Stash-${pkgver}

    make DESTDIR="$pkgdir"/ install
}
