summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2023-06-29 15:25:29 +0800
committerArmin Kuster <akuster808@gmail.com>2023-07-31 06:18:52 -0400
commitef184ce03a0f442ccb9e069994eb3bc353275a78 (patch)
treef253ee5f1da0e255a464f4772637e61911654d37
parentbe8b6b20d69e8cc46c33ad0e5f9dd9bae53eb6bf (diff)
downloadmeta-security-ef184ce03a0f442ccb9e069994eb3bc353275a78.tar.gz
openscap: fix buildpaths issue
Variables PREFERRED_PYTHON_PATH and PYTHON3_PATH are set with ${PYTHON_EXECUTABLE}. For cross compile, ${PYTHON_EXECUTABLE} may point to other path rather than standard dir such as /usr/bin. Then the generated library file contains such path which should NOT. Update to make variables PREFERRED_PYTHON_PATH and PYTHON3_PATH configurable to fix buildpaths issue: | WARNING: openscap-1.3.7-r0 do_package_qa: QA Issue: File | /usr/lib/libopenscap.so.25.5.1 in package openscap contains reference | to TMPDIR [buildpaths] Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-compliance/openscap/files/0003-CMakeLists.txt-make-2-variables-configurable.patch37
-rw-r--r--recipes-compliance/openscap/openscap_1.3.8.bb5
2 files changed, 41 insertions, 1 deletions
diff --git a/recipes-compliance/openscap/files/0003-CMakeLists.txt-make-2-variables-configurable.patch b/recipes-compliance/openscap/files/0003-CMakeLists.txt-make-2-variables-configurable.patch
new file mode 100644
index 0000000..953b0d9
--- /dev/null
+++ b/recipes-compliance/openscap/files/0003-CMakeLists.txt-make-2-variables-configurable.patch
@@ -0,0 +1,37 @@
1From f99c3f1f516a84d33794f8e3da59adea1a12ef54 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Tue, 20 Jun 2023 22:42:51 +0800
4Subject: [PATCH] CMakeLists.txt: make 2 variables configurable
5
6Variables PREFERRED_PYTHON_PATH and PYTHON3_PATH are set with
7${PYTHON_EXECUTABLE}. For cross compile, ${PYTHON_EXECUTABLE} may point
8to other path rather than standard dir such as /usr/bin. Then the
9generated library file contains such path which should NOT. Update to
10make variables PREFERRED_PYTHON_PATH and PYTHON3_PATH configurable to
11avoid such issue.
12
13Upstream-Status: Submitted [https://github.com/OpenSCAP/openscap/pull/1990]
14
15Signed-off-by: Kai Kang <kai.kang@windriver.com>
16---
17 CMakeLists.txt | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/CMakeLists.txt b/CMakeLists.txt
21index 5db014e77..74628cdd4 100644
22--- a/CMakeLists.txt
23+++ b/CMakeLists.txt
24@@ -125,8 +125,8 @@ endif()
25 find_package(PythonInterp 3)
26 find_package(PythonLibs 3)
27
28-set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}")
29-set(PYTHON3_PATH "${PYTHON_EXECUTABLE}")
30+set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to preferred Python")
31+set(PYTHON3_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to Python3")
32
33 find_package(RPM)
34 if(RPM_FOUND)
35--
362.34.1
37
diff --git a/recipes-compliance/openscap/openscap_1.3.8.bb b/recipes-compliance/openscap/openscap_1.3.8.bb
index ecc347c..5abd5a6 100644
--- a/recipes-compliance/openscap/openscap_1.3.8.bb
+++ b/recipes-compliance/openscap/openscap_1.3.8.bb
@@ -12,6 +12,7 @@ DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native
12#Jun 22th, 2023 12#Jun 22th, 2023
13SRCREV = "a81c66d9bc36612dd1ca83a8c959a59e172eb4b9" 13SRCREV = "a81c66d9bc36612dd1ca83a8c959a59e172eb4b9"
14SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \ 14SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \
15 file://0003-CMakeLists.txt-make-2-variables-configurable.patch \
15 " 16 "
16 17
17S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
@@ -35,7 +36,9 @@ EXTRA_OECMAKE += "-DENABLE_PROBES_LINUX=ON -DENABLE_PROBES_UNIX=ON \
35 -DENABLE_PROBES_WINDOWS=OFF -DENABLE_VALGRIND=OFF \ 36 -DENABLE_PROBES_WINDOWS=OFF -DENABLE_VALGRIND=OFF \
36 -DENABLE_SCE=ON -DENABLE_MITRE=OFF -DENABLE_TESTS=OFF \ 37 -DENABLE_SCE=ON -DENABLE_MITRE=OFF -DENABLE_TESTS=OFF \
37 -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_SKIP_RPATH=ON \ 38 -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_SKIP_RPATH=ON \
38 " 39 -DPREFERRED_PYTHON_PATH=${bindir}/python3 \
40 -DPYTHON3_PATH=${bindir}/python3 \
41 "
39 42
40STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source" 43STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source"
41STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" 44STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"