# Contributor: Michał Polański # Maintainer: Michał Polański pkgname=hcloud _pkgname=cli pkgver=1.16.1 pkgrel=0 pkgdesc="Command-line interface for Hetzner Cloud" url="https://github.com/hetznercloud/cli" arch="all" license="MIT" makedepends="go" subpackages="$pkgname-bash-completion:bashcomp:noarch" source="$_pkgname-$pkgver.tar.gz::https://github.com/hetznercloud/cli/archive/v$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" build() { go build \ -ldflags "-w -X github.com/hetznercloud/cli/cli.Version=v$pkgver" \ -v \ ./cmd/hcloud ./hcloud completion bash > "$builddir"/$pkgname.bash } check() { go test ./... } package() { install -Dm755 "$builddir"/hcloud "$pkgdir"/usr/bin/$pkgname } bashcomp() { pkgdesc="Bash completions for $pkgname" depends="" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" install -Dm644 "$builddir"/$pkgname.bash \ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname } sha512sums="2484f5ba7d866f7a38ae4eaa89780d61a1f0244acd6de642866a8f1446b58d87bbf1062493f4769fb71c28be03645085ba74654f6e82dd13cbe42c37ee1da5ae cli-1.16.1.tar.gz"