summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb')
-rw-r--r--meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb b/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb
new file mode 100644
index 0000000000..558f4347b6
--- /dev/null
+++ b/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb
@@ -0,0 +1,73 @@
1# Copyright (c) 2021 Koninklijke Philips N.V.
2#
3# SPDX-License-Identifier: MIT
4#
5SUMMARY = "USBGuard daemon for blacklisting and whitelisting of USB devices"
6DESCRIPTION = "The USBGuard software framework helps to protect your computer against \
7rogue USB devices (a.k.a. Bad USB) by implementing basic whitelisting and blacklisting \
8capabilities based on device attributes. This recipe takes OpenSSL as crypto-backend for \
9computing device hashes (Supported values are sodium, gcrypt, openssl)."
10HOMEPAGE = "https://usbguard.github.io/"
11LICENSE = "GPL-2.0-only"
12LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
13
14SRC_URI = "https://github.com/USBGuard/usbguard/releases/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
15 file://0001-Add-and-use-pkgconfig-instead-of-libgcrypt-config.patch \
16 file://0001-Adapt-for-protobuf-30.0-API-changes.patch \
17 "
18
19SRC_URI[sha256sum] = "707dad2938923202697f636c2b4e0be80f192242039a2af3fc7ac35d03f78551"
20
21inherit autotools-brokensep bash-completion pkgconfig systemd github-releases
22
23DEPENDS = "glib-2.0-native libcap-ng libqb libxml2-native libxslt-native protobuf protobuf-native xmlto-native"
24
25UPSTREAM_CHECK_REGEX = "releases/tag/usbguard-(?P<pver>\d+(\.\d+)+)"
26
27EXTRA_OECONF += "\
28 --with-bundled-catch \
29 --with-bundled-pegtl \
30"
31
32LDFLAGS:append:riscv32 = " -latomic"
33
34PACKAGECONFIG ?= "\
35 openssl \
36 ${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)} \
37 ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)} \
38 ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
39"
40
41# USBGuard has made polkit mandatory to configure with-dbus
42PACKAGECONFIG[dbus] = "--with-dbus,--without-dbus,dbus-glib polkit"
43PACKAGECONFIG[libgcrypt] = "--with-crypto-library=gcrypt,,libgcrypt,,,libsodium openssl"
44PACKAGECONFIG[libsodium] = "--with-crypto-library=sodium,,libsodium,,,libgcrypt openssl"
45PACKAGECONFIG[openssl] = "--with-crypto-library=openssl,,openssl,,,libgcrypt libsodium"
46PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit"
47PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
48PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
49
50SYSTEMD_PACKAGES = "${PN}"
51
52SYSTEMD_SERVICE:${PN} = "usbguard.service ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'usbguard-dbus.service', '', d)}"
53
54FILES:${PN} += "\
55 ${systemd_unitdir}/system/usbguard.service \
56 ${systemd_unitdir}/system/usbguard-dbus.service \
57 ${datadir}/polkit-1 \
58 ${datadir}/dbus-1 \
59 ${nonarch_libdir}/tmpfiles.d \
60"
61
62do_install:append() {
63# Create /var/log/usbguard in runtime.
64 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
65 install -d ${D}${nonarch_libdir}/tmpfiles.d
66 echo "d ${localstatedir}/log/${BPN} 0755 root root -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
67 fi
68 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
69 install -d ${D}${sysconfdir}/default/volatiles
70 echo "d root root 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
71 fi
72 rm -rf ${D}${localstatedir}/log
73}