diff options
author | Sebastian Pipping <sping@gentoo.org> | 2021-02-09 16:09:19 +0100 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2021-02-09 16:42:31 +0100 |
commit | 21ee375a5505b2c953d46eeac85980be0b995636 (patch) | |
tree | 3a5da9249ce229df1c0aa9f83cec12948174b60e /sys-apps/usbguard | |
parent | sys-process/procps: Bump to version 3.3.17 (diff) | |
download | gentoo-21ee375a5505b2c953d46eeac85980be0b995636.tar.gz gentoo-21ee375a5505b2c953d46eeac85980be0b995636.tar.bz2 gentoo-21ee375a5505b2c953d46eeac85980be0b995636.zip |
sys-apps/usbguard: Fix required use for tests, fix umockdev automagic
Closes: https://bugs.gentoo.org/769692
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Diffstat (limited to 'sys-apps/usbguard')
-rw-r--r-- | sys-apps/usbguard/metadata.xml | 3 | ||||
-rw-r--r-- | sys-apps/usbguard/usbguard-1.0.0-r1.ebuild | 99 | ||||
-rw-r--r-- | sys-apps/usbguard/usbguard-1.0.0.ebuild | 8 |
3 files changed, 109 insertions, 1 deletions
diff --git a/sys-apps/usbguard/metadata.xml b/sys-apps/usbguard/metadata.xml index 6d2298876faa..2335eab4d864 100644 --- a/sys-apps/usbguard/metadata.xml +++ b/sys-apps/usbguard/metadata.xml @@ -5,4 +5,7 @@ <email>sping@gentoo.org</email> <name>Sebastian Pipping</name> </maintainer> + <use> + <flag name="umockdev">Enables support for <pkg>dev-util/umockdev</pkg></flag> + </use> </pkgmetadata> diff --git a/sys-apps/usbguard/usbguard-1.0.0-r1.ebuild b/sys-apps/usbguard/usbguard-1.0.0-r1.ebuild new file mode 100644 index 000000000000..45cb81c1a51a --- /dev/null +++ b/sys-apps/usbguard/usbguard-1.0.0-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools + +DESCRIPTION="Daemon protecting your computer against BadUSB" +HOMEPAGE="https://github.com/USBGuard/usbguard" +SRC_URI="https://github.com/USBGuard/usbguard/releases/download/${P}/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0/1" # due to libusbguard.so.<1>.0.0 +KEYWORDS="~amd64 ~x86" +IUSE="bash-completion dbus ldap policykit static-libs systemd test umockdev" + +REQUIRED_USE="policykit? ( dbus )" + +# https://github.com/USBGuard/usbguard/issues/449 +# https://bugs.gentoo.org/769692 +REQUIRED_USE+=" test? ( static-libs )" + +CDEPEND=" + <dev-libs/pegtl-3 + >=dev-libs/libsodium-0.4.5:= + >=dev-libs/protobuf-2.5.0:= + >=sys-cluster/libqb-0.16.0:= + sys-devel/gcc:*[cxx] + >=sys-libs/libcap-ng-0.7.0 + >=sys-libs/libseccomp-2.0.0 + >=sys-process/audit-2.7.7 + bash-completion? ( >=app-shells/bash-completion-2.0 ) + dbus? ( + dev-libs/glib:2 + sys-apps/dbus + policykit? ( sys-auth/polkit[introspection] ) + ) + ldap? ( net-nds/openldap ) + systemd? ( sys-apps/systemd ) + umockdev? ( dev-util/umockdev ) + " +RDEPEND="${CDEPEND} + virtual/udev + " +DEPEND="${CDEPEND} + app-text/asciidoc + dev-cpp/catch:1 + dbus? ( + dev-libs/libxml2 + dev-libs/libxslt + dev-util/gdbus-codegen + ) + " + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${PN}-1.0.0-pthreads-link.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myargs=( + $(use_with dbus) + $(use_with ldap) + $(use_with policykit polkit) + $(use_enable static-libs static) + $(use_enable systemd) + $(use_enable umockdev) + ) + + econf "${myargs[@]}" +} + +src_install() { + default + + keepdir /var/lib/log/usbguard + + newinitd "${FILESDIR}"/${PN}-0.7.6-usbguard.openrc usbguard + use dbus && newinitd "${FILESDIR}"/${PN}-0.7.6-usbguard-dbus.openrc usbguard-dbus +} + +pkg_postinst() { + ewarn + ewarn 'BEFORE STARTING USBGUARD please be sure to create/generate' + ewarn ' a rules file at /etc/usbguard/rules.conf' + ewarn ' so that you do not' + ewarn ' GET LOCKED OUT' + ewarn " of this system (\"$(hostname)\")." + ewarn + ewarn 'This command may be of help:' + ewarn ' sudo sh -c "usbguard generate-policy > /etc/usbguard/rules.conf"' + ewarn +} diff --git a/sys-apps/usbguard/usbguard-1.0.0.ebuild b/sys-apps/usbguard/usbguard-1.0.0.ebuild index 1f69b3df6b49..f93887630a22 100644 --- a/sys-apps/usbguard/usbguard-1.0.0.ebuild +++ b/sys-apps/usbguard/usbguard-1.0.0.ebuild @@ -12,10 +12,14 @@ SRC_URI="https://github.com/USBGuard/usbguard/releases/download/${P}/${P}.tar.gz LICENSE="GPL-2+" SLOT="0/1" # due to libusbguard.so.<1>.0.0 KEYWORDS="~amd64 ~x86" -IUSE="bash-completion dbus ldap policykit static-libs systemd" +IUSE="bash-completion dbus ldap policykit static-libs systemd test" REQUIRED_USE="policykit? ( dbus )" +# https://github.com/USBGuard/usbguard/issues/449 +# https://bugs.gentoo.org/769692 +REQUIRED_USE+=" test? ( static-libs )" + CDEPEND=" <dev-libs/pegtl-3 >=dev-libs/libsodium-0.4.5:= @@ -47,6 +51,8 @@ DEPEND="${CDEPEND} ) " +RESTRICT="!test? ( test )" + PATCHES=( "${FILESDIR}"/${PN}-1.0.0-pthreads-link.patch ) |