# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-opentelemetry
_extname=opentelemetry
pkgver=1.1.0_beta3
_pkgver=${pkgver/_/}
pkgrel=0
pkgdesc="PHP 8.2 extension for OpenTelemetry auto-instrumentation support - PECL"
url="https://pecl.php.net/package/opentelemetry"
arch="all"
license="Apache-2.0"
_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 -d extension="$builddir"/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="
cd028d5a67b71ac855bd208486a5b26b754405d71e050452041e292846588e06e9e53cabe4cfe50bcefd6c8cae7c36c79ea38749cb590711a4d7398b36863874  php-pecl-opentelemetry-1.1.0_beta3.tgz
"
