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

_realname=HTTP-Cookies
pkgname=perl-${_realname}
pkgver=6.11
pkgrel=1
pkgdesc="HTTP cookie jars"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
groups=('perl-modules')
depends=('perl>=5.8.8' 'perl-HTTP-Date>=6' 'perl-HTTP-Message')
makedepends=()
checkdepends=()
conflicts=('perl-libwww<6')
url="https://metacpan.org/release/HTTP-Cookies"
msys2_references=(
  "purl: pkg:cpan/OALDERS/HTTP-Cookies"
)
source=(https://www.cpan.org/authors/id/O/OA/OALDERS/${_realname}-${pkgver}.tar.gz)
sha256sums=('8c9a541a4a39f6c0c7e3d0b700b05dfdb830bd490a1b1942a7dedd1b50d9a8c8')

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 "${srcdir}/${_realname}-${pkgver}"
    /usr/bin/perl Makefile.PL
    make
  )
}

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

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