cilium-cli/cilium-cli.spec

52 lines
983 B
RPMSpec
Raw Permalink Normal View History

2024-06-14 23:28:22 +03:00
%define debug %nil
%define debug_package %nil
2024-06-27 18:50:57 +00:00
%define secscan 1
2024-06-14 23:28:22 +03:00
Name: cilium-cli
2024-08-20 10:27:41 +00:00
Version: 0.16.16
2024-06-14 23:28:22 +03:00
Release: 1
Summary: CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
URL: https://cilium.io
Source0: https://github.com/cilium/cilium-cli/archive/v%{version}/%{name}-%{version}.tar.gz
License: ASL 2.0
Group: Development/Other
BuildRequires: go
BuildRequires: git-core
BuildRequires: upx
2024-06-27 18:50:57 +00:00
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
2024-06-14 23:28:22 +03:00
%description
%{summary}
%prep
%setup -q
2024-06-27 18:50:57 +00:00
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
2024-06-14 23:28:22 +03:00
%build
CGO_ENABLED=0 go build -ldflags '-w -s -X github.com/cilium/cilium-cli/defaults.CLIVersion=%{version}' -o bin/%{name} ./cmd/cilium
upx bin/%{name}
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
%files
%doc README.md LICENSE
%{_bindir}/%{name}
2024-06-27 18:50:57 +00:00
%check
export GOPROXY=direct
go test ./...
2024-06-14 23:28:22 +03:00
2024-06-27 18:50:57 +00:00
%if %{secscan}
clamscan -ir %{buildroot}
%endif