# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php7-xdebug
_pkgname=xdebug
pkgver=2.6.0
pkgrel=1
_phpver=${pkgname#php}
_phpver=${_phpver%%-*}
pkgdesc="PHP$_phpver extension that provides functions for function traces and profiling"
url="http://pecl.php.net/package/xdebug"
arch="all"
license="PHP"
depends="php$_phpver-common"
makedepends="php$_phpver-dev autoconf"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgname-$pkgver.tgz"
options="!check"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"

	phpize$_phpver
	./configure --prefix=/usr --with-php-config=php-config$_phpver
	make
}

package() {
	local confdir="$pkgdir/etc/php$_phpver/conf.d"
	cd "$builddir"

	make INSTALL_ROOT="$pkgdir" install

	mkdir -p "$confdir"
	cat > "$confdir"/$_pkgname.ini <<-EOF
		; Uncomment to enable this extension.
		;zend_extension=$_pkgname.so
	EOF
}

sha512sums="e81f771478eb45cdae5814037ac1b86bcb8c5616d22dcac436482c350187c53d3cc6d54be740a49dca6d38c58c086db6e4a68eb3004a0152d6215c97512538a2  php7-xdebug-2.6.0.tgz"
