cilium-cli/cilium-cli.spec

52 lines
1,020 B
RPMSpec
Raw Normal View History

2024-06-14 23:28:22 +03:00
%define debug %nil
%define debug_package %nil
2024-11-08 08:08:13 +00:00
%define secscan 0
2024-06-14 23:28:22 +03:00
Name: cilium-cli
2024-12-13 20:30:16 +00:00
Version: 0.16.22
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-12-06 18:50:57 +00:00
BuildRequires: pkgconfig(openssl3.3)
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