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

_realname=Net-HTTP
pkgname=perl-${_realname}
pkgver=6.24
pkgrel=1
pkgdesc="Low-level HTTP connection (client)"
arch=('any')
url="https://metacpan.org/release/Net-HTTP"
msys2_references=(
  'archlinux: perl-net-http'
  'cygwin: perl-Net-HTTP'
  "purl: pkg:cpan/OALDERS/Net-HTTP"
)
groups=('perl-modules')
license=('spdx:Artistic-1.0-Perl', 'spdx:GPL-1.0-or-later')
options=('!emptydirs')
depends=('perl>=5.6.2')
checkdepends=('perl-URI')
conflicts=('perl-libwww<6')
source=("https://www.cpan.org/authors/id/O/OA/OALDERS/${_realname}-${pkgver}.tar.gz")
sha256sums=('290ed9a97b05c7935b048e6d2a356035871fca98ad72c01c5961726adf85c83c')

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
}
