# Maintainer: Hoang Nguyen pkgname=kubeshark pkgver=40.2 pkgrel=2 pkgdesc="API traffic viewer for Kubernetes" url="https://kubeshark.co/" 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/kubeshark/kubeshark/archive/refs/tags/$pkgver.tar.gz" export CGO_ENABLED=0 export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { local _goldflags=" -X github.com/kubeshark/kubeshark/misc.GitCommitHash=AlpineLinux -X github.com/kubeshark/kubeshark/misc.Branch=main -X github.com/kubeshark/kubeshark/misc.BuildTimestamp=$(date -u "+%s" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH}) -X github.com/kubeshark/kubeshark/misc.Platform=linux_$(go env GOARCH) -X github.com/kubeshark/kubeshark/misc.Ver=$pkgver " go build -v -o bin/$pkgname -ldflags "$_goldflags" kubeshark.go for shell in bash fish zsh; do ./bin/$pkgname completion $shell > $pkgname.$shell done } check() { go test ./... } package() { install -Dm755 bin/$pkgname -t "$pkgdir"/usr/bin/ install -Dm644 $pkgname.bash \ "$pkgdir"/usr/share/bash-completion/completions/$pkgname install -Dm644 $pkgname.fish \ "$pkgdir"/usr/share/fish/vendor_completions.d/$pkgname.fish install -Dm644 $pkgname.zsh \ "$pkgdir"/usr/share/zsh/site-functions/_$pkgname } sha512sums=" 07d9825b87255f1f43ea304a37320b5466b238d0c01afcbccd7ecf3c77765e6f71c6737af9050dc5fcea02bec761bb1f9e764072291d4af8eca1196b0a62d79e kubeshark-40.2.tar.gz "