mirror of
https://abf.rosa.ru/djam/trivy.git
synced 2025-02-24 08:52:53 +00:00
55 lines
No EOL
1.1 KiB
RPMSpec
55 lines
No EOL
1.1 KiB
RPMSpec
%define debug %nil
|
|
%define debug_package %nil
|
|
|
|
%define secscan 0
|
|
|
|
Name: trivy
|
|
Version: 0.59.1
|
|
Release: 1
|
|
Summary: Vulnerability Scanner for Containers
|
|
URL: https://github.com/aquasecurity/trivy
|
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
License: ASL 2.0
|
|
Group: Development/Other
|
|
BuildRequires: go >= 1.15
|
|
BuildRequires: git-core
|
|
BuildRequires: upx
|
|
BuildRequires: pkgconfig(openssl3.3)
|
|
|
|
%if %{secscan}
|
|
BuildRequires: clamav
|
|
BuildRequires: trivy
|
|
%endif
|
|
|
|
|
|
%description
|
|
A Simple and Comprehensive Vulnerability Scanner for
|
|
Containers, Suitable for CI
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
%if %{secscan}
|
|
clamscan -ir .
|
|
trivy fs --scanners vuln --format cosign-vuln .
|
|
%endif
|
|
|
|
%build
|
|
export GOPROXY=https://proxy.golang.org/cached-only
|
|
CGO_ENABLED=0 go build -ldflags="-s -w -extldflags '-static' -X github.com/aquasecurity/trivy/pkg/version/app.ver=%{version}" -o %{name} cmd/trivy/main.go
|
|
upx %{name}
|
|
|
|
%install
|
|
install -Dm0755 %{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
%files
|
|
%doc README.md LICENSE
|
|
%{_bindir}/%{name}
|
|
|
|
%check
|
|
export GOPROXY=https://proxy.golang.org/cached-only
|
|
#go test ./...
|
|
|
|
%if %{secscan}
|
|
clamscan -ir %{buildroot}
|
|
%endif |