From 33140c3a0a3c6dd4439fa49d2c1d0884e88ce85a Mon Sep 17 00:00:00 2001 From: Evgeny Kolesnikov Date: Mon, 4 Sep 2023 14:02:04 +0200 Subject: [PATCH] Use PCRE2 library in CI Make use of the PCRE2 library (in Fedora CI + PackIt and Ubuntu IC). --- .github/workflows/build.yml | 12 ++++++------ openscap.spec | 7 +++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f553e85ba..4f9a9c4d9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,14 +34,14 @@ jobs: - name: Install Deps run: | sudo apt-get update - sudo apt-get -y install lcov swig xsltproc rpm-common lua5.3 libyaml-dev libapt-pkg-dev libdbus-1-dev libdbus-glib-1-dev libcurl4-openssl-dev libgcrypt-dev libselinux1-dev libgconf2-dev libacl1-dev libblkid-dev libcap-dev libxml2-dev libxslt1-dev libxml-parser-perl libxml-xpath-perl libperl-dev librpm-dev librtmp-dev libxmlsec1-dev libxmlsec1-openssl python3-dbusmock + sudo apt-get -y install lcov swig xsltproc rpm-common lua5.3 libpcre2-dev libyaml-dev libapt-pkg-dev libdbus-1-dev libdbus-glib-1-dev libcurl4-openssl-dev libgcrypt-dev libselinux1-dev libgconf2-dev libacl1-dev libblkid-dev libcap-dev libxml2-dev libxslt1-dev libxml-parser-perl libxml-xpath-perl libperl-dev librpm-dev librtmp-dev libxmlsec1-dev libxmlsec1-openssl python3-dbusmock sudo apt-get -y remove rpm # Runs a set of commands using the runners shell - name: Build working-directory: ./build run: | - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_PCRE2=True ../ make all - name: Test @@ -57,7 +57,7 @@ jobs: image: fedora:latest steps: - name: Install Deps - run: dnf install -y cmake git dbus-devel GConf2-devel libacl-devel libblkid-devel libcap-devel libcurl-devel libgcrypt-devel libselinux-devel libxml2-devel libxslt-devel libattr-devel make openldap-devel pcre-devel perl-XML-Parser perl-XML-XPath perl-devel python3-devel python3-dbusmock rpm-devel swig bzip2-devel gcc-c++ libyaml-devel xmlsec1-devel xmlsec1-openssl-devel hostname bzip2 lua rpm-build which strace apt-devel + run: dnf install -y cmake git dbus-devel GConf2-devel libacl-devel libblkid-devel libcap-devel libcurl-devel libgcrypt-devel libselinux-devel libxml2-devel libxslt-devel libattr-devel make openldap-devel pcre2-devel perl-XML-Parser perl-XML-XPath perl-devel python3-devel python3-dbusmock rpm-devel swig bzip2-devel gcc-c++ libyaml-devel xmlsec1-devel xmlsec1-openssl-devel hostname bzip2 lua rpm-build which strace apt-devel - name: Checkout uses: actions/checkout@v3 with: @@ -65,7 +65,7 @@ jobs: - name: Build working-directory: ./build run: | - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_PCRE2=True ../ make all - name: Test working-directory: ./build @@ -97,13 +97,13 @@ jobs: brew install swig brew install libxmlsec1 brew install openssl - brew install pcre + brew install pcre2 # Runs a set of commands using the runners shell - name: Build run: | cd $GITHUB_WORKSPACE/build - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_PROBES=false ../ + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_PCRE2=True -DENABLE_PROBES=False ../ make all - name: Test diff --git a/openscap.spec b/openscap.spec index 47bb3bd915..bb69c11a1c 100644 --- a/openscap.spec +++ b/openscap.spec @@ -18,7 +18,11 @@ BuildRequires: apt-devel %endif BuildRequires: rpm-devel BuildRequires: libgcrypt-devel +%if 0%{?fedora} +BuildRequires: pcre2-devel +%else BuildRequires: pcre-devel +%endif BuildRequires: libacl-devel BuildRequires: libselinux-devel BuildRequires: libcap-devel @@ -136,6 +140,9 @@ Tool for scanning Atomic containers. # gconf is a legacy system not used any more, and it blocks testing of oscap-anaconda-addon # as gconf is no longer part of the installation medium %cmake \ +%if 0%{?fedora} + -DWITH_PCRE2=ON \ +%endif -DENABLE_PERL=OFF \ -DENABLE_DOCS=ON \ -DOPENSCAP_PROBE_UNIX_GCONF=OFF \