blob: 12bd6f5897bb5180894e2c1200c5a3a747563b6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module shell-completion
DESCRIPTION="kubectl plugin for Kubernetes OpenID Connect authentication"
HOMEPAGE="https://github.com/int128/kubelogin"
SRC_URI="https://github.com/int128/kubelogin/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://distfiles.gentoo.org/pub/dev/concord@gentoo.org/${P}-deps.tar.xz"
LICENSE="Apache-2.0 BSD BSD-2 ISC MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
BDEPEND=">=dev-lang/go-1.26.4:="
QA_PRESTRIPPED="usr/bin/kubectl-oidc_login"
src_prepare() {
default
# -buildmode=pie not supported when -race is enabled
if [[ ${GOFLAGS} == *buildmode=pie* ]]; then
sed -e 's/ -race / /' -i Makefile || die
fi
}
src_compile() {
ego build -ldflags="-s -w" -o ./bin/${PN} .
}
src_install() {
newbin bin/${PN} "kubectl-oidc_login"
bin/${PN} completion bash > ${PN}.bash || die
bin/${PN} completion zsh > ${PN}.zsh || die
newbashcomp ${PN}.bash ${PN}
newzshcomp ${PN}.zsh _${PN}
}
|