Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 1 | # Copyright (C) 2017 - 2023 Armin Kuster <akuster808@gmail.com> |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 2 | # Released under the MIT license (see COPYING.MIT for the terms) |
| 3 | |
| 4 | SUMARRY = "NIST Certified SCAP 1.2 toolkit" |
| 5 | HOME_URL = "https://www.open-scap.org/tools/openscap-base/" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 7 | LICENSE = "LGPL-2.1-only" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 8 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 9 | DEPENDS = "dbus acl bzip2 pkgconfig gconf procps curl libxml2 libxslt libcap swig libpcre xmlsec1" |
| 10 | DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native libxslt-native libcap-native libpcre-native xmlsec1-native" |
| 11 | |
| 12 | #Jun 22th, 2023 |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 13 | SRCREV = "9b3e7563575f7e5b419f8a09999b40f30e3e7c29" |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 14 | SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \ |
| 15 | file://0001-Replace-distutils.sysconfig-with-sysconfig.patch \ |
| 16 | " |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 17 | |
| 18 | S = "${WORKDIR}/git" |
| 19 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 20 | inherit cmake pkgconfig python3native python3targetconfig perlnative systemd |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 21 | |
| 22 | PACKAGECONFIG ?= "python3 rpm perl gcrypt ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" |
| 23 | PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=ON, ,python3, python3" |
| 24 | PACKAGECONFIG[perl] = "-DENABLE_PERL=ON, ,perl, perl" |
| 25 | PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm" |
| 26 | PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt" |
| 27 | PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss" |
| 28 | PACKAGECONFIG[selinux] = ", ,libselinux" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 29 | PACKAGECONFIG[remdediate_service] = "-DENABLE_OSCAP_REMEDIATE_SERVICE=ON,-DENABLE_OSCAP_REMEDIATE_SERVICE=NO," |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 30 | |
| 31 | EXTRA_OECMAKE += "-DENABLE_PROBES_LINUX=ON -DENABLE_PROBES_UNIX=ON \ |
| 32 | -DENABLE_PROBES_SOLARIS=OFF -DENABLE_PROBES_INDEPENDENT=ON \ |
| 33 | -DENABLE_OSCAP_UTIL=ON -DENABLE_OSCAP_UTIL_SSH=ON \ |
| 34 | -DENABLE_OSCAP_UTIL_DOCKER=OFF -DENABLE_OSCAP_UTIL_CHROOT=OFF \ |
| 35 | -DENABLE_OSCAP_UTIL_PODMAN=OFF -DENABLE_OSCAP_UTIL_VM=OFF \ |
| 36 | -DENABLE_PROBES_WINDOWS=OFF -DENABLE_VALGRIND=OFF \ |
| 37 | -DENABLE_SCE=ON -DENABLE_MITRE=OFF -DENABLE_TESTS=OFF \ |
| 38 | -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_SKIP_RPATH=ON \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 39 | -DPREFERRED_PYTHON_PATH=${bindir}/python3 \ |
| 40 | -DPYTHON3_PATH=${bindir}/python3 \ |
| 41 | " |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 42 | |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 43 | STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source" |
| 44 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 45 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | do_configure:append:class-native () { |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 47 | sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${B}/config.h |
| 48 | sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${B}/config.h |
| 49 | sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${B}/config.h |
| 50 | } |
| 51 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 52 | do_install:append () { |
| 53 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 54 | if ${@bb.utils.contains('PACKAGECONFIG','remdediate_service','true','false',d)}; then |
| 55 | install -D -m 0644 ${B}/oscap-remediate.service ${D}${systemd_system_unitdir}/oscap-remediate.service |
| 56 | fi |
| 57 | fi |
| 58 | } |
| 59 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | do_install:class-native[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}" |
| 61 | do_install:append:class-native () { |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 62 | oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native} |
| 63 | install -d $oscapdir |
| 64 | cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir |
| 65 | } |
| 66 | |
Brad Bishop | 1fdf4aa | 2019-09-09 14:56:41 -0400 | [diff] [blame] | 67 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 68 | SYSTEMD_PACKAGES = "${PN}" |
| 69 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remdediate_service', 'oscap-remediate.service', '',d)}" |
| 70 | SYSTEMD_AUTO_ENABLE = "disable" |
| 71 | |
| 72 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 73 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 74 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 75 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 76 | RDEPENDS:${PN} = "libxml2 python3-core libgcc bash" |
| 77 | RDEPENDS:${PN}-class-target = "libxml2 python3-core libgcc bash os-release" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 78 | BBCLASSEXTEND = "native" |