# Maintainer: Hoang Nguyen pkgname=kubectl-krew pkgver=0.4.3 pkgrel=12 pkgdesc="Find and install kubectl plugins" url="https://krew.sigs.k8s.io/" arch="all !armhf !riscv64" # kubectl license="Apache-2.0" depends="kubectl" makedepends="go" source="$pkgname-$pkgver.tar.gz::https://github.com/kubernetes-sigs/krew/archive/refs/tags/v$pkgver.tar.gz" builddir="$srcdir/krew-$pkgver" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { GOLDFLAGS=" -X sigs.k8s.io/krew/internal/version.gitCommit=AlpineLinux -X sigs.k8s.io/krew/internal/version.gitTag=v$pkgver " go build -tags netgo -ldflags "$GOLDFLAGS" -o bin/$pkgname ./cmd/krew/main.go } check() { # uses github api and gets 403 # shellcheck disable=2046 KREW_BINARY="$builddir/bin/$pkgname" go test $(go list ./... | grep -Ev '(cmd/internal)') } package() { install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname } sha512sums=" a9846b98e9ddcb6912df8821fc9b99ed007806a6e940032c08146b79a15896e30f6ed49780ba84f3c388cd98dba866efeec968ef4ce8eda4faa0c1426fd9b145 kubectl-krew-0.4.3.tar.gz "