kops: build with tarballs instead of git-clone

This commit is contained in:
Đoàn Trần Công Danh 2022-10-28 20:27:39 +07:00
parent f2a2ee975e
commit 0aa2dc9ae3

View file

@ -3,36 +3,20 @@ pkgname=kops
version=1.24.2 version=1.24.2
revision=1 revision=1
archs="x86_64*" archs="x86_64*"
build_wrksrc=src/k8s.io/kops
build_style=go build_style=go
go_import_path=k8s.io/kops go_import_path="k8s.io/kops/cmd/kops"
hostmakedepends="git" go_ldflags="-X k8s.io/kops.Version=${version} -X k8s.io/kops.GitVersion=${version}"
depends="kubectl" depends="kubectl"
short_desc="Production Grade K8s Installation, Upgrades, and Management" short_desc="Production Grade K8s Installation, Upgrades, and Management"
maintainer="Mate Gabri <iam@theguy.io>" maintainer="Mate Gabri <iam@theguy.io>"
license="Apache-2.0" license="Apache-2.0"
homepage="https://github.com/kubernetes/kops" homepage="https://github.com/kubernetes/kops"
distfiles="https://github.com/kubernetes/kops/archive/refs/tags/v${version}.tar.gz"
checksum=3ac82ce779e6a878b0434278e1bc2c4951c7c2a3f32376557bba7a23d1dc2cf9
do_fetch() { post_install() {
# We must clone it instead of downloading the tarball because the build ${DESTDIR}/usr/bin/kops completion bash >kops-completion.bash
# process expects the directory to be a git repository ${DESTDIR}/usr/bin/kops completion zsh >_kops
rm -rf $wrksrc vcompletion kops-completion.bash bash kops
mkdir -p $wrksrc/src/k8s.io vcompletion _kops zsh
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
} }