blob: b35ce9f257116a894cf593bb19547257a4067696 [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
Patrick Williams03514f12024-04-05 07:04:11 -050012#March 18th, 2024
13SRCREV = "0e7f654570971c1acee6dd3f34b17121372d6152"
14SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https "
Brad Bishop26bdd442019-08-16 17:08:17 -040015
16S = "${WORKDIR}/git"
17
Patrick Williams520786c2023-06-25 16:20:36 -050018inherit cmake pkgconfig python3native python3targetconfig perlnative systemd
Brad Bishop26bdd442019-08-16 17:08:17 -040019
20PACKAGECONFIG ?= "python3 rpm perl gcrypt ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
21PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=ON, ,python3, python3"
22PACKAGECONFIG[perl] = "-DENABLE_PERL=ON, ,perl, perl"
23PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm"
24PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt"
25PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss"
26PACKAGECONFIG[selinux] = ", ,libselinux"
Patrick Williams520786c2023-06-25 16:20:36 -050027PACKAGECONFIG[remdediate_service] = "-DENABLE_OSCAP_REMEDIATE_SERVICE=ON,-DENABLE_OSCAP_REMEDIATE_SERVICE=NO,"
Brad Bishop26bdd442019-08-16 17:08:17 -040028
29EXTRA_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 Williams2a254922023-08-11 09:48:11 -050037 -DPREFERRED_PYTHON_PATH=${bindir}/python3 \
38 -DPYTHON3_PATH=${bindir}/python3 \
39 "
Brad Bishop26bdd442019-08-16 17:08:17 -040040
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053041STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source"
42STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
Brad Bishop26bdd442019-08-16 17:08:17 -040043
Patrick Williams213cb262021-08-07 19:21:33 -050044do_configure:append:class-native () {
Brad Bishop26bdd442019-08-16 17:08:17 -040045 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 Williams520786c2023-06-25 16:20:36 -050050do_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 Williams213cb262021-08-07 19:21:33 -050058do_install:class-native[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}"
59do_install:append:class-native () {
Brad Bishop26bdd442019-08-16 17:08:17 -040060 oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native}
61 install -d $oscapdir
62 cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir
63}
64
Brad Bishop1fdf4aa2019-09-09 14:56:41 -040065
Patrick Williams520786c2023-06-25 16:20:36 -050066SYSTEMD_PACKAGES = "${PN}"
67SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG','remdediate_service', 'oscap-remediate.service', '',d)}"
68SYSTEMD_AUTO_ENABLE = "disable"
69
70
Patrick Williams213cb262021-08-07 19:21:33 -050071FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}"
Brad Bishop26bdd442019-08-16 17:08:17 -040072
Brad Bishop26bdd442019-08-16 17:08:17 -040073
Patrick Williams520786c2023-06-25 16:20:36 -050074RDEPENDS:${PN} = "libxml2 python3-core libgcc bash"
75RDEPENDS:${PN}-class-target = "libxml2 python3-core libgcc bash os-release"
Brad Bishop26bdd442019-08-16 17:08:17 -040076BBCLASSEXTEND = "native"