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

_realname=Net-HTTP
pkgname=perl-${_realname}
pkgver=6.21
pkgrel=1
pkgdesc="Low-level HTTP connection (client)"
arch=('any')
url="https://metacpan.org/release/Net-HTTP"
groups=('perl-modules')
license=('PerlArtistic' 'GPL')
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=('375aa35b76be99f06464089174d66ac76f78ce83a5c92a907bbfab18b099eec4')

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
}
