Skip to content

Commit

Permalink
Merge pull request #12488 from jan-cerny/sce_default
Browse files Browse the repository at this point in the history
Build SCE content by default in rhel9 and rhel10 products
  • Loading branch information
Mab879 authored Oct 23, 2024
2 parents 84b8191 + 7c812c3 commit b18b216
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: pip3 install -r requirements.txt -r test-requirements.txt
- name: Build
env:
ADDITIONAL_CMAKE_OPTIONS: "-DSSG_SCE_ENABLED:BOOL=ON -DSSG_OVAL_SCHEMATRON_VALIDATION_ENABLED=OFF"
ADDITIONAL_CMAKE_OPTIONS: "-DSSG_OVAL_SCHEMATRON_VALIDATION_ENABLED=OFF"
run: |-
./build_product ubuntu1604 ubuntu1804 ubuntu2004
- name: Test
Expand All @@ -114,7 +114,7 @@ jobs:
run: pip3 install -r requirements.txt -r test-requirements.txt
- name: Build
env:
ADDITIONAL_CMAKE_OPTIONS: "-DSSG_SCE_ENABLED:BOOL=ON -DSSG_OVAL_SCHEMATRON_VALIDATION_ENABLED=OFF"
ADDITIONAL_CMAKE_OPTIONS: "-DSSG_OVAL_SCHEMATRON_VALIDATION_ENABLED=OFF"
run: |-
./build_product ubuntu2204
- name: Test
Expand Down
9 changes: 9 additions & 0 deletions build_product
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@ set_no_derivatives_options() {
fi
}

set_sce_options() {
grep -q "SSG_SCE_ENABLED" <<< "$ADDITIONAL_CMAKE_OPTIONS" && return
# These products will build SCE by default
if grep -q -E 'rhel9|rhel10|ubuntu2004|ubuntu2204' <<< "${_arg_product[*]}"; then
CMAKE_OPTIONS+=("-DSSG_SCE_ENABLED:BOOL=ON")
fi
}

set_explict_build_targets() {
if test "$_arg_datastream_only" = on || test "$_arg_thin_datastream" = on || test "$_arg_rule_id" != off ; then
for chosen_product in "${_arg_product[@]}"; do
Expand Down Expand Up @@ -429,6 +437,7 @@ done

CMAKE_OPTIONS=(${ADDITIONAL_CMAKE_OPTIONS} "${build_type_option}" "${oval_major_version_option}" "${oval_minor_version_option}" '-DSSG_PRODUCT_DEFAULT=OFF' "${cmake_enable_args[@]}" -G "$cmake_generator")
set_no_derivatives_options
set_sce_options
if [ "$_arg_ansible_playbooks" = off ] ; then
CMAKE_OPTIONS+=("-DSSG_ANSIBLE_PLAYBOOKS_ENABLED:BOOL=OFF")
fi
Expand Down
4 changes: 4 additions & 0 deletions scap-security-guide.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ present in %{name} package.
%define centos_8_specific %{nil}

%if 0%{?_rhel_like}
%if 0%{?_rhel_like} == 7 || 0%{?_rhel_like} == 8
%define cmake_defines_specific -DSSG_PRODUCT_DEFAULT:BOOLEAN=FALSE -DSSG_PRODUCT_RHEL%{_rhel_like}:BOOLEAN=TRUE -DSSG_CENTOS_DERIVATIVES_ENABLED:BOOL=ON
%else
%define cmake_defines_specific -DSSG_PRODUCT_DEFAULT:BOOLEAN=FALSE -DSSG_PRODUCT_RHEL%{_rhel_like}:BOOLEAN=TRUE -DSSG_CENTOS_DERIVATIVES_ENABLED:BOOL=ON -DSSG_SCE_ENABLED:BOOL=ON
%endif
%endif
%if 0%{?fedora}
%define cmake_defines_specific -DSSG_PRODUCT_DEFAULT:BOOLEAN=FALSE -DSSG_PRODUCT_FEDORA:BOOLEAN=TRUE
Expand Down

0 comments on commit b18b216

Please sign in to comment.