# Maintainer: Erich Eckner # Contributor: Carl Smedstad # Contributor: William Aass Dahlen pkgname=azure-kubelogin _name=kubelogin pkgver=0.1.6 pkgrel=1 pkgdesc="A Kubernetes credential (exec) plugin implementing azure authentication" arch=(x86_64) url="https://github.com/Azure/kubelogin" license=(MIT) makedepends=(go) _pinned_dependencies=( 'glibc>=2.38' ) depends=("${_pinned_dependencies[@]}") conflicts=(kubelogin) source=("$pkgname-$pkgver.tar.gz::https://github.com/Azure/$_name/archive/refs/tags/v$pkgver.tar.gz") sha512sums=('2d65724bd470e06aacbbbb3872d283c175b1e1f4411c3d3107107be3bd013935d1e66f79d459b98ff01c8e3c28e7a41d45d8bd2ab463641deab112ed92ea2dba') _archive="$_name-$pkgver" build() { cd "$_archive" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" _go_version=$(go version | cut -d " " -f 3) _ld_flags=" \ -linkmode external \ -X main.version=v$pkgver/? \ -X main.goVersion=$_go_version \ -X 'main.platform=linux/amd64' \ " go build -ldflags "$_ld_flags" . } check() { cd "$_archive" go test ./... } package() { cd "$_archive" install -Dm755 kubelogin "$pkgdir/usr/bin/kubelogin" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }