# Automatically generated by apkbuild-cpan, template 4
# Contributor: Timothy Legge <timlegge@gmail.com>
# Maintainer: Timothy Legge <timlegge@gmail.com>
pkgname=perl-www-mechanize
pkgver=2.19
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=WWW-Mechanize
pkgdesc="Handy web browsing in a Perl object"
url="https://metacpan.org/release/WWW-Mechanize/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="
	perl perl-libwww perl-html-tree perl-uri perl-html-parser perl-http-cookies perl-http-message
	perl-html-form
	"
checkdepends="
	perl-http-daemon perl-test-fatal perl-test-output perl-test-deep perl-test-warnings
	perl-path-tiny perl-test-taint perl-libwww perl-test-memory-cycle perl-uri
	"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/O/OA/OALDERS/WWW-Mechanize-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL \
		INSTALLDIRS=vendor \
		NO_PACKLIST=1 \
		NO_PERLLOCAL=1
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	local file; find "$pkgdir" -name "*.pod" | while read -r file; do
		amove "${file#"$pkgdir"}"
	done
	default_doc
}

sha512sums="
19d26c35b405742a0900f512974d3beeb7d8937de0cca60bfd713a78fa5190fe1e2b273fad016b241d3cb3a15144fc3acb3ccc5c210c1f7eb468bbf3ac892e1c  WWW-Mechanize-2.19.tar.gz
"
