|
1 | | -%global debug_package %{nil} |
| 1 | +# Generated by go2rpm 1.19.0 |
| 2 | +%bcond check 1 |
| 3 | + |
| 4 | +# https://github.com/ComplianceAsCode/cvetool |
| 5 | +%global goipath github.com/ComplianceAsCode/cvetool |
| 6 | +Version: 0.1.1 |
| 7 | + |
| 8 | +%gometa -L -f |
| 9 | + |
2 | 10 |
|
3 | 11 | Name: cvetool |
4 | | -Version: 0.0.1 |
5 | | -Release: 1%{?dist} |
| 12 | +Release: %autorelease |
6 | 13 | Summary: A Claircore-based CVE manager |
7 | 14 |
|
8 | | -License: Apache-2.0 |
9 | | -URL: https://github.com/ComplianceAsCode/cvetool |
10 | | -Source0: https://github.com/ComplianceAsCode/cvetool/archive/v%{version}/%{name}-%{version}.tar.gz |
| 15 | +# Generated by go-vendor-tools |
| 16 | +License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain AND LicenseRef-scancode-other-permissive AND MIT AND MIT WITH LicenseRef-scancode-musl-exception AND MPL-2.0 AND (LicenseRef-Fedora-Public-Domain OR LicenseRef-scancode-other-permissive) |
| 17 | +URL: %{gourl} |
| 18 | +Source0: %{gosource} |
| 19 | +# Generated by go-vendor-tools |
| 20 | +Source1: %{archivename}-vendor.tar.bz2 |
| 21 | +Source2: go-vendor-tools.toml |
11 | 22 |
|
12 | | -BuildRequires: golang |
13 | | -BuildRequires: git |
14 | | -Requires: glibc |
| 23 | +BuildRequires: go-vendor-tools |
15 | 24 |
|
16 | 25 | %description |
17 | | -%{summary} |
| 26 | +A Claircore-based CVE manager |
18 | 27 |
|
19 | 28 | %prep |
20 | | -%setup -q |
| 29 | +%goprep -p1 |
| 30 | +tar -xf %{S:1} |
21 | 31 |
|
22 | | -%build |
23 | | -export CGO_CPPFLAGS="${CPPFLAGS}" |
24 | | -export CGO_CFLAGS="${CFLAGS}" |
25 | | -export CGO_CXXFLAGS="${CXXFLAGS}" |
26 | | -export CGO_LDFLAGS="${LDFLAGS}" |
27 | | -export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" |
| 32 | +%generate_buildrequires |
| 33 | +%go_vendor_license_buildrequires -c %{S:2} |
28 | 34 |
|
29 | | -go mod tidy |
30 | | -go build -ldflags="-linkmode=external -X main.Version=%{version}-%{release}" ./cmd/cvetool |
| 35 | +%build |
| 36 | +%global gomodulesmode GO111MODULE=on |
| 37 | +export GO_LDFLAGS='-X main.Version=%{version}' |
| 38 | +for cmd in cmd/* ; do |
| 39 | + %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd |
| 40 | +done |
31 | 41 |
|
32 | 42 | %install |
33 | | -install -Dm0755 %{name} %{buildroot}%{_bindir}/%{name} |
| 43 | +%go_vendor_license_install -c %{S:2} |
| 44 | +install -m 0755 -vd %{buildroot}%{_bindir} |
| 45 | +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ |
| 46 | + |
| 47 | +%check |
| 48 | +%go_vendor_license_check -c %{S:2} |
| 49 | +%if %{with check} |
| 50 | +%gotest ./... |
| 51 | +%endif |
34 | 52 |
|
35 | | -%files |
36 | | -%{_bindir}/%{name} |
37 | | -%license LICENSE |
| 53 | +%files -f %{go_vendor_license_filelist} |
38 | 54 | %doc README.md |
| 55 | +%{_bindir}/cvetool |
| 56 | + |
| 57 | + |
| 58 | +%changelog |
| 59 | +%autochangelog |
0 commit comments