aports/testing/spacectl/APKBUILD
2025-04-11 19:40:50 +02:00

54 lines
1.4 KiB
Text

# Maintainer: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
pkgname=spacectl
pkgver=1.9.0
pkgrel=2
pkgdesc="A Utility wrapping Spacelift's GraphQL API for easy programmatic access in command-line contexts."
url="https://github.com/spacelift-io/spacectl"
arch="all"
license="MIT"
makedepends="go"
subpackages="
$pkgname-doc
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
source="$pkgname-$pkgver.tar.gz::https://github.com/spacelift-io/spacectl/archive/refs/tags/v$pkgver.tar.gz"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
prepare() {
default_prepare
go mod download
}
build() {
go build .
for shell in bash fish zsh; do
./spacectl completion $shell > spacectl.$shell
done
}
check() {
go test ./...
}
package() {
install -Dm0755 spacectl -t "$pkgdir"/usr/bin/
install -Dm0644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
install -Dm0644 spacectl.bash \
"$pkgdir"/usr/share/bash-completion/completions/spacectl
install -Dm0644 spacectl.fish \
"$pkgdir"/usr/share/fish/vendor_completions.d/spacectl.fish
install -Dm0644 spacectl.zsh \
"$pkgdir"/usr/share/zsh/site-functions/_spacectl
}
sha512sums="
2805c8e929aee15caaeb11e023d3b2c1453c11b584524c4e068645e25baa96f8377f158843b2b20170f9dcf28460ba8b849138c8363609a8a92df3c2549f9012 spacectl-1.9.0.tar.gz
"