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

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

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