openscap: fix buildpaths issue
PATCH 1/1 openscap: fix buildpaths issue
From: Kai Kang <[email protected]>
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]
--- ...ts.txt-make-2-variables-configurable.patch | 37 +++++++++++++++++++ .../openscap/openscap_1.3.7.bb | 8 +++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch
meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch new file +37 -0
@@ -0,0 +1,37 @@ +From f99c3f1f516a84d33794f8e3da59adea1a12ef54 Mon Sep 17 00:00:00 2001 +From: Kai Kang <[email protected]> +Date: Tue, 20 Jun 2023 22:42:51 +0800 +Subject: [PATCH] CMakeLists.txt: make 2 variables configurable + +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 +avoid such issue. + +Upstream-Status: Submitted [https://github.com/OpenSCAP/openscap/pull/1990] + +Signed-off-by: Kai Kang <[email protected]> +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5db014e77..74628cdd4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,8 @@ endif() + find_package(PythonInterp 3) + find_package(PythonLibs 3) + +-set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}") +-set(PYTHON3_PATH "${PYTHON_EXECUTABLE}") ++set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to preferred Python") ++set(PYTHON3_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to Python3") + + find_package(RPM) + if(RPM_FOUND) +-- +2.34.1 +
meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb +7 -1
@@ -7,7 +7,13 @@ require openscap.inc inherit systemd SRCREV = "55efbfda0f617e05862ab6ed4862e10dbee52b03" -SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https" +SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \ + file://0001-CMakeLists.txt-make-2-variables-configurable.patch \ + " + +EXTRA_OECMAKE += "-DPREFERRED_PYTHON_PATH=${bindir}/python3 \ + -DPYTHON3_PATH=${bindir}/python3 \ + " SYSTEMD_PACKAGES = "${PN}" SYSTEMD_SERVICE:${PN} = "oscap-remediate.service"
Signature · 1 line
2.34.1
Hello Kai,
Can you rebase this to the latest master. There was a layer reorg landed during the posting of this patch.
BR,
Armin
Quoted 91 lines · Kai Kang
From: Kai Kang <[email protected]>
Variables
PREFERRED_PYTHON_PATHandPYTHON3_PATHare 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 variablesPREFERRED_PYTHON_PATHandPYTHON3_PATHconfigurable 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 <[email protected]>--- ...ts.txt-make-2-variables-configurable.patch | 37 +++++++++++++++++++ .../openscap/openscap_1.3.7.bb | 8 +++- 2 files changed, 44 insertions(+), 1 deletion(-)create mode 100644
meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patchmeta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch new file +37
-0@@ -0,0 +1,37 @@ +From f99c3f1f516a84d33794f8e3da59adea1a12ef54 Mon Sep 17 00:00:00 2001 +From: Kai Kang <[email protected]> +Date: Tue, 20 Jun 2023 22:42:51 +0800 +Subject: [PATCH] CMakeLists.txt: make 2 variables configurable + +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 +avoid such issue. + +Upstream-Status: Submitted [https://github.com/OpenSCAP/openscap/pull/1990] + +Signed-off-by: Kai Kang <[email protected]> +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5db014e77..74628cdd4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,8 @@ endif() + find_package(PythonInterp 3) + find_package(PythonLibs 3) + +-set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}") +-set(PYTHON3_PATH "${PYTHON_EXECUTABLE}") ++set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to preferred Python") ++set(PYTHON3_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to Python3") + + find_package(RPM) + if(RPM_FOUND) +-- +2.34.1 +meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb +7
-2@@ -7,7 +7,13 @@ require openscap.inc inherit systemd SRCREV = "55efbfda0f617e05862ab6ed4862e10dbee52b03" -SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https" +SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \ + file://0001-CMakeLists.txt-make-2-variables-configurable.patch \ + " + +EXTRA_OECMAKE += "-DPREFERRED_PYTHON_PATH=${bindir}/python3 \ + -DPYTHON3_PATH=${bindir}/python3 \ + " SYSTEMD_PACKAGES = "${PN}" SYSTEMD_SERVICE:${PN} = "oscap-remediate.service" -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#60368): https://lists.yoctoproject.org/g/yocto/message/60368
Mute This Topic: https://lists.yoctoproject.org/mt/99670413/3616698
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 3 lines · On 6/22/23 07:04, akuster808 wrote:
Hello Kai,
Can you rebase this to the latest master. There was a layer reorg landed during the posting of this patch.
OK. v2 will be sent.
Kai
Quoted 103 lines
BR,
ArminQuoted 97 lines · Kai Kang
From: Kai Kang <[email protected]>
Variables
PREFERRED_PYTHON_PATHandPYTHON3_PATHare 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 variablesPREFERRED_PYTHON_PATHandPYTHON3_PATHconfigurable 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 <[email protected]>---
...ts.txt-make-2-variables-configurable.patch | 37 +++++++++++++++++++ .../openscap/openscap_1.3.7.bb | 8 +++-2 files changed, 44 insertions(+), 1 deletion(-)create mode 100644
meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patchmeta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch +0
-0new file mode 100644
index 0000000..953b0d9
---/dev/null
+++b/meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patchmeta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch +13
-0@@ -0,0 +1,37 @@ +From f99c3f1f516a84d33794f8e3da59adea1a12ef54 Mon Sep 17 00:00:00 2001 +From: Kai Kang <[email protected]> +Date: Tue, 20 Jun 2023 22:42:51 +0800 +Subject: [PATCH] CMakeLists.txt: make 2 variables configurable + +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 +avoid such issue. + +Upstream-Status: Submitted[https://github.com/OpenSCAP/openscap/pull/1990]
meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch +17
-0+ +Signed-off-by: Kai Kang <[email protected]> +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5db014e77..74628cdd4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,8 @@ endif() + find_package(PythonInterp 3) + find_package(PythonLibs 3) + +-set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}") +-set(PYTHON3_PATH "${PYTHON_EXECUTABLE}") ++set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Pathto preferred Python")
++set(PYTHON3_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to Python3")meta-security-compliance/recipes-openscap/openscap/files/0001-CMakeLists.txt-make-2-variables-configurable.patch +6
-0+ + find_package(RPM) + if(RPM_FOUND) +-- +2.34.1 +meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb +0
-1---a/meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb
+++
b/meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bbmeta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb +0
-0@@ -7,7 +7,13 @@ require openscap.incinherit systemd
SRCREV = "55efbfda0f617e05862ab6ed4862e10dbee52b03" -SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https" +SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https\
+ file://0001-CMakeLists.txt-make-2-variables-configurable.patch \
+ "meta-security-compliance/recipes-openscap/openscap/openscap_1.3.7.bb +4
-0+ +EXTRA_OECMAKE += "-DPREFERRED_PYTHON_PATH=${bindir}/python3 \ + -DPYTHON3_PATH=${bindir}/python3 \ + "
SYSTEMD_PACKAGES= "${PN}" SYSTEMD_SERVICE:${PN} = "oscap-remediate.service"-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#60368): https://lists.yoctoproject.org/g/yocto/message/60368
Mute This Topic: https://lists.yoctoproject.org/mt/99670413/3616698
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
Kai Kang Wind River Linux