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

_realname=Digest-HMAC
pkgname=perl-${_realname}
pkgver=1.04
pkgrel=1
pkgdesc="Perl Module: Keyed-Hashing for Message Authentication."
arch=('any')
license=('PerlArtistic')
url="https://search.cpan.org/dist/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=('d6bc8156aa275c44d794b7c18f44cdac4a58140245c959e6b19b2c3838b08ed4')

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