pkgname=perl-sub-handlesvia
_cpanname=Sub-HandlesVia
pkgver=0.050003
pkgrel=1
pkgdesc='Perl extension for easily overriding subroutines'
url='https://metacpan.org/release/Sub-HandlesVia'
arch=('any')
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-moo' 'perl-mouse' 'perl-exporter-tiny' 'perl-type-tiny' 'perl-class-tiny' 'perl-role-hooks')
checkdepends=('perl-test-requires' 'perl-test-fatal')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/T/TO/TOBYINK/${_cpanname}-${pkgver}.tar.gz)
sha512sums=('bd188cfbd02a2322fd96bfcf38b92d62ad476f468b0f0ecb969bfb91f94367450887c2ae40dddb2d820bc7c41cb817f92039c7a4660a3e90a1372e19b4afa8b5')

build() {
  cd ${_cpanname}-${pkgver}
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_cpanname}-${pkgver}
  make test
}

package() {
  cd ${_cpanname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
