# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-libsodium
_pkgreal=libsodium
pkgver=2.0.8
pkgrel=0
pkgdesc="A simple, low-level PHP extension for libsodium"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP"
makedepends="php7-dev autoconf libsodium-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	cd "$builddir"

	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

package() {
	cd "$builddir"

	make INSTALL_ROOT="$pkgdir"/ install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/50_$_pkgreal.ini
}

sha512sums="3f63d7ac852355dd1a877e6292c04d30b6f7bbd8137ce875f2b3db3f4788534309bba40f5916a59051a70404f5517935bea5338856982c2dba8c604e964512f9  libsodium-2.0.8.tgz"
