# Packager: Justin "juster" Davis <jrcd83@gmail.com>
# $Id: PKGBUILD 150749 2012-02-21 19:40:54Z juster $

pkgname=perl-libwww
pkgver=6.04
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=(any)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=('perl>=5.8.1' 'perl-encode-locale' 'perl-file-listing>=6'
         'perl-html-parser' 'perl-http-cookies>=6' 'perl-http-daemon>=6'
         'perl-http-date>=6' 'perl-http-negotiate>=6' 'perl-lwp-mediatypes>=6'
         'perl-net-http>=6' 'perl-uri>=1.10' 'perl-www-robotrules>=6'
         'perl-http-message>=6')
optdepends=('perl-lwp-protocol-https: for https:// url schemes')
url=https://metacpan.org/release/libwww-perl
source=("http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/libwww-perl-${pkgver}.tar.gz")
md5sums=(24acf2fe33b2295f048f8859e9665ee3)
sha512sums=(9ea578e6da99e4002a35ae82d1ee025caf15b3bc7e40fbe71abd7e8592036f16bd0268453dfeedc2c445d957c45ec473b1ed4a1738b644d475d65f7cbdb6927b)
_distdir="${srcdir}/libwww-perl-${pkgver}"

build()
(
    export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_distdir"
    /usr/bin/perl Makefile.PL
    make
)

check()
(
    export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd "$_distdir"
    make test
)

package() {
    cd "$_distdir"
    make DESTDIR="$pkgdir" install
    find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et: