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 | |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 12 | #March 18th, 2024 |
| 13 | SRCREV = "0e7f654570971c1acee6dd3f34b17121372d6152" |
| 14 | SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https " |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 15 | |
| 16 | S = "${WORKDIR}/git" |
| 17 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 18 | inherit cmake pkgconfig python3native python3targetconfig perlnative systemd |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 19 | |
| 20 | PACKAGECONFIG ?= "python3 rpm perl gcrypt ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" |
| 21 | PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=ON, ,python3, python3" |
| 22 | PACKAGECONFIG[perl] = "-DENABLE_PERL=ON, ,perl, perl" |
| 23 | PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm" |
| 24 | PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt" |
| 25 | PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss" |
| 26 | PACKAGECONFIG[selinux] = ", ,libselinux" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 27 | 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] | 28 | |
| 29 | EXTRA_OECMAKE += "-DENABLE_PROBES_LINUX=ON -DENABLE_PROBES_UNIX=ON \ |
| 30 | -DENABLE_PROBES_SOLARIS=OFF -DENABLE_PROBES_INDEPENDENT=ON \ |
| 31 | -DENABLE_OSCAP_UTIL=ON -DENABLE_OSCAP_UTIL_SSH=ON \ |
| 32 | -DENABLE_OSCAP_UTIL_DOCKER=OFF -DENABLE_OSCAP_UTIL_CHROOT=OFF \ |
| 33 | -DENABLE_OSCAP_UTIL_PODMAN=OFF -DENABLE_OSCAP_UTIL_VM=OFF \ |
| 34 | -DENABLE_PROBES_WINDOWS=OFF -DENABLE_VALGRIND=OFF \ |
| 35 | -DENABLE_SCE=ON -DENABLE_MITRE=OFF -DENABLE_TESTS=OFF \ |
| 36 | -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_SKIP_RPATH=ON \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 37 | -DPREFERRED_PYTHON_PATH=${bindir}/python3 \ |
| 38 | -DPYTHON3_PATH=${bindir}/python3 \ |
| 39 | " |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 40 | |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 41 | STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source" |
| 42 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 43 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | do_configure:append:class-native () { |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 45 | sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${B}/config.h |
| 46 | sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${B}/config.h |
| 47 | sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${B}/config.h |
| 48 | } |
| 49 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 50 | do_install:append () { |
| 51 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 52 | if ${@bb.utils.contains('PACKAGECONFIG','remdediate_service','true','false',d)}; then |
| 53 | install -D -m 0644 ${B}/oscap-remediate.service ${D}${systemd_system_unitdir}/oscap-remediate.service |
| 54 | fi |
| 55 | fi |
| 56 | } |
| 57 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 58 | do_install:class-native[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}" |
| 59 | do_install:append:class-native () { |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 60 | oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native} |
| 61 | install -d $oscapdir |
| 62 | cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir |
| 63 | } |
| 64 | |
Brad Bishop | 1fdf4aa | 2019-09-09 14:56:41 -0400 | [diff] [blame] | 65 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 66 | SYSTEMD_PACKAGES = "${PN}" |
| 67 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remdediate_service', 'oscap-remediate.service', '',d)}" |
| 68 | SYSTEMD_AUTO_ENABLE = "disable" |
| 69 | |
| 70 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 71 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 72 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 73 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 74 | RDEPENDS:${PN} = "libxml2 python3-core libgcc bash" |
| 75 | RDEPENDS:${PN}-class-target = "libxml2 python3-core libgcc bash os-release" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 76 | BBCLASSEXTEND = "native" |