# Generated with go2rpm 1.19.0, then customized for Fedora review. # Binary package only (scalibr CLI). Go deps are vendored in Source1. %bcond check 0 # https://github.com/google/osv-scalibr %global goipath github.com/google/osv-scalibr Version: 0.5.4 %gometa -L -f Name: osv-scalibr Release: %autorelease Summary: OSV Software Composition Analysis Library CLI (SCALIBR) # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Sleepycat AND blessing URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools (packager host); not required in the buildroot beyond BR Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml # Temporary until https://github.com/google/osv-scalibr/pull/2686 merges: # map Rocky inventory to "Rocky Linux:" so OSV.dev RLSA matching is correct. Patch0: 0001-Include-Rocky-Linux-major-version-in-OSV-ecosystem-m.patch BuildRequires: go-vendor-tools BuildRequires: gcc BuildRequires: git %description OSV-SCALIBR (Software Composition Analysis Library) is an extensible library and CLI for extracting software inventory, detecting known vulnerabilities, and generating SBOMs from filesystems and container images. This package provides the scalibr CLI. Go module dependencies are vendored in Source1 so the build does not need a module proxy. %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} %autopatch -p1 %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on # CGO for SQLite / RPM extractor paths used by the CLI. export CGO_ENABLED=1 export GO_LDFLAGS="${GO_LDFLAGS:-} -X %{goipath}/version.ScannerVersion=%{version}" %gobuild -o %{gobuilddir}/bin/scalibr %{goipath}/binary/scalibr %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/scalibr %{buildroot}%{_bindir}/scalibr %check %go_vendor_license_check -c %{S:2} %if %{with check} # Full suite is large and needs network/fixtures unsuitable for default mock. # Enable with --with=check for local development. %gotest ./extractor/filesystem/os/ecosystem/ %endif %files -f %{go_vendor_license_filelist} %license vendor/modules.txt %doc README.md CONTRIBUTING.md docs %{_bindir}/scalibr %changelog %autochangelog