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

_realname=Scope-Guard
pkgname=perl-${_realname}
pkgver=0.21
pkgrel=2
pkgdesc="Lexically-scoped resource management"
arch=('any')
url="https://metacpan.org/release/Scope-Guard"
msys2_references=(
  'purl: pkg:cpan/CHOCOLATE/Scope-Guard'
)
groups=('perl-modules')
license=('PerlArtistic')
depends=('perl')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/C/CH/CHOCOLATE/${_realname}-${pkgver}.tar.gz")
sha256sums=('8c9b1bea5c56448e2c3fadc65d05be9e4690a3823a80f39d2f10fdd8f777d278')

build() {
  cd  "${srcdir}/${_realname}-${pkgver}"
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd  "${srcdir}/${_realname}-${pkgver}"
  make test
}

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

  find ${pkgdir} -name '.packlist' -delete
  find ${pkgdir} -name '*.pod' -delete
}
