-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk9s.spec
79 lines (60 loc) · 2.25 KB
/
k9s.spec
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Name: k9s
Version: 0.31.3
Release: 1%{?dist}
Summary: Kubernetes CLI To Manage Your Clusters In Style!
License: Apache-2.0
URL: https://k9scli.io/
Source0: https://github.com/derailed/k9s/archive/v%{version}.tar.gz
#Source0: https://github.com/derailed/k9s/archive/master.tar.gz
# # libX11-devel
BuildRequires: make, git, go, wget, bsdtar, binutils, jq
%if 0%{?suse_version:1}
# -gold provides ld
BuildRequires: binutils-gold
%endif
# there's no debug files in this build
%define debug_package %{nil}
%description
K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project is to make it easier to navigate, observe and manage your applications in the wild. K9s continually watches Kubernetes for changes and offers subsequent commands to interact with your observed resources.
%prep
%autosetup -n %{name}-%{version}
# make sure we're using the developer required version
# useful when building in system that have an older go version
REQUIRED_GO_VERSION=$(grep -oP '^go \K(\d*\.(\d*)(\.\d*)?)$' go.mod)
echo "Target go version: $REQUIRED_GO_VERSION - %{_arch}"
# PATCH_GO_VERSION=$(curl "https://go.dev/dl/?mode=json" | jq -r ".[] | select(.version | startswith(\"go${REQUIRED_GO_VERSION}\")) | .version")
# echo "Ensuring minimal go version $PATCH_GO_VERSION"
# %{ix86}
%ifarch i386 i486 i586 i686 pentium3 pentium4 athlon geode
ARCH=386
%endif
# %{arm}
%ifarch armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
ARCH=armv6l
%endif
# %{arm64}
%ifarch aarch64
ARCH=arm64
%endif
%ifarch x86_64
ARCH=amd64
%endif
wget https://go.dev/dl/go${REQUIRED_GO_VERSION}.linux-${ARCH}.tar.gz
echo $PWD
ls
tar xzf go$REQUIRED_GO_VERSION.linux-${ARCH}.tar.gz
%build
export PATH=$PWD/go/bin:$PATH
go version
make build
%install
install -D -m 0755 %{_builddir}/%{name}-%{version}/execs/%{name} "%{buildroot}/%{_bindir}/%{name}"
%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%changelog
* Mon Mar 22 2021 Guilherme Cardoso <[email protected]> 0.24.3
- Build directly from master instead of the tagged version due to the dev bugfixing without releases
* Mon Nov 9 2020 Guilherme Cardoso <[email protected]> 0.23.9
- First release