# Automatically generated by apkbuild-cpan, template 1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-socket
_pkgreal=Socket
pkgver=2.029
pkgrel=2
pkgdesc="networking constants and support functions"
url="https://metacpan.org/release/Socket/"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PE/PEVANS/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	cd "$builddir"
	make test
}

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

doc() {
	default_doc
	replaces="perl-doc"
}

sha512sums="7a59c66962638695a8e4dfab170266cdcfebce7e5143449ae3a37a2dc24910cda8cd89f45b09951f98182179c9419021c95308b0bde4dbb177dda0c677329cce  Socket-2.029.tar.gz"
