# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=cowsql
pkgver=1.15.6
pkgrel=0
pkgdesc="Embeddable, replicated and fault tolerant SQL engine"
url="https://github.com/cowsql/cowsql"
arch="all"
license="LGPL-3.0-only WITH LGPL-3.0-linking-exception"
makedepends="libuv-dev sqlite-dev raft-cowsql-dev autoconf automake libtool"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
case "$CARCH" in
	x86_64) options="!check" ;; #1 test hangs
esac
source="$pkgname-$pkgver.tar.gz::https://github.com/cowsql/cowsql/archive/refs/tags/v$pkgver.tar.gz
	no-werror.patch
	"

prepare() {
	default_prepare
	autoreconf -i
}

build() {
	./configure  \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
78436fc35ab22fed1aef1d1048e41fbd6ec75a7b8fc95f09bc7468cde0ea8d8851e4ef5ee738699810abf3054826ab7cfd21dc06964603acea240b0fc7943c4d  cowsql-1.15.6.tar.gz
3979f6476d819d67007381d1b3c29c1444973f9dc17e2d637eeb455404c1a1039f4191cf8a844639fb61aee2e3d0661b9c8b70383790920d79c14cf3482eec67  no-werror.patch
"
