# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=Sub-Quote
pkgname=perl-${_realname}
pkgver=2.006006
pkgrel=1
pkgdesc="efficient generation of subroutines via string eval"
arch=('any')
url="https://search.cpan.org/dist/Sub-Quote/"
license=('PerlArtistic' 'GPL')
depends=('perl')
makedepends=('perl-Test-Fatal>=0.010')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/H/HA/HAARG/Sub-Quote-${pkgver}.tar.gz)
sha512sums=('19cd0504f039f3218d3f47b3b44714f0baed73a13f97c4552eb1816b7b03186b1bbdf48cc70c2cae616eb9ec81721b30217c7f788176d389df694c9b355ead64')

prepare() {
  cd ${_realname}-${pkgver}
}

build() {
  cd ${_realname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 \
  PERL_AUTOINSTALL=--skipdeps \
  PERL5LIB="" \
  MODULEBUILDRC=/dev/null \
  PERL_MM_OPT="INSTALLDIRS=vendor" \
  PERL_MB_OPT="--installdirs vendor" \
  perl Makefile.PL
  make
}

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