# Maintainer: Hoang Nguyen pkgname=openservicemesh-cli pkgver=1.2.4 pkgrel=3 pkgdesc="CLI for the Open Service Mesh (OSM)" url="https://openservicemesh.io/" arch="all" license="Apache-2.0" makedepends="go" options="!check" # requires a Kubernetes cluster subpackages=" $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion " source="osm-$pkgver.tar.gz::https://github.com/openservicemesh/osm/archive/refs/tags/v$pkgver.tar.gz" builddir="$srcdir/osm-$pkgver" 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/openservicemesh/osm/pkg/version.BuildDate=$(date -u "+%Y-%m-%d-%H:%M" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH}) -X github.com/openservicemesh/osm/pkg/version.Version=v$pkgver -X github.com/openservicemesh/osm/pkg/version.GitCommit=AlpineLinux " make cmd/cli/chart.tgz go build -v -o ./bin/osm -ldflags "$_goldflags" ./cmd/cli for shell in bash fish zsh; do ./bin/osm completion $shell > osm.$shell done } package() { install -Dm755 bin/osm -t "$pkgdir"/usr/bin/ install -Dm644 osm.bash \ "$pkgdir"/usr/share/bash-completion/completions/osm install -Dm644 osm.fish \ "$pkgdir"/usr/share/fish/vendor_completions.d/osm.fish install -Dm644 osm.zsh \ "$pkgdir"/usr/share/zsh/site-functions/_osm } sha512sums=" 50e1d42792ddc1ae01740885ea407fa73c7d6b1db592461fe0e07eb2ea213bb013b1065b5dac79f27d612daaea507fe2e761cd74fc5abca5d31645c8395ac724 osm-1.2.4.tar.gz "