From 0aa2dc9ae3b37e57e31940a82e171a9d6e00853a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 28 Oct 2022 20:27:39 +0700 Subject: [PATCH] kops: build with tarballs instead of git-clone --- srcpkgs/kops/template | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/srcpkgs/kops/template b/srcpkgs/kops/template index 4c2745e19a7..289400dc23c 100644 --- a/srcpkgs/kops/template +++ b/srcpkgs/kops/template @@ -3,36 +3,20 @@ pkgname=kops version=1.24.2 revision=1 archs="x86_64*" -build_wrksrc=src/k8s.io/kops build_style=go -go_import_path=k8s.io/kops -hostmakedepends="git" +go_import_path="k8s.io/kops/cmd/kops" +go_ldflags="-X k8s.io/kops.Version=${version} -X k8s.io/kops.GitVersion=${version}" depends="kubectl" short_desc="Production Grade K8s Installation, Upgrades, and Management" maintainer="Mate Gabri " license="Apache-2.0" homepage="https://github.com/kubernetes/kops" +distfiles="https://github.com/kubernetes/kops/archive/refs/tags/v${version}.tar.gz" +checksum=3ac82ce779e6a878b0434278e1bc2c4951c7c2a3f32376557bba7a23d1dc2cf9 -do_fetch() { - # We must clone it instead of downloading the tarball because the build - # process expects the directory to be a git repository - rm -rf $wrksrc - mkdir -p $wrksrc/src/k8s.io - git clone -b v${version} https://github.com/kubernetes/kops \ - $wrksrc/src/k8s.io/kops -} - -do_build() { - export GOPATH="$wrksrc" - - make kops - - ${wrksrc}/src/k8s.io/kops/.build/dist/linux/amd64/kops completion bash > completion.bash - ${wrksrc}/src/k8s.io/kops/.build/dist/linux/amd64/kops completion zsh | sed -n '/#compdef/,$p' > completion.zsh -} - -do_install() { - vbin ${wrksrc}/src/k8s.io/kops/.build/dist/linux/amd64/kops - vinstall completion.bash 644 usr/share/bash-completion/completions kops - vinstall completion.zsh 644 usr/share/zsh/site-functions _kops +post_install() { + ${DESTDIR}/usr/bin/kops completion bash >kops-completion.bash + ${DESTDIR}/usr/bin/kops completion zsh >_kops + vcompletion kops-completion.bash bash kops + vcompletion _kops zsh }