Skip to content

Commit fd7dcc8

Browse files
committed
Add step to build a "production" fedora build on pull requests
To catch issues with packaging
1 parent 5ff36ae commit fd7dcc8

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

.packit.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ srpm_build_deps:
1111
- bash
1212

1313
jobs:
14+
- job: copr_build
15+
trigger: pull_request
16+
identifier: mock
17+
targets:
18+
- fedora-all-x86_64
19+
actions:
20+
post-upstream-clone:
21+
- bash -c "cp tests/scap-security-guide_fedora.spec.in scap-security-guide.spec"
22+
1423
- &build
1524
job: copr_build
1625
trigger: pull_request
@@ -20,6 +29,7 @@ jobs:
2029
- centos-stream-9-x86_64
2130
- centos-stream-10-x86_64
2231

32+
2333
- <<: *build
2434
trigger: commit
2535
branch: "gh-readonly-queue/.*"
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# SSG build system and tests count with build directory name `build`.
2+
# For more details see:
3+
# https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
4+
%global _vpath_builddir build
5+
6+
Name: scap-security-guide
7+
Version: 0.1.82
8+
Release: 1%{?dist}
9+
Summary: Security guidance and baselines in SCAP formats
10+
License: BSD-3-Clause
11+
URL: https://github.com/ComplianceAsCode/content/
12+
Source0: https://github.com/ComplianceAsCode/content/releases/download/v%{version}/scap-security-guide-%{version}.tar.bz2
13+
BuildArch: noarch
14+
15+
BuildRequires: libxslt
16+
BuildRequires: openscap-scanner >= 1.2.5
17+
BuildRequires: cmake >= 2.8
18+
BuildRequires: python%{python3_pkgversion}
19+
BuildRequires: python%{python3_pkgversion}-jinja2
20+
BuildRequires: python%{python3_pkgversion}-PyYAML
21+
BuildRequires: python%{python3_pkgversion}-setuptools
22+
Requires: xml-common, openscap-scanner >= 1.2.5
23+
24+
%description
25+
The scap-security-guide project provides a guide for configuration of the
26+
system from the final system's security point of view. The guidance is specified
27+
in the Security Content Automation Protocol (SCAP) format and constitutes
28+
a catalog of practical hardening advice, linked to government requirements
29+
where applicable. The project bridges the gap between generalized policy
30+
requirements and specific implementation guidelines. The system
31+
administrator can use the oscap CLI tool from openscap-scanner package, or the
32+
scap-workbench GUI tool from scap-workbench package to verify that the system
33+
conforms to provided guideline. Refer to scap-security-guide(8) manual page for
34+
further information.
35+
36+
%package doc
37+
Summary: HTML formatted security guides generated from XCCDF benchmarks
38+
Requires: %{name} = %{version}-%{release}
39+
40+
%description doc
41+
The %{name}-doc package contains HTML formatted documents containing
42+
hardening guidances that have been generated from XCCDF benchmarks
43+
present in %{name} package.
44+
45+
%if ( %{defined rhel} && (! %{defined centos}) && (! %{defined eln}) )
46+
%package rule-playbooks
47+
Summary: Ansible playbooks per each rule.
48+
Group: System Environment/Base
49+
Requires: %{name} = %{version}-%{release}
50+
51+
%description rule-playbooks
52+
The %{name}-rule-playbooks package contains individual ansible playbooks per rule.
53+
%endif
54+
55+
%prep
56+
%autosetup -p1
57+
58+
%define cmake_defines_common -DSSG_SEPARATE_SCAP_FILES_ENABLED=OFF -DSSG_BASH_SCRIPTS_ENABLED=OFF -DSSG_BUILD_SCAP_12_DS=OFF
59+
%define cmake_defines_specific %{nil}
60+
%if 0%{?rhel} && ! %{defined eln}
61+
%define cmake_defines_specific -DSSG_PRODUCT_DEFAULT:BOOLEAN=FALSE -DSSG_PRODUCT_RHEL%{rhel}:BOOLEAN=TRUE -DSSG_SCIENTIFIC_LINUX_DERIVATIVES_ENABLED:BOOL=OFF -DSSG_CENTOS_DERIVATIVES_ENABLED:BOOL=OFF -DSSG_ANSIBLE_PLAYBOOKS_PER_RULE_ENABLED:BOOL=ON
62+
%endif
63+
%if 0%{?centos}
64+
%define cmake_defines_specific -DSSG_PRODUCT_DEFAULT:BOOLEAN=FALSE -DSSG_PRODUCT_RHEL%{centos}:BOOLEAN=TRUE -DSSG_SCIENTIFIC_LINUX_DERIVATIVES_ENABLED:BOOL=OFF -DSSG_CENTOS_DERIVATIVES_ENABLED:BOOL=ON
65+
%endif
66+
67+
mkdir -p build
68+
%build
69+
%cmake %{cmake_defines_common} %{cmake_defines_specific}
70+
%cmake_build
71+
72+
%install
73+
%cmake_install
74+
rm %{buildroot}/%{_docdir}/%{name}/README.md
75+
rm %{buildroot}/%{_docdir}/%{name}/Contributors.md
76+
77+
%files
78+
%{_datadir}/xml/scap/ssg/content
79+
%{_datadir}/%{name}/kickstart
80+
%{_datadir}/%{name}/ansible/*.yml
81+
%{_datadir}/%{name}/tailoring
82+
%lang(en) %{_mandir}/man8/scap-security-guide.8.*
83+
%doc %{_docdir}/%{name}/LICENSE
84+
%if ( %{defined rhel} && (! %{defined centos}) && (! %{defined eln}) )
85+
%exclude %{_datadir}/%{name}/ansible/rule_playbooks
86+
%endif
87+
88+
%files doc
89+
%doc %{_docdir}/%{name}/guides/*.html
90+
%doc %{_docdir}/%{name}/tables/*.html
91+
92+
%if ( %{defined rhel} && (! %{defined centos}) && (! %{defined eln}) )
93+
%files rule-playbooks
94+
%defattr(-,root,root,-)
95+
%{_datadir}/%{name}/ansible/rule_playbooks
96+
%endif

0 commit comments

Comments
 (0)