## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.19.0 %bcond check 1 # Only use libsqlite3 on EL 9 where the version in the repos is too old %bcond bundled_libsqlite3 %{undefined el9} # https://github.com/aquasecurity/trivy %global goipath github.com/aquasecurity/trivy Version: 0.69.3 # NOTE(gotmax23): Do not enable -f. # This package deliberately builds for ix86 to allow license scanning for other # Go packages that still build for that architecture. %gometa -L Name: trivy Release: %autorelease Summary: Vulnerability and license scanner # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSL-1.0 AND ISC AND LicenseRef-Fedora-Public-Domain AND MIT AND MIT-0 AND MPL-2.0 AND OFL-1.1-RFN AND Unicode-DFS-2016 AND Unlicense AND (Apache-2.0 OR GPL-2.0-or-later) URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml BuildRequires: git-core BuildRequires: go-vendor-tools BuildRequires: sqlite-devel %if %{with bundled_libsqlite3} # mattn/go-sqlite3 bundles libsqlite3 C code Provides: bundled(sqlite-libs) %endif %description Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more. %prep %goprep -p1 tar -xf %{S:1} # Keep in sync with go-vendor-tools.toml sed -i 's|_ "modernc.org/sqlite"|_ "github.com/mattn/go-sqlite3"|' \ $(grep -rl '_ "modernc.org/sqlite"' pkg/ cmd/ integration/) %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build # Set the package version in the binary # Change go-sqlite3 driver name for compatibility with modernc sqlite %global our_goldflags %{shrink: -X github.com/aquasecurity/trivy/pkg/version/app.ver=%{version} -X github.com/mattn/go-sqlite3.driverName=sqlite } export GO_LDFLAGS="%our_goldflags" export GOEXPERIMENT="nodwarf5,jsonv2" %if %{without bundled_libsqlite3} export GO_BUILDTAGS="libsqlite3" %endif export CGO_CFLAGS="%{build_cflags}" CGO_LDFLAGS="%{build_ldflags}" # This package does not build without go modules enabled %global gomodulesmode GO111MODULE=on %gobuild -o trivy %{goipath}/cmd/trivy ./trivy completion bash > trivy.bash ./trivy completion fish > trivy.fish ./trivy completion zsh > trivy.zsh %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp trivy %{buildroot}%{_bindir}/ install -Dpm 0755 trivy.bash %{buildroot}%{bash_completions_dir}/trivy install -Dpm 0755 trivy.fish %{buildroot}%{fish_completions_dir}/trivy.fish install -Dpm 0755 trivy.zsh %{buildroot}%{zsh_completions_dir}/_trivy %go_vendor_license_install -c %{SOURCE2} -d trivy -D "trivy_path=$(pwd)/trivy" %check skiptest() { for test in "$@"; do awk -i inplace '/^func.*'"${test}"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' \ $(grep -rl "${test}") done } %go_vendor_license_check -c %{S:2} -d trivy -D "trivy_path=$(pwd)/trivy" %if %{with check} # Disable tests that require WASM, generated code, or networking rm -v \ pkg/fanal/artifact/repo/git_test.go \ pkg/module/module_test.go %ifarch s390x skiptest Test_dbWorker_update TestFSCache_GetBlob TestFSCache_MissingBlobs %endif # Panicing for unknown reason skiptest Test_rpmArchiveAnalyzer_Analyze %ifarch %{ix86} skiptest TestArtifact_InspectWithMaxImageSize %endif skiptest TestArtifact_Inspect # Terraform tests attempt to connect to the terraform registry find pkg/iac/scanners/terraform*/ -name '*_test.go' -print -delete export GOEXPERIMENT="nodwarf5,jsonv2" export GO_LDFLAGS="%our_goldflags" %if %{without bundled_libsqlite3} export GO_BUILDTAGS="libsqlite3" %endif %dnl export CGO_CFLAGS="%{build_cflags}" CGO_LDFLAGS="%{build_ldflags}" %gotest ./... %endif %files -f %{go_vendor_license_filelist} %doc CHANGELOG.md CONTRIBUTING.md README.md SECURITY.md %{_bindir}/trivy %{bash_completions_dir}/trivy %{fish_completions_dir}/trivy.fish %{zsh_completions_dir}/_trivy %changelog ## START: Generated by rpmautospec * Tue Apr 07 2026 Maxwell G - 0.69.3-2 - Uncommitted changes * Fri Apr 03 2026 Mikel Olasagasti Uranga - 0.69.3-1 - Update to 0.69.3 - Closes rhbz#2419395 * Tue Feb 03 2026 Maxwell G - 0.67.2-3 - Rebuild for https://fedoraproject.org/wiki/Changes/golang1.26 * Sat Jan 17 2026 Fedora Release Engineering - 0.67.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild * Sun Oct 12 2025 Maxwell G - 0.67.2-1 - Update to 0.67.2. Fixes rhbz#2385338. - Add missing bundled() Provides for Go modules * Fri Oct 10 2025 Alejandro Sáez - 0.64.1-4 - rebuild * Fri Aug 15 2025 Maxwell G - 0.64.1-3 - Rebuild for golang-1.25.0 * Fri Jul 25 2025 Fedora Release Engineering - 0.64.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Fri Jul 11 2025 Maxwell G - 0.64.1-1 - Update to 0.64.1. * Fri Jun 27 2025 Maxwell G - 0.63.0-1 - Update to 0.63.0. Fixes rhbz#2355701. * Sun Mar 23 2025 Maxwell G - 0.60.0-1 - Update to 0.60.0. Fixes rhbz#2350075. * Sun Mar 23 2025 Maxwell G - 0.59.1-3 - Add missing licensing files not detected by trivy * Wed Feb 12 2025 Maxwell G - 0.59.1-2 - Skip failing test on %%ix86 * Tue Feb 11 2025 Maxwell G - 0.59.1-1 - Update to 0.59.1. Fixes rhbz#2316625. * Tue Feb 11 2025 Maxwell G - 0.58.1-1 - Update to 0.58.1. Fixes rhbz#2316625. * Sun Jan 19 2025 Fedora Release Engineering - 0.55.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Sat Sep 21 2024 Maxwell G - 0.55.2-1 - Update to 0.55.2. Fixes rhbz#2309677. * Wed Aug 21 2024 Maxwell G - 0.54.1-1 - Update to 0.54.1. Fixes rhbz#2302505. * Fri Jul 19 2024 Maxwell G - 0.53.0-3 - Adjust for test file changes * Wed Jul 17 2024 Maxwell G - 0.53.0-2 - Add missing git-core test dependency * Wed Jul 17 2024 Maxwell G - 0.53.0-1 - Update to 0.53.0. Fixes rhbz#2277210. * Thu May 02 2024 Maxwell G - 0.50.4-1 - Update to 0.50.4. Fixes rhbz#2277210. * Tue Apr 23 2024 Maxwell G - 0.50.2-1 - Update to 0.50.2. Fixes rhbz#2276563. * Sat Apr 13 2024 Maxwell G - 0.50.1-2 - Enable i686 builds * Sat Apr 06 2024 Maxwell G - 0.50.1-1 - Update to 0.50.1. * Sat Apr 06 2024 Maxwell G - 0.50.0-1 - Initial import (rhbz#2272258) ## END: Generated by rpmautospec