# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-redis
_pkgreal=redis
pkgver=3.1.5
pkgrel=0
_phpver=${pkgname#php}
_phpver=${_phpver%%-*}
pkgdesc="PHP$_phpver extension for interfacing with Redis"
url="https://pecl.php.net/package/redis"
arch="all"
license="PHP"
depends="php$_phpver-common php$_phpver-session"
makedepends="php$_phpver-dev autoconf"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
options="!check"
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"/20_$_pkgreal.ini
}

sha512sums="9d19d8ff2af92ef4da5c8d82daec6307c66db7c3f5171f8ad7d834b01f77ac488b66bd74e6223e76ea7bc6936188341f347756e2f0bbb63ce4a149341c3d6a92  php7-redis-3.1.5.tgz"
