# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kine
pkgver=0.10.1
pkgrel=13
pkgdesc="etcd API with sqlite, Postgres, Mysql, or dqlite backed"
url="https://github.com/k3s-io/kine"
arch="all"
license="Apache-2.0"
makedepends="sqlite-dev go"
subpackages="$pkgname-doc"
options="!check" # no testsuite
source="$pkgname-$pkgver.tar.gz::https://github.com/k3s-io/kine/archive/v$pkgver.tar.gz
	update-etcd-bbolt.patch
	"
provides="etcd-api"
provider_priority=1

export GOFLAGS="$GOFLAGS -tags=libsqlite3"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v .
}

package() {
	install -D -m755 kine "$pkgdir"/usr/bin/kine
	install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/kine/LICENSE
}

sha512sums="
01b94a0ede751d03ef91c8a33be65fc95212147cec5df7eecbb6b6b35af0d1f002abed6c22caedeea38c13f5422b8385d5d7d8ff1d5ade9046964e0a30eec5f7  kine-0.10.1.tar.gz
5985df657877b3c36e561b8f57edd408d8bb254143e904811432164518c54059bbf49370dc23c26d0a1441b62ced697f89bc5084caebae4feb943576dd763e2b  update-etcd-bbolt.patch
"
