diff options
author | Armin Kuster <akuster808@gmail.com> | 2019-06-30 15:29:20 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2019-07-17 16:56:02 -0700 |
commit | 37040cfb765ab00a418f098598cea6d14a81d636 (patch) | |
tree | 6f7b7ed6e24a8f6258c0b6f99027c919285a7cc4 /meta-security-compliance/recipes-openscap/openscap/openscap.inc | |
parent | eabb07f6d2fc3318fd50f05d364372a96e0b12ed (diff) | |
download | meta-security-37040cfb765ab00a418f098598cea6d14a81d636.tar.gz |
openscap_git: update to 1.3.0
removed unneeded patch
convert over to cmake
refactor files
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-security-compliance/recipes-openscap/openscap/openscap.inc')
-rw-r--r-- | meta-security-compliance/recipes-openscap/openscap/openscap.inc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/meta-security-compliance/recipes-openscap/openscap/openscap.inc b/meta-security-compliance/recipes-openscap/openscap/openscap.inc index e9589b6..4c1f206 100644 --- a/meta-security-compliance/recipes-openscap/openscap/openscap.inc +++ b/meta-security-compliance/recipes-openscap/openscap/openscap.inc | |||
@@ -1,2 +1,77 @@ | |||
1 | # Copyright (C) 2017 Armin Kuster <akuster808@gmail.com> | ||
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" | ||
7 | LICENSE = "LGPL-2.1" | ||
8 | |||
9 | DEPENDS = "autoconf-archive dbus acl bzip2 pkgconfig gconf procps curl libxml2 libxslt libcap swig libgcrypt chrpath-replacement-native " | ||
10 | |||
11 | DEPENDS_class-native = "autoconf-archive-native pkgconfig-native swig-native curl-native libxml2-native libxslt-native dpkg-native libgcrypt-native nss-native" | ||
12 | |||
13 | inherit cmake pkgconfig python3native perlnative ptest | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | PACKAGECONFIG ?= "python3 rpm perl" | ||
18 | PACKAGECONFIG[python3] = "-DENABLE_PYTHON3=True, , python3, python3" | ||
19 | PACKAGECONFIG[perl] = "-DENABLE_PERL=True,, perl, perl" | ||
20 | PACKAGECONFIG[rpm] = "-DENABLE_OSCAP_UTIL_AS_RPM=True, ,rpm, rpm" | ||
21 | |||
22 | EXTRA_OECONF += "-DENABLE_PROBES_INDEPENDENT=yes -DENABLE_PROBES_LINUX=yes -DWITH_CRYPTO=gcrypt\ | ||
23 | -DENABLE_PROBES_SOLARIS=yes -DENABLE_PROBES_UNIX=yes -DENABLE_TESTS=no \ | ||
24 | -DENABLE_OSCAP_UTIL_SSH=yes -DENABLE_OSCAP_UTIL=yes -DENABLE_SCE=yes \ | ||
25 | -DENABLE_OSCAP_UTIL_DOCKER=no \ | ||
26 | " | ||
27 | |||
28 | EXTRA_OECONF_class-native += "-DENABLE_PROBES=True" | ||
29 | |||
1 | STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source" | 30 | STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source" |
2 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" | 31 | STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts" |
32 | |||
33 | EXTRANATIVEPATH += "chrpath-native" | ||
34 | |||
35 | do_configure_append_class-native () { | ||
36 | sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${S}/config.h | ||
37 | sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${S}/config.h | ||
38 | sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${S}/config.h | ||
39 | } | ||
40 | |||
41 | do_clean[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}" | ||
42 | |||
43 | do_compile_append_class-target() { | ||
44 | sed -i -e 's:${STAGING_BINDIR_NATIVE}/python3-native/python3:${bindir}/python3:' ${B}/utils/oscap-docker | ||
45 | } | ||
46 | |||
47 | do_install_append_class-native () { | ||
48 | oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native} | ||
49 | install -d $oscapdir | ||
50 | cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir | ||
51 | } | ||
52 | |||
53 | TESTDIR = "tests" | ||
54 | |||
55 | do_compile_ptest() { | ||
56 | oe-runcmake ${TESTDIR} | ||
57 | } | ||
58 | |||
59 | do_install_ptest() { | ||
60 | # install the tests | ||
61 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
62 | } | ||
63 | |||
64 | do_fixup_rpath() { | ||
65 | chrpath -d ${D}${libdir}/libopenscap.so.25.0.1 | ||
66 | chrpath -d ${D}${libdir}/libopenscap_sce.so.25.0.1 | ||
67 | chrpath -d ${D}${bindir}/oscap | ||
68 | } | ||
69 | |||
70 | addtask fixup_rpath before do_package after do_install | ||
71 | |||
72 | FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}" | ||
73 | |||
74 | RDEPENDS_${PN} += "libxml2 python3 libgcc" | ||
75 | RDEPENDS_${PN}-ptest = "bash perl python3-core" | ||
76 | |||
77 | BBCLASSEXTEND = "native" | ||