# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=php7-gmagick
_pkgreal=gmagick
pkgver=2.0.4_rc1
_pkgver=${pkgver/_rc/RC}
pkgrel=4
pkgdesc="PHP7 bindings to the GraphicsMagick library"
url="http://pecl.php.net/package/gmagick"
arch="all"
license="PHP"
depends=
makedepends="graphicsmagick-dev autoconf libtool php7-dev"
install=
subpackages=
source="http://pecl.php.net/get/$_pkgreal-$_pkgver.tgz"
builddir="$srcdir/$_pkgreal-$_pkgver"

prepare() {
	default_prepare || return 1

	cd "$builddir"
	phpize7 || return 1
}

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--with-php-config=/usr/bin/php-config7 \
	|| return 1
	make || return 1
}

package() {
	cd "$builddir"
	make INSTALL_ROOT="$pkgdir" install || return 1
	install -d "$pkgdir"/etc/php7/conf.d || return 1
	echo "extension=$_pkgreal.so" > \
		"$pkgdir"/etc/php7/conf.d/$_pkgreal.ini
}

md5sums="75bd382e666033dbb7a8fab9088dc827  gmagick-2.0.4RC1.tgz"
sha256sums="4ead19640bebebfa68be41dc0097a93a7bf9beb56ea82b27343dba8ea4c5ecfa  gmagick-2.0.4RC1.tgz"
sha512sums="c8d877ab371fe57e07134bbe09bb24dcf20cd3d6310a212c395c89e27e783cb939c05ff80efdd6c47580ef54e315d75793e5c85c90b11c79796e60315e063916  gmagick-2.0.4RC1.tgz"
