File kubectl.spec of Package kubectl
#
# spec file for package kubectl
#
# Copyright (c) 2021 NDE Netzdesign und -entwicklung AG, Hamburg, Germany
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Name: kubectl
Version: 1.32.0
Release: 0
Summary: Official Kubernetes command-line tool
License: Apache-2.0
Group: Productivity/Clustering/Computing
Url: https://github.com/kubernetes/kubectl
Source: %{name}-%{version}.tar.bz2
#BuildRequires:
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This is the official Kubernetes command-line tool for managing Kubernetes clusters.
As of now, this is a "binary-only" package, shipping the officially downloadable 64-bit kubectl program:
versionstr=$(curl -L -s https://dl.k8s.io/release/stable.txt) && \
version="${versionstr#[^0-9]*}" && \
mkdir kubectl-${version} && \
curl -o kubectl-${version}/kubectl -L "https://dl.k8s.io/release/${versionstr}/bin/linux/amd64/kubectl" && \
tar -cjf kubectl-${version}.tar.bz2 kubectl-${version} && \
rm -rf kubectl-${version} && \
sed -i "^Version:.*$/Version: $version" kubectl.spec
%prep
echo "prep stage:"
ls -lR
%setup -q
%build
ls -lR
echo "Nothing to do for build yet."
%install
ls -lR
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%changelog