blob: d956ff1e041ee0d7d9b0560983f4aa7b0d5ed942 [file] [log] [blame]
Patrick Williams520786c2023-06-25 16:20:36 -05001# Copyright (C) 2017 - 2023 Armin Kuster <akuster808@gmail.com>
Brad Bishop26bdd442019-08-16 17:08:17 -04002# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMARRY = "NIST Certified SCAP 1.2 toolkit"
5HOME_URL = "https://www.open-scap.org/tools/openscap-base/"
6LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
Patrick Williams03907ee2022-05-01 06:28:52 -05007LICENSE = "LGPL-2.1-only"
Brad Bishop26bdd442019-08-16 17:08:17 -04008
Patrick Williams520786c2023-06-25 16:20:36 -05009DEPENDS = "dbus acl bzip2 pkgconfig gconf procps curl libxml2 libxslt libcap swig libpcre xmlsec1"
10DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native libxslt-native libcap-native libpcre-native xmlsec1-native"
11
12#Jun 22th, 2023
Andrew Geissler220dafd2023-10-04 10:18:08 -050013SRCREV = "9b3e7563575f7e5b419f8a09999b40f30e3e7c29"
Patrick Williams73bd93f2024-02-20 08:07:48 -060014SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \
15 file://0001-Replace-distutils.sysconfig-with-sysconfig.patch \
16 "
Brad Bishop26bdd442019-08-16 17:08:17 -040017
18S = "${WORKDIR}/git"
19
Patrick Williams520786c2023-06-25 16:20:36 -050020inherit cmake pkgconfig python3native python3targetconfig perlnative systemd
Brad Bishop26bdd442019-08-16 17:08:17 -040021
22PACKAGECONFIG ?= "python3 rpm perl gcrypt ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
23PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=ON, ,python3, python3"
24PACKAGECONFIG[perl] = "-DENABLE_PERL=ON, ,perl, perl"
25PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm"
26PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt"
27PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss"
28PACKAGECONFIG[selinux] = ", ,libselinux"
Patrick Williams520786c2023-06-25 16:20:36 -050029PACKAGECONFIG[remdediate_service] = "-DENABLE_OSCAP_REMEDIATE_SERVICE=ON,-DENABLE_OSCAP_REMEDIATE_SERVICE=NO,"
Brad Bishop26bdd442019-08-16 17:08:17 -040030
31EXTRA_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 Williams2a254922023-08-11 09:48:11 -050039 -DPREFERRED_PYTHON_PATH=${bindir}/python3 \
40 -DPYTHON3_PATH=${bindir}/python3 \
41 "
Brad Bishop26bdd442019-08-16 17:08:17 -040042
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053043STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source"
44STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
Brad Bishop26bdd442019-08-16 17:08:17 -040045
Patrick Williams213cb262021-08-07 19:21:33 -050046do_configure:append:class-native () {
Brad Bishop26bdd442019-08-16 17:08:17 -040047 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 Williams520786c2023-06-25 16:20:36 -050052do_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 Williams213cb262021-08-07 19:21:33 -050060do_install:class-native[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}"
61do_install:append:class-native () {
Brad Bishop26bdd442019-08-16 17:08:17 -040062 oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native}
63 install -d $oscapdir
64 cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir
65}
66
Brad Bishop1fdf4aa2019-09-09 14:56:41 -040067
Patrick Williams520786c2023-06-25 16:20:36 -050068SYSTEMD_PACKAGES = "${PN}"
69SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remdediate_service', 'oscap-remediate.service', '',d)}"
70SYSTEMD_AUTO_ENABLE = "disable"
71
72
Patrick Williams213cb262021-08-07 19:21:33 -050073FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop26bdd442019-08-16 17:08:17 -040074
Brad Bishop26bdd442019-08-16 17:08:17 -040075
Patrick Williams520786c2023-06-25 16:20:36 -050076RDEPENDS:${PN} = "libxml2 python3-core libgcc bash"
77RDEPENDS:${PN}-class-target = "libxml2 python3-core libgcc bash os-release"
Brad Bishop26bdd442019-08-16 17:08:17 -040078BBCLASSEXTEND = "native"