kumquat-buildroot/package/usbguard/usbguard.mk
Yann E. MORIN c19cca0452 package: switch to _CPE_ID_VALID
Now that we document _CPE_ID_VALID, and that it shall be used instead of
setting a default value to one of the other _CPE_ID_* variables, change
all of the existing packages to use it, to avoid any error when we later
extend check-package to validate the sanity ofthe _CPE_ID_* variables.

Mechanical change done within the reference container, running the new
check in check-package, to report the CPE_ID errors:

    $ make check-package 2>/dev/null \
    |awk '{
            split($(1), a, ":"); fname = a[1]
            split($(2), a, "'\''"); val = a[2]
            new_var = $(8); gsub("_CPE_ID_.*", "_CPE_ID_VALID", new_var)
            printf("%s %s %s %s\n", fname, $(8), val, new_var)
    }' \
    |while read fname var val new_var; do
        sed -r -i -e "s/${var}[[:space:]]*=[[:space:]]*${val}/${new_var} = YES/" "${fname}"
    done

    $ git diff -I'CPE_ID_(VENDOR|VALID)'
    [empty]

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-02-11 16:30:06 +01:00

66 lines
1.8 KiB
Makefile

################################################################################
#
## usbguard
#
################################################################################
USBGUARD_VERSION = 1.1.2
USBGUARD_SITE = https://github.com/USBGuard/usbguard/releases/download/usbguard-$(USBGUARD_VERSION)
USBGUARD_LICENSE = GPL-2.0+
USBGUARD_LICENSE_FILES = LICENSE
USBGUARD_CPE_ID_VALID = YES
USBGUARD_SELINUX_MODULES = usbguard
USBGUARD_CONF_ENV = ac_cv_prog_A2X=""
USBGUARD_CONF_OPTS = \
--with-bundled-catch \
--with-bundled-pegtl \
--disable-debug-build \
--without-dbus \
--without-polkit \
--disable-umockdev
USBGUARD_DEPENDENCIES += libqb protobuf
ifeq ($(BR2_PACKAGE_LIBSODIUM),y)
USBGUARD_CONF_OPTS += --with-crypto-library=sodium
USBGUARD_DEPENDENCIES += libsodium
else ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
USBGUARD_CONF_OPTS += --with-crypto-library=openssl
USBGUARD_DEPENDENCIES += libopenssl
else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
USBGUARD_CONF_ENV += \
ac_cv_path_LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
USBGUARD_CONF_OPTS += --with-crypto-library=gcrypt
USBGUARD_DEPENDENCIES += libgcrypt
endif
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
USBGUARD_CONF_OPTS += --enable-systemd
USBGUARD_DEPENDENCIES += systemd
else
USBGUARD_CONF_OPTS += --disable-systemd
endif
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
USBGUARD_CONF_OPTS += --enable-seccomp
USBGUARD_DEPENDENCIES += libseccomp
else
USBGUARD_CONF_OPTS += --disable-seccomp
endif
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
USBGUARD_CONF_OPTS += --enable-libcapng
USBGUARD_DEPENDENCIES += libcap-ng
endif
define USBGUARD_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/usbguard/S20usbguard \
$(TARGET_DIR)/etc/init.d/S20usbguard
endef
define USBGUARD_PERMISSIONS
/etc/usbguard/rules.conf f 0600 0 0 - - - - -
endef
$(eval $(autotools-package))