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

_realname=Sub-Exporter
pkgname=perl-${_realname}
pkgver=0.991
pkgrel=1
pkgdesc="A sophisticated exporter for custom-built routines"
arch=('any')
url="https://metacpan.org/dist/Sub-Exporter"
msys2_references=(
  'purl: pkg:cpan/RJBS/Sub-Exporter'
)
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-Data-OptList' 'perl-Params-Util' 'perl-Sub-Install')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Sub-Exporter-${pkgver}.tar.gz")
sha512sums=('7829bbca1eb332156ba33dd0cbde7f57c178ad56cc03e76c1b7d5327c94ce15bb5172894eeef011e12e472071a7d7a07f514a1121535d96ae05ed0ef6734b329')

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