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

_realname=HTTP-Date
pkgname=perl-${_realname}
pkgver=6.06
pkgrel=1
pkgdesc="Date conversion routines"
arch=('any')
license=('PerlArtistic' 'GPL')
groups=('perl-modules')
options=('!emptydirs')
depends=('perl>=5.8.8')
conflicts=('perl-libwww<6')
url="https://metacpan.org/release/HTTP-Date"
msys2_references=(
  "purl: pkg:cpan/OALDERS/HTTP-Date"
)
source=(https://search.cpan.org/CPAN/authors/id/O/OA/OALDERS/${_realname}-$pkgver.tar.gz)
sha256sums=('7b685191c6acc3e773d1fc02c95ee1f9fae94f77783175f5e78c181cc92d2b52')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor"     \
      PERL_MB_OPT="--installdirs vendor" \
      MODULEBUILDRC=/dev/null

    cd "${_realname}-${pkgver}"
    /usr/bin/perl Makefile.PL
    make
  )
}

check() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd "${_realname}-${pkgver}"
    make test
  )
}

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