# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=postgresql-mysql_fdw
_projname=mysql_fdw
pkgver=2.9.1
_pkgver=REL-${pkgver//./_}
pkgrel=1
pkgdesc="PostgreSQL foreign data wrapper for MySQL/MariaDB"
url="https://github.com/EnterpriseDB/mysql_fdw"
arch="all"
license="PostgreSQL"
makedepends="mariadb-connector-c-dev postgresql-dev"
source="https://github.com/EnterpriseDB/mysql_fdw/archive/$_pkgver/$pkgname-$pkgver.tar.gz
	fix-RTLD_DEEPBIND-check.patch
	"
builddir="$srcdir/$_projname-$_pkgver"
options="!check"  # FIXME: requires running PostgreSQL

export USE_PGXS=1

build() {
	make
}

check() {
	make installcheck
}

package() {
	depends="postgresql$(pg_config --major-version)"

	make install DESTDIR="$pkgdir"
}

sha512sums="
b32827baaf523d5b9ee307a44ec8753e040f88e39f87d7df8c6b85a0bd79eab95fab3a236edbe75296b8e603aa13dc4a85bc0750e000cc2b420065fa430fca0f  postgresql-mysql_fdw-2.9.1.tar.gz
60ec2f8b026a52ac3f1c62b425bfe882fc321d3bd24646c513922a3a51c38efd44f3bb70d77f8ce94ff9db6f2554481c3e4a4b3458fb72060368f47921471f50  fix-RTLD_DEEPBIND-check.patch
"
