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

_realname=Sub-Quote
pkgname=perl-${_realname}
pkgver=2.006009
pkgrel=2
pkgdesc="efficient generation of subroutines via string eval"
arch=('any')
url="https://metacpan.org/dist/Sub-Quote"
msys2_references=(
  'archlinux: perl-sub-quote'
  'purl: pkg:cpan/HAARG/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=('39328f6cf0b690c7e37600554fc0492b7f7f9fad80816a02ea038763edb9039c893ae05fe25ce27b8e4410f91c363ba4110e08a0eede18ef387fca5f5c548c85')

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}"
}
