blob: 1baadea8ec29586bf79fe4e3bfc08574f8dfb572 [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 \
12 "
13
14SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
15SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b"
16
17DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates"
18
19RDEPENDS_${PN} = "ca-certificates"
20
21inherit pkgconfig autotools
22
23EXTRA_OECONF = "--disable-coverage"
24CFLAGS_append = " -Wno-error=pedantic"
25
26do_populate_cve_db() {
27 if [ "${BB_NO_NETWORK}" = "1" ] ; then
28 bberror "BB_NO_NETWORK is set; Can't update cve-check-tool database, CVEs won't be checked"
29 return
30 fi
31
32 # In case we don't inherit cve-check class, use default values defined in the class.
33 cve_dir="${CVE_CHECK_DB_DIR}"
34 cve_file="${CVE_CHECK_TMP_FILE}"
35
36 [ -z "${cve_dir}" ] && cve_dir="${DL_DIR}/CVE_CHECK"
37 [ -z "${cve_file}" ] && cve_file="${TMPDIR}/cve_check"
38
39 bbdebug 2 "Updating cve-check-tool database located in $cve_dir"
40 if cve-check-update -d "$cve_dir" ; then
41 printf "CVE database was updated on %s UTC\n\n" "$(LANG=C date --utc +'%F %T')" > "$cve_file"
42 else
43 bbwarn "Error in executing cve-check-update"
44 if [ "${@'1' if bb.data.inherits_class('cve-check', d) else '0'}" -ne 0 ] ; then
45 bbwarn "Failed to update cve-check-tool database, CVEs won't be checked"
46 fi
47 fi
48}
49
50addtask populate_cve_db after do_populate_sysroot
51do_populate_cve_db[nostamp] = "1"
52do_populate_cve_db[progress] = "percent"
53
54BBCLASSEXTEND = "native nativesdk"