# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-timezonedb
_pkgreal=timezonedb
pkgver=2018.9
pkgrel=0
pkgdesc="Timezone Database to be used with PHP's date and time functions."
url="https://pecl.php.net/package/timezonedb"
arch="all"
license="PHP"
depends="php7-common"
makedepends="php7-dev autoconf re2c"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
options="!check"  # upstream does not provide tests yet
provides="php7-timezonedb=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-timezonedb" # for backward compatibility

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/40_$_pkgreal.ini
}

sha512sums="77fabe3aa0283900ea2d3d20caaf7c4b9bac1859249c9df4f0225c203fc92310dfe9b4144640af034a4ba86ba78a748a39980ff796affc67edc99ec874867e06  timezonedb-2018.9.tgz"