# Contributor: Wen Heping <wenheping2000@hotmail.com>
# Maintainer: Wen Heping <wenheping2000@hotmail.com>
pkgname=perl-expect-simple
pkgver=0.04
pkgrel=0
# _pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Expect-Simple
pkgdesc="wrapper around the Expect module"
url="https://metacpan.org/release/Expect-Simple/"
arch="noarch"
license="GPL-2.0-or-later"
depends="perl perl-expect"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DJ/DJERIUS/Expect-Simple-$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
}

sha512sums="
b94a05a48a6235a77bd0b6da3af27807a3d98f6118bbd03e4d0d2554fa46612384c268d23e51840b2a14a04b5a95dff68b6f6a706e9637247c46d52ef034a8db  Expect-Simple-0.04.tar.gz
"
