blob: 1f906ee0a49a27bf942419159066d56014930276 [file] [log] [blame]
Patrick Williamsc0f7c042017-02-23 20:41:17 -06001SUMMARY = "cve-check-tool"
2DESCRIPTION = "cve-check-tool is a tool for checking known (public) CVEs.\
3The tool will identify potentially vunlnerable software packages within Linux distributions through version matching."
4HOMEPAGE = "https://github.com/ikeydoherty/cve-check-tool"
5SECTION = "Development/Tools"
6LICENSE = "GPL-2.0+"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=e8c1458438ead3c34974bc0be3a03ed6"
8
9SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.tar.xz \
10 file://check-for-malloc_trim-before-using-it.patch \
11 file://0001-print-progress-in-percent-when-downloading-CVE-db.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 file://0001-curl-allow-overriding-default-CA-certificate-file.patch \
13 file://0001-update-Compare-computed-vs-expected-sha256-digit-str.patch \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014 "
15
16SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
17SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b"
18
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019UPSTREAM_CHECK_URI = "https://github.com/ikeydoherty/cve-check-tool/releases"
20
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates"
22
23RDEPENDS_${PN} = "ca-certificates"
24
25inherit pkgconfig autotools
26
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027EXTRA_OECONF = "--disable-coverage --enable-relative-plugins"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028CFLAGS_append = " -Wno-error=pedantic"
29
30do_populate_cve_db() {
31 if [ "${BB_NO_NETWORK}" = "1" ] ; then
32 bberror "BB_NO_NETWORK is set; Can't update cve-check-tool database, CVEs won't be checked"
33 return
34 fi
35
36 # In case we don't inherit cve-check class, use default values defined in the class.
37 cve_dir="${CVE_CHECK_DB_DIR}"
38 cve_file="${CVE_CHECK_TMP_FILE}"
39
40 [ -z "${cve_dir}" ] && cve_dir="${DL_DIR}/CVE_CHECK"
41 [ -z "${cve_file}" ] && cve_file="${TMPDIR}/cve_check"
42
43 bbdebug 2 "Updating cve-check-tool database located in $cve_dir"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 # --cacert works around curl-native not finding the CA bundle
45 if cve-check-update --cacert ${sysconfdir}/ssl/certs/ca-certificates.crt -d "$cve_dir" ; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 printf "CVE database was updated on %s UTC\n\n" "$(LANG=C date --utc +'%F %T')" > "$cve_file"
47 else
48 bbwarn "Error in executing cve-check-update"
49 if [ "${@'1' if bb.data.inherits_class('cve-check', d) else '0'}" -ne 0 ] ; then
50 bbwarn "Failed to update cve-check-tool database, CVEs won't be checked"
51 fi
52 fi
53}
54
55addtask populate_cve_db after do_populate_sysroot
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056do_populate_cve_db[depends] = "cve-check-tool-native:do_populate_sysroot"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060057do_populate_cve_db[nostamp] = "1"
58do_populate_cve_db[progress] = "percent"
59
60BBCLASSEXTEND = "native nativesdk"