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

pkgname=perl-libwww
pkgver=6.80
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=('any')
url="https://metacpan.org/dist/libwww-perl"
msys2_references=(
  "cpe: cpe:/a:gisle_aas:libwww-perl"
  "cpe: cpe:/a:search.cpan:libwww-perl"
  'purl: pkg:cpan/OALDERS/libwww-perl'
)
groups=('perl-modules')
license=('spdx:Artistic-1.0-Perl' 'spdx:GPL-1.0-or-later')
options=('!emptydirs')
depends=('perl' 'perl-Encode-Locale' 'perl-File-Listing'
         'perl-HTML-Parser' 'perl-HTTP-Cookies' 'perl-HTTP-Daemon' 'perl-http-cookiejar'
         '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=('5ba3fc5a00836e61cb428bcd91bf69d8d74eaee6d78e44c3a414f78076af0a98')

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
}
