Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 1 | SUMMARY = "cve-check-tool" |
| 2 | DESCRIPTION = "cve-check-tool is a tool for checking known (public) CVEs.\ |
| 3 | The tool will identify potentially vunlnerable software packages within Linux distributions through version matching." |
| 4 | HOMEPAGE = "https://github.com/ikeydoherty/cve-check-tool" |
| 5 | SECTION = "Development/Tools" |
| 6 | LICENSE = "GPL-2.0+" |
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e8c1458438ead3c34974bc0be3a03ed6" |
| 8 | |
| 9 | SRC_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 | |
| 14 | SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155" |
| 15 | SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b" |
| 16 | |
| 17 | DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates" |
| 18 | |
| 19 | RDEPENDS_${PN} = "ca-certificates" |
| 20 | |
| 21 | inherit pkgconfig autotools |
| 22 | |
| 23 | EXTRA_OECONF = "--disable-coverage" |
| 24 | CFLAGS_append = " -Wno-error=pedantic" |
| 25 | |
| 26 | do_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 | |
| 50 | addtask populate_cve_db after do_populate_sysroot |
| 51 | do_populate_cve_db[nostamp] = "1" |
| 52 | do_populate_cve_db[progress] = "percent" |
| 53 | |
| 54 | BBCLASSEXTEND = "native nativesdk" |