mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-08 18:22:30 +01:00
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
|
|
pkgname=kanister-tools
|
|
pkgver=0.98.0
|
|
pkgrel=0
|
|
pkgdesc="CLI tools for application-level data management on Kubernetes"
|
|
url="https://kanister.io/"
|
|
arch="all"
|
|
license="Apache-2.0"
|
|
makedepends="go"
|
|
subpackages="
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/kanisterio/kanister/archive/refs/tags/$pkgver.tar.gz"
|
|
builddir="$srcdir/kanister-$pkgver"
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
build() {
|
|
local _goldflags="
|
|
-X github.com/kanisterio/kanister/pkg/version.VERSION=$pkgver
|
|
-X github.com/kanisterio/kanister/pkg/version.GIT_COMMIT=AlpineLinux
|
|
-X github.com/kanisterio/kanister/pkg/version.BUILD_DATE=$(date -u "+%Y-%m-%dT%TZ" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
|
|
"
|
|
for binary in kanctl kando; do
|
|
go build -v -o $binary \
|
|
-ldflags "$_goldflags" \
|
|
./cmd/$binary
|
|
|
|
for shell in bash fish zsh; do
|
|
./$binary completion $shell > $binary.$shell
|
|
done
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# Only run tests for the built binaries.
|
|
# Some of the other tests require a Kubernetes cluster to run
|
|
for binary in kanctl kando; do
|
|
go test ./pkg/$binary/...
|
|
done
|
|
}
|
|
|
|
package() {
|
|
for binary in kanctl kando; do
|
|
install -Dm755 $binary -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 $binary.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/$binary
|
|
install -Dm644 $binary.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/$binary.fish
|
|
install -Dm644 $binary.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_$binary
|
|
done
|
|
}
|
|
|
|
sha512sums="
|
|
c4c5aecee55bf6ec44c545e70c73aae47907a1701440eaa652ecc7a3798b8986b589c067eb4ebda431b48e0b65bcaae3a7217a79b44cdba23bc6b1d3b0aedae4 kanister-tools-0.98.0.tar.gz
|
|
"
|