# Contributor: DracoBlue <jans@dracoblue.de>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-pcov
_extname=pcov
pkgver=1.0.11
pkgrel=0
pkgdesc="Code coverage driver for PHP 8.2 - PECL"
url="https://pecl.php.net/package/pcov"
arch="all"
license="PHP-3.01"
_phpv=82
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	$_php -dextension=modules/$_extname.so --ri $_extname
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	local _confdir="$pkgdir"/etc/$_php/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
9d196d92ddfdcd22a69d94543202d861e8d54355991d528e7a5f5bb5423943d6bc04b1b9a117294b7337093765595e5be0ac95ab1619149ec6dc9d6a4a330d69  php-pecl-pcov-1.0.11.tgz
"
