-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcomplyctl.spec
More file actions
114 lines (87 loc) · 3.74 KB
/
complyctl.spec
File metadata and controls
114 lines (87 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# SPDX-License-Identifier: Apache-2.0
%global goipath github.com/complytime/complyctl
%global base_url https://%{goipath}
%global app_dir complytime
%global gopath %{_builddir}/go
%global debug_package %{nil}
Name: complyctl
Version: 0.0.8
Release: 0%{?dist}
Summary: Gemara-native compliance scanning CLI with pluggable providers
License: Apache-2.0
URL: %{base_url}
Source0: %{base_url}/archive/refs/tags/v%{version}.tar.gz
BuildRequires: golang
BuildRequires: go-rpm-macros
%gometa -f
%description
%{name} fetches Gemara policies from OCI registries, resolves dependency
graphs, dispatches scans to providers via gRPC, and produces compliance
reports (EvaluationLog, OSCAL, Markdown, SARIF).
%package openscap-provider
Summary: OpenSCAP scanning provider for complyctl
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: scap-security-guide
%description openscap-provider
openscap-provider is a scanning provider that extends complyctl with OpenSCAP
evaluation capabilities. It communicates via gRPC (Generate, Scan, HealthCheck
RPCs) and follows the complyctl-provider-* discovery convention.
%prep
%goprep -k
%build
BUILD_DATE_GO=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
# Set up environment variables and flags to build properly and securely
%set_build_flags
# Align GIT_COMMIT and GIT_TAG with version for simplicity
GO_LD_EXTRAFLAGS="-X %{goipath}/internal/version.version=%{version} \
-X %{goipath}/internal/version.gitTreeState=clean \
-X %{goipath}/internal/version.commit=%{version} \
-X %{goipath}/internal/version.buildDate=${BUILD_DATE_GO}"
# Adapt go env to RPM build environment
export GO111MODULE=on
# Define and create the output directory for binaries
GO_BUILD_BINDIR=./bin
mkdir -p ${GO_BUILD_BINDIR}
# Not calling the macro for more control on go env variables
go build -buildmode=pie -o ${GO_BUILD_BINDIR}/ -ldflags="${GO_LD_EXTRAFLAGS}" ./cmd/...
# Build openscap provider (separate Go module)
cd cmd/openscap-plugin
go build -buildmode=pie -o ../../${GO_BUILD_BINDIR}/complyctl-provider-openscap -ldflags="${GO_LD_EXTRAFLAGS}" .
cd ../..
%install
install -d %{buildroot}%{_bindir}
install -d -m 0755 %{buildroot}%{_libexecdir}/%{app_dir}/providers
install -p -m 0755 bin/complyctl %{buildroot}%{_bindir}/complyctl
install -p -m 0755 bin/complyctl-provider-openscap %{buildroot}%{_libexecdir}/%{app_dir}/providers/complyctl-provider-openscap
%check
# Run unit tests
go test -mod=vendor -race -v ./...
cd cmd/openscap-plugin && go test -mod=vendor -race -v ./...
cd ../..
%files
%attr(0755, root, root) %{_bindir}/complyctl
%license LICENSE
%dir %{_libexecdir}/%{app_dir}
%dir %{_libexecdir}/%{app_dir}/providers
%files openscap-provider
%attr(0755, root, root) %{_libexecdir}/%{app_dir}/providers/complyctl-provider-openscap
%license LICENSE
%changelog
* Wed Jul 9 2025 Marcus Burghardt <maburgha@redhat.com> - 0.0.8-1
- Bump to upstream version v0.0.8
* Tue Jul 8 2025 Marcus Burghardt <maburgha@redhat.com> - 0.0.7-1
- Bump to upstream version v0.0.7
- Include manifest file for openscap-plugin
* Mon Jun 16 2025 George Vauter <gvauter@redhat.com> - 0.0.6-2
- Update package name to complyctl
* Wed Jun 11 2025 Marcus Burghardt <maburgha@redhat.com> - 0.0.6-1
- Bump to upstream version v0.0.6
- Align with Fedora Package Guidelines
* Tue May 6 2025 Qingmin Duanmu <qduanmu@redhat.com> - 0.0.3-2
- Add complytime and openscap plugin man pages
* Wed Apr 30 2025 Qingmin Duanmu <qduanmu@redhat.com> - 0.0.3-1
- Separate plugin binary from manifest
* Fri Apr 11 2025 Qingmin Duanmu <qduanmu@redhat.com> - 0.0.2-1
- Separate package for openscap-plugin
* Tue Apr 08 2025 Marcus Burghardt <maburgha@redhat.com> - 0.0.2-1
- Initial RPM