diff --git a/profiles/pentoo/base/package.accept_keywords/dev-libs b/profiles/pentoo/base/package.accept_keywords/dev-libs index a36ad368a..17422241e 100644 --- a/profiles/pentoo/base/package.accept_keywords/dev-libs +++ b/profiles/pentoo/base/package.accept_keywords/dev-libs @@ -47,3 +47,8 @@ dev-libs/libsmdev #frida-gum dev-libs/libdwarf + +#usbguard +#=dev-libs/pegtl-2.1* +=dev-libs/pegtl-1.3* +=dev-cpp/catch-2.2* diff --git a/profiles/pentoo/base/package.accept_keywords/dev-ruby b/profiles/pentoo/base/package.accept_keywords/dev-ruby index 26684caf1..64666c5e9 100644 --- a/profiles/pentoo/base/package.accept_keywords/dev-ruby +++ b/profiles/pentoo/base/package.accept_keywords/dev-ruby @@ -374,3 +374,6 @@ dev-ruby/listen:1 =dev-ruby/execjs-2.7* =dev-ruby/sass-3.4* =dev-ruby/sqlite3-1.3* + +#usbguard +=dev-ruby/asciidoctor-1.5* diff --git a/profiles/pentoo/base/package.accept_keywords/sys-apps b/profiles/pentoo/base/package.accept_keywords/sys-apps index ee310b44b..b52c88a07 100644 --- a/profiles/pentoo/base/package.accept_keywords/sys-apps +++ b/profiles/pentoo/base/package.accept_keywords/sys-apps @@ -4,3 +4,4 @@ sys-apps/fwts =sys-apps/pcsc-tools-1.4* =dev-perl/pcsc-perl-1.4* +sys-apps/usbguard diff --git a/sys-apps/usbguard/Manifest b/sys-apps/usbguard/Manifest new file mode 100644 index 000000000..2a901b710 --- /dev/null +++ b/sys-apps/usbguard/Manifest @@ -0,0 +1 @@ +DIST usbguard-0.7.2.tar.gz 1025446 BLAKE2B e0ac650ff7eb79c122db921ed25c64750041906d100ff6fc26178aabafd19c3102d01e42a0c5082585c5b4ba8360263238845488ac3f4efa1aecc9fbc076dc44 SHA512 befe82deb9a6a73fe835acef9f196a887324e73439d1b9abc5e874bbab5ced1480cf6bda842eb87f0cef2acb7bd77800def0f3ee3fc71736d0aeb29a10c5b9d3 diff --git a/sys-apps/usbguard/usbguard-0.7.2.ebuild b/sys-apps/usbguard/usbguard-0.7.2.ebuild new file mode 100644 index 000000000..0d5164988 --- /dev/null +++ b/sys-apps/usbguard/usbguard-0.7.2.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools systemd + +DESCRIPTION="The USBGuard software framework helps to protect your computer against BadUSB." +HOMEPAGE="https://github.com/dkopecek/usbguard" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 + EGIT_BRANCH="master" + EGIT_REPO_URI="https://github.com/dkopecek/${PN}.git" + EGIT_SUBMODULES=( src/ThirdParty/Catch src/ThirdParty/PEGTL src/ThirdParty/usbmon ) + KEYWORDS="" +else + KEYWORDS="~x86 ~amd64" + SRC_URI="https://github.com/USBGuard/usbguard/archive/${P}.tar.gz" + S=${WORKDIR}/${PN}-${PN}-${PV} +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="crypt +dbus +policykit qt5 systemd" + +DEPEND="sys-cluster/libqb + sys-libs/libseccomp + sys-libs/libcap-ng + dev-libs/protobuf + dev-ruby/asciidoctor + dev-cpp/catch + <=dev-libs/pegtl-2.0 + systemd? ( sys-apps/systemd ) + dbus? ( sys-apps/dbus + dev-libs/dbus-glib ) + policykit? ( sys-auth/polkit ) + qt5? ( dev-qt/qtgui:5 + dev-qt/qtsvg:5 + dev-qt/qtwidgets:5 + dev-qt/qtcore:5 ) + crypt? ( || ( dev-libs/libgcrypt:0 dev-libs/libsodium ) ) + " + +RDEPEND="${DEPEND} + virtual/udev" + +src_prepare() { + default + eautoreconf +} + +src_configure() { +# local myconf=() + econf $(use_enable systemd) \ + $(use_with dbus) \ + --with-gui-qt=$(usex qt5 qt5) \ + $(use_with policykit polkit) \ + --disable-dependency-tracking +# "${myconf[@]}" +} + +src_compile() { + if use qt5; then + export QT_SELECT=qt5 + fi + + emake +} + +src_install() { + emake DESTDIR="${D}" install + + if use systemd ; then + systemd_dounit usbguard.service + fi + + insinto /etc/usbguard + doins usbguard-daemon.conf + + keepdir /var/lib/log/usbguard +} + +pkg_postinst() { + elog "You will need to allow access to your user for accessing the QT gui." + elog "Execute as root. usbguard add-user YOUR_USERNAME --devices ALL --exceptions ALL" +}