# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=alpine-repo-tools
pkgver=0.3.0
pkgrel=10
pkgdesc="utilities to interact with Alpine Linux repositories"
url="https://gitlab.alpinelinux.org/alpine/infra/repo-tools"
arch="all"
license="MIT"
makedepends="go redo scdoc gettext"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
options="net !check" # no test suite
source="https://gitlab.alpinelinux.org/alpine/infra/repo-tools/-/archive/v$pkgver/repo-tools-v$pkgver.tar.gz
	fish.patch
	"
builddir="$srcdir/repo-tools-v$pkgver"

provides="repo-tools=$pkgver-r$pkgrel"
replaces="repo-tools"

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

build() {
	echo "$builddir"
	./configure --prefix /usr --strip

	redo
}

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

sha512sums="
d87d5be5654736e6b19bee807858c8d042ffd7904200a204bb83c008b15d7da8e4711a842f00a41420bcc909e059110fd6c28cca4c52e356284aaa019816023d  repo-tools-v0.3.0.tar.gz
642798931f85159a88cab72a4445b353e7388d62f2bec2552d7b4174a81d49967ef93c1e036c932daa20d6d6add8fe9aefbcbf2fbb2b6c3e9e7aff50885b56db  fish.patch
"
