# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
setvar pkgname = 'php7-memcached'
setvar _pkgreal = 'memcached'
setvar pkgver = '3.0.3'
setvar pkgrel = '1'
setvar _phpver = ${pkgname#php}
setvar _phpver = ${_phpver%%-*}
setvar pkgdesc = ""PHP$_phpver extension for interfacing with memcached via libmemcached library""
setvar url = ""http://pecl.php.net/package/memcached""
setvar arch = ""all""
setvar license = ""PHP""
setvar depends = ""php$_phpver-common php$_phpver-session""
setvar makedepends = ""php$_phpver-dev autoconf zlib-dev libmemcached-dev cyrus-sasl-dev""
setvar source = ""$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz""
setvar options = ""!check""  # tests fail b/c of not loaded session module
setvar builddir = ""$srcdir/$_pkgreal-$pkgver""

proc build {
	cd $builddir

	phpize$_phpver
	./configure \
		--prefix=/usr \
		--with-php-config=php-config$_phpver \
		--disable-memcached-sasl
	make
}

proc 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
}

setvar sha512sums = ""cb24d76f82ce8c1fdd8877bbb46131545bba5011cfff965e3c190b7c0f71f754b47ded6289d3125724d9de781b916971aaadfa0b247c6fe2f51aab77dce61b61  php7-memcached-3.0.3.tgz""