# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-net-cidr
pkgver=0.17
pkgrel=0
pkgdesc="Manipulate IPv4/IPv6 netblocks in CIDR notation"
url="http://search.cpan.org/dist/Net-CIDR/"
arch="noarch"
license="GPL+ or Artistic"
depends="perl"
makedepends="perl-dev"
install=""
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/M/MR/MRSAM/Net-CIDR-$pkgver.tar.gz"

_builddir="$srcdir"/Net-CIDR-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
	make && make test || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="bb1ad29f79879e46afc221ddec1d790ea69d470e7363dc90e27ec3fb34e15cf753b457b76a4ea0e70db4afc0aeb11f3e2bbe7c204abb5aae967d13ae9605460f  Net-CIDR-0.17.tar.gz"
