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

pkgname=perl-libwww
pkgver=6.56
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=('any')
url="https://metacpan.org/release/libwww-perl"
groups=('perl-modules')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'perl-Encode-Locale' 'perl-File-Listing'
         'perl-HTML-Parser' 'perl-HTTP-Cookies' 'perl-HTTP-Daemon'
         'perl-HTTP-Date' 'perl-HTTP-Negotiate' 'perl-LWP-MediaTypes'
         'perl-Net-HTTP' 'perl-URI' 'perl-WWW-RobotRules'
         'perl-HTTP-Message' 'perl-Try-Tiny')
optdepends=('perl-LWP-Protocol-https: for https:// url schemes')
checkdepends=('perl-Test-Fatal' 'perl-Test-Needs' 'perl-Test-Requiresinternet')
source=(https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-${pkgver}.tar.gz)
sha256sums=('94362e68e5c6782f3987a9dec6adc409d20e28665dbf28ff47d1d701443ce7ce')

build() {
  cd libwww-perl-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check()  {
  cd libwww-perl-${pkgver}
  make test
}

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