# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=postgresql-bdr-extension0.9
pkgver=0.9.0
pkgrel=1
pkgdesc="PostgreSQL bidirectional replication (BDR) extension"
url="https://wiki.postgresql.org/wiki/BDR_Administration"
arch="all !riscv64"
license="GPL"
makedepends="$depends_dev postgresql-bdr-dev automake autoconf openssl-dev>3"
subpackages="$pkgname-doc"
# FIXME: mkdir: can't create directory 'tmp_check/data': File exists
options="!check"
source="https://github.com/2ndQuadrant/bdr/archive/bdr-plugin/$pkgver/bdr-$pkgver.tar.gz"
builddir="$srcdir/bdr-bdr-plugin-$pkgver"

prepare() {
	default_prepare

	./autogen.sh
}

build() {
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-bdr
	make
}

check() {
	make DESTDIR="$pkgdir" check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
be4a98d19be4bef8c1f9129fb92f082287e79620639a5e50f080cb6ae20bde3ab899323e9b51316288b3a86a1252e29a9ffa20bdcbd36fc8333ecd994f518e9c  bdr-0.9.0.tar.gz
"
