# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=perl-sub-prototype
_cpanname=Sub-Prototype
pkgver=0.03
pkgrel=2
pkgdesc="Set a sub's prototype"
url='https://metacpan.org/dist/Sub-Prototype'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=(Artistic-1.0-Perl)
depends=(
  glibc
  perl
  perl-sub-exporter
)
checkdepends=(
  perl-test-fatal
)
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/E/ET/ETHER/${_cpanname}-${pkgver}.tar.gz)
sha512sums=('fa2d4e7f5d5db310899eb0d6d0c9d451fbf37af5a17b35709a772be913f5dc1adaa744bb1c87e6e7b23723d279c1ed8c4b3da8629e843ce56fcadd94e22d7b2b')
b2sums=('954e364f86ddb49875d76b0775788c71b098cc359676e2ae2dd82394738260446a68f73c85a71b64116cbceaa32b7828d9ac3c926cdc361e9fb0189236cd167b')

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

check() {
  cd ${_cpanname}-${pkgver}
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd ${_cpanname}-${pkgver}
  make DESTDIR="${pkgdir}" install INSTALLDIRS=vendor
  install -Dm 644 README* -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
