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 | |
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>
3 files changed, 78 insertions, 116 deletions
diff --git a/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch b/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch deleted file mode 100644 index 2d70855..0000000 --- a/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | Index: git/configure.ac | ||
2 | =================================================================== | ||
3 | --- git.orig/configure.ac | ||
4 | +++ git/configure.ac | ||
5 | @@ -360,25 +360,13 @@ case "${with_crypto}" in | ||
6 | AC_DEFINE([HAVE_NSS3], [1], [Define to 1 if you have 'NSS' library.]) | ||
7 | ;; | ||
8 | gcrypt) | ||
9 | - SAVE_LIBS=$LIBS | ||
10 | - AC_CHECK_LIB([gcrypt], [gcry_check_version], | ||
11 | - [crapi_CFLAGS=`libgcrypt-config --cflags`; | ||
12 | - crapi_LIBS=`libgcrypt-config --libs`; | ||
13 | - crapi_libname="GCrypt";], | ||
14 | - [AC_MSG_ERROR([library 'gcrypt' is required for GCrypt.])], | ||
15 | - []) | ||
16 | - AC_DEFINE([HAVE_GCRYPT], [1], [Define to 1 if you have 'gcrypt' library.]) | ||
17 | - AC_CACHE_CHECK([for GCRYCTL_SET_ENFORCED_FIPS_FLAG], | ||
18 | - [ac_cv_gcryctl_set_enforced_fips_flag], | ||
19 | - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include<gcrypt.h>], | ||
20 | - [return GCRYCTL_SET_ENFORCED_FIPS_FLAG;])], | ||
21 | - [ac_cv_gcryctl_set_enforced_fips_flag=yes], | ||
22 | - [ac_cv_gcryctl_set_enforced_fips_flag=no])]) | ||
23 | + PKG_CHECK_MODULES([libgcrypt], [libgcrypt >= 1.7.9],[], | ||
24 | + AC_MSG_FAILURE([libgcrypt devel support is missing])) | ||
25 | |||
26 | - if test "${ac_cv_gcryctl_set_enforced_fips_flag}" == "yes"; then | ||
27 | - AC_DEFINE([HAVE_GCRYCTL_SET_ENFORCED_FIPS_FLAG], [1], [Define to 1 if you have 'gcrypt' library with GCRYCTL_SET_ENFORCED_FIPS_FLAG.]) | ||
28 | - fi | ||
29 | - LIBS=$SAVE_LIBS | ||
30 | + crapi_libname="libgcrypt" | ||
31 | + crapi_CFLAGS=$libgcrypt_CFLAGS | ||
32 | + crapi_LIBS=$libgcrypt_LIBS | ||
33 | + AC_DEFINE([HAVE_GCRYPT], [1], [Define to 1 if you have 'libgcrypt' library.]) | ||
34 | ;; | ||
35 | *) | ||
36 | AC_MSG_ERROR([unknown crypto backend]) | ||
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" | ||
diff --git a/meta-security-compliance/recipes-openscap/openscap/openscap_git.bb b/meta-security-compliance/recipes-openscap/openscap/openscap_git.bb index 3bfa2e1..3dfa99e 100644 --- a/meta-security-compliance/recipes-openscap/openscap/openscap_git.bb +++ b/meta-security-compliance/recipes-openscap/openscap/openscap_git.bb | |||
@@ -1,88 +1,11 @@ | |||
1 | # Copyright (C) 2017 Armin Kuster <akuster808@gmail.com> | 1 | # Copyright (C) 2017 Armin Kuster <akuster808@gmail.com> |
2 | # Released under the MIT license (see COPYING.MIT for the terms) | 2 | # Released under the MIT license (see COPYING.MIT for the terms) |
3 | 3 | ||
4 | SUMARRY = "NIST Certified SCAP 1.2 toolkit" | 4 | SUMARRY = "NIST Certified SCAP 1.2 toolkit with OE changes" |
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 | 5 | ||
9 | DEPENDS = "autoconf-archive pkgconfig gconf procps curl libxml2 rpm \ | 6 | SRCREV = "4bbdb46ff651f809d5b38ca08d769790c4bfff90" |
10 | libxslt libcap swig swig-native" | 7 | SRC_URI = "git://github.com/akuster/openscap.git;branch=oe-1.3 \ |
11 | |||
12 | DEPENDS_class-native = "autoconf-archive-native pkgconfig-native swig-native curl-native libxml2-native libxslt-native dpkg-native libgcrypt-native nss-native" | ||
13 | |||
14 | SRCREV = "59c234b3e9907480c89dfbd1b466a6bf72a2d2ed" | ||
15 | SRC_URI = "git://github.com/akuster/openscap.git;branch=oe \ | ||
16 | file://crypto_pkgconfig.patch \ | ||
17 | file://run-ptest \ | 8 | file://run-ptest \ |
18 | " | 9 | " |
19 | PV = "v1.2.17+git${SRCPV}" | ||
20 | |||
21 | inherit autotools-brokensep pkgconfig python3native perlnative ptest | ||
22 | |||
23 | S = "${WORKDIR}/git" | ||
24 | |||
25 | PACKAGECONFIG ?= "nss3 pcre rpm" | ||
26 | PACKAGECONFIG[pcre] = ",--enable-regex-posix, libpcre" | ||
27 | PACKAGECONFIG[gcrypt] = "--with-crypto=gcrypt,, libgcrypt " | ||
28 | PACKAGECONFIG[nss3] = "--with-crypto=nss3,, nss" | ||
29 | PACKAGECONFIG[python] = "--enable-python, --disable-python, python, python" | ||
30 | PACKAGECONFIG[python3] = "--enable-python3, --disable-python3, python3, python3" | ||
31 | PACKAGECONFIG[perl] = "--enable-perl, --disable-perl, perl, perl" | ||
32 | PACKAGECONFIG[rpm] = " --enable-util-scap-as-rpm, --disable-util-scap-as-rpm, rpm, rpm" | ||
33 | |||
34 | export LDFLAGS += " -ldl" | ||
35 | |||
36 | EXTRA_OECONF += "--enable-probes-independent --enable-probes-linux \ | ||
37 | --enable-probes-solaris --enable-probes-unix --disable-util-oscap-docker\ | ||
38 | --enable-util-oscap-ssh --enable-util-oscap --enable-ssp --enable-sce \ | ||
39 | " | ||
40 | |||
41 | EXTRA_OECONF_class-native += "--disable-probes-independent --enable-probes-linux \ | ||
42 | --disable-probes-solaris --disable-probes-unix \ | ||
43 | --enable-util-oscap \ | ||
44 | " | ||
45 | |||
46 | do_configure_prepend () { | ||
47 | sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/perl/Makefile.am | ||
48 | sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/python3/Makefile.am | ||
49 | sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/python2/Makefile.am | ||
50 | sed -i 's:python2:python:' ${S}/utils/scap-as-rpm | ||
51 | } | ||
52 | |||
53 | 10 | ||
54 | include openscap.inc | 11 | include openscap.inc |
55 | |||
56 | do_configure_append_class-native () { | ||
57 | sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${S}/config.h | ||
58 | sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${S}/config.h | ||
59 | sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${S}/config.h | ||
60 | } | ||
61 | |||
62 | do_clean[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}" | ||
63 | |||
64 | do_install_append_class-native () { | ||
65 | oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native} | ||
66 | install -d $oscapdir | ||
67 | cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir | ||
68 | } | ||
69 | |||
70 | TESTDIR = "tests" | ||
71 | |||
72 | do_compile_ptest() { | ||
73 | sed -i 's:python2:python:' ${S}/${TESTDIR}/nist/test_worker.py | ||
74 | echo 'buildtest-TESTS: $(check)' >> ${TESTDIR}/Makefile | ||
75 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
76 | } | ||
77 | |||
78 | do_install_ptest() { | ||
79 | # install the tests | ||
80 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
81 | } | ||
82 | |||
83 | FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}" | ||
84 | |||
85 | RDEPENDS_${PN} += "libxml2 python libgcc" | ||
86 | RDEPENDS_${PN}-ptest = "bash perl python" | ||
87 | |||
88 | BBCLASSEXTEND = "native" | ||