openscap: fix PACKAGECONFIG[remediate_service]

* Fix typo: remdediate_service -> remediate_service
* No need to manually install oscap-remediate.service, as it is already
  installed when ENABLE_OSCAP_REMEDIATE_SERVICE=ON is set.
* Add a patch to fix installation directory for systemd service file.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Yi Zhao
2024-06-26 20:59:06 +08:00
committed by Armin Kuster
parent 5f5e00ec4e
commit 61f2428158
2 changed files with 34 additions and 11 deletions

View File

@@ -0,0 +1,29 @@
From 887bd1b60720f02e937c57568d7ef4d3df4b00e8 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Mon, 24 Jun 2024 11:27:30 +0800
Subject: [PATCH] CMakeLists.txt: fix installation directory for systemd unit
file
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fdeda6eb4..77645ecd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -637,7 +637,7 @@ if(NOT WIN32)
configure_file("oscap-remediate.service.in" "oscap-remediate.service" @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/oscap-remediate.service
- DESTINATION ${CMAKE_INSTALL_PREFIX}/${SYSTEMD_UNITDIR}
+ DESTINATION ${SYSTEMD_UNITDIR}
)
endif()
endif()
--
2.25.1

View File

@@ -11,7 +11,9 @@ DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native
#March 18th, 2024
SRCREV = "6d008616978306ce5e68997dce554a1683064f8f"
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-fix-installation-directory-for-system.patch \
"
S = "${WORKDIR}/git"
@@ -24,7 +26,7 @@ PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm"
PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt"
PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss"
PACKAGECONFIG[selinux] = ", ,libselinux"
PACKAGECONFIG[remdediate_service] = "-DENABLE_OSCAP_REMEDIATE_SERVICE=ON,-DENABLE_OSCAP_REMEDIATE_SERVICE=NO,"
PACKAGECONFIG[remediate_service] = "-DENABLE_OSCAP_REMEDIATE_SERVICE=ON,-DENABLE_OSCAP_REMEDIATE_SERVICE=OFF,"
EXTRA_OECMAKE += "-DENABLE_PROBES_LINUX=ON -DENABLE_PROBES_UNIX=ON \
-DENABLE_PROBES_SOLARIS=OFF -DENABLE_PROBES_INDEPENDENT=ON \
@@ -47,14 +49,6 @@ do_configure:append:class-native () {
sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${B}/config.h
}
do_install:append () {
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
if ${@bb.utils.contains('PACKAGECONFIG','remdediate_service','true','false',d)}; then
install -D -m 0644 ${B}/oscap-remediate.service ${D}${systemd_system_unitdir}/oscap-remediate.service
fi
fi
}
do_install:class-native[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}"
do_install:append:class-native () {
oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native}
@@ -64,7 +58,7 @@ do_install:append:class-native () {
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remdediate_service', 'oscap-remediate.service', '',d)}"
SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remediate_service', 'oscap-remediate.service', '',d)}"
SYSTEMD_AUTO_ENABLE = "disable"