# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-amqp
_pkgreal=amqp
pkgver=1.9.3
pkgrel=0
_phpver=${pkgname#php}
_phpver=${_phpver%%-*}
pkgdesc="PHP$_phpver extension: Communicate with any AMQP compliant server"
url="http://pecl.php.net/package/amqp"
arch="all"
license="PHP"
depends="php$_phpver-common"
makedepends="php$_phpver-dev autoconf rabbitmq-c-dev"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
options="!check"  # it seems that tests need running AMQP server
builddir="$srcdir/$_pkgreal-$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"
	echo "extension=$_pkgreal.so" > "$confdir"/40_$_pkgreal.ini
}

sha512sums="d4731ed5dc760a01621889e8518b5d1258a8335f701d241c453fd553924d83507a0a918b9733e249955fa11b43a1bdacf65c1f1cb55b8ed3c5b661277f5798b9  php7-amqp-1.9.3.tgz"
