# Automatically generated by apkbuild-cpan, template 2
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=perl-net-mpd
_pkgreal=Net-MPD
pkgver=0.07
pkgrel=3
pkgdesc="Communicate with an MPD server"
url="https://metacpan.org/release/Net-MPD/"
# s390x: mpd not available
arch="noarch !s390x"
license="MIT"
depends="perl mpd"
makedepends="perl-module-build-tiny"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/A/AB/ABERNDT/Net-MPD-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
		PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
		PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
		CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') \
		MODULEBUILDRC=/dev/null

	perl Build.PL
	./Build
}

check() {
	./Build test
}

package() {
	./Build install --destdir="$pkgdir" --prefix=/usr
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
	install -Dvm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
8864cfcfa5fa22ccc32feea73644217611957aeb5fe2f3b35c389f8e8488887d589bc3f2ac794e4374bbe75134e60832d920dba22f31fbe513e688da70fec1e2  Net-MPD-0.07.tar.gz
"
