sys-cluster/kubectl: Remove old
[gentoo.git] / sys-cluster / kubectl / kubectl-1.9.8.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit golang-build golang-vcs-snapshot bash-completion-r1
6
7 EGO_PN="k8s.io/kubernetes"
8 ARCHIVE_URI="https://github.com/kubernetes/kubernetes/archive/v${PV}.tar.gz -> kubernetes-${PV}.tar.gz"
9 KEYWORDS="~amd64"
10
11 DESCRIPTION="CLI to run commands against Kubernetes clusters"
12 HOMEPAGE="https://github.com/kubernetes/kubernetes https://kubernetes.io"
13 SRC_URI="${ARCHIVE_URI}"
14
15 LICENSE="Apache-2.0"
16 SLOT="0"
17 IUSE=""
18
19 DEPEND="dev-go/go-bindata"
20
21 RESTRICT="test"
22
23 src_prepare() {
24         default
25         sed -i -e "/vendor\/github.com\/jteeuwen\/go-bindata\/go-bindata/d" src/${EGO_PN}/hack/lib/golang.sh || die
26         sed -i -e "/export PATH/d" src/${EGO_PN}/hack/generate-bindata.sh || die
27 }
28
29 src_compile() {
30         LDFLAGS="" GOPATH="${WORKDIR}/${P}" emake -j1 -C src/${EGO_PN} WHAT=cmd/${PN} GOFLAGS=-v
31         pushd src/${EGO_PN} || die
32         _output/bin/${PN} completion bash > ${PN}.bash || die
33         _output/bin/${PN} completion zsh > ${PN}.zsh || die
34         popd || die
35 }
36
37 src_install() {
38         pushd src/${EGO_PN} || die
39         dobin _output/bin/${PN}
40
41         newbashcomp ${PN}.bash ${PN}
42         insinto /usr/share/zsh/site-functions
43         newins ${PN}.zsh _${PN}
44
45         popd || die
46 }