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

_realname=Digest-HMAC
pkgname=perl-${_realname}
pkgver=1.05
pkgrel=1
pkgdesc="Perl Module: Keyed-Hashing for Message Authentication."
arch=('any')
license=('PerlArtistic')
url="https://metacpan.org/dist/Digest-HMAC"
msys2_references=(
  'purl: pkg:cpan/ARODLAND/Digest-HMAC'
)
groups=('perl-modules')
depends=('perl>=5.10.0') # 'perl-Digest-SHA1' in perl core now
options=(!emptydirs)
replaces=('Digest-HMAC')
provides=('Digest-HMAC')
source=("https://cpan.metacpan.org/authors/id/A/AR/ARODLAND/${_realname}-${pkgver}.tar.gz")
sha256sums=('215cb59cba610745cfb2d4b3f8ef756d590e57e3ad7986a992e87c4969fcdc7a')

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  # install module in vendor directories.
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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