blob: ed8d8ffa78f77e615d0647b520edfd9d521295fa [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
2# 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"
7LICENSE = "LGPL-2.1"
8
9DEPENDS = "dbus acl bzip2 pkgconfig gconf procps curl libxml2 libxslt libcap swig"
10DEPENDS_class-native = "pkgconfig-native swig-native curl-native libxml2-native libxslt-native libcap-native"
11
12S = "${WORKDIR}/git"
13
14inherit cmake pkgconfig python3native perlnative
15
16PACKAGECONFIG ?= "python3 rpm perl gcrypt ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
17PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=ON, ,python3, python3"
18PACKAGECONFIG[perl] = "-DENABLE_PERL=ON, ,perl, perl"
19PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=ON, ,rpm, rpm"
20PACKAGECONFIG[gcrypt] = "-DWITH_CRYPTO=gcrypt, ,libgcrypt"
21PACKAGECONFIG[nss3] = "-DWITH_CRYPTO=nss3, ,nss"
22PACKAGECONFIG[selinux] = ", ,libselinux"
23
24EXTRA_OECMAKE += "-DENABLE_PROBES_LINUX=ON -DENABLE_PROBES_UNIX=ON \
25 -DENABLE_PROBES_SOLARIS=OFF -DENABLE_PROBES_INDEPENDENT=ON \
26 -DENABLE_OSCAP_UTIL=ON -DENABLE_OSCAP_UTIL_SSH=ON \
27 -DENABLE_OSCAP_UTIL_DOCKER=OFF -DENABLE_OSCAP_UTIL_CHROOT=OFF \
28 -DENABLE_OSCAP_UTIL_PODMAN=OFF -DENABLE_OSCAP_UTIL_VM=OFF \
29 -DENABLE_PROBES_WINDOWS=OFF -DENABLE_VALGRIND=OFF \
30 -DENABLE_SCE=ON -DENABLE_MITRE=OFF -DENABLE_TESTS=OFF \
31 -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_SKIP_RPATH=ON \
32 "
33
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053034STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source"
35STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
Brad Bishop26bdd442019-08-16 17:08:17 -040036
37do_configure_append_class-native () {
38 sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${B}/config.h
39 sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${B}/config.h
40 sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${B}/config.h
41}
42
43do_clean[cleandirs] += "${STAGING_OSCAP_BUILDDIR}"
Brad Bishop36166cd2019-08-26 01:31:32 -040044do_install[nostamp] = "1"
Brad Bishop26bdd442019-08-16 17:08:17 -040045
46do_install_append_class-native () {
47 oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native}
48 install -d $oscapdir
49 cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir
50}
51
52FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}"
53
Brad Bishop36166cd2019-08-26 01:31:32 -040054RDEPENDS_${PN} += "libxml2 python3-core libgcc bash"
Brad Bishop26bdd442019-08-16 17:08:17 -040055
56BBCLASSEXTEND = "native"