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

_realname=Params-Util
pkgname=perl-${_realname}
pkgver=1.102
pkgrel=5
pkgdesc="Simple, compact and correct param-checking functions"
arch=('i686' 'x86_64')
url="https://metacpan.org/release/Params-Util"
msys2_references=(
  'purl: pkg:cpan/REHSACK/Params-Util'
)
groups=('perl-modules')
depends=('perl')
makedepends=('perl-devel' 'make' 'gcc')
license=('GPL' 'PerlArtistic')
source=("https://cpan.metacpan.org/authors/id/R/RE/REHSACK/Params-Util-${pkgver}.tar.gz")
sha256sums=('499bb1b482db24fda277a51525596ad092c2bd51dd508fa8fec2e9f849097402')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT
  PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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