gensokyo_kappa-overlay/sys-apps/usbguard/usbguard-9999.ebuild

131 lines
2.5 KiB
Bash
Raw Normal View History

2018-03-10 18:45:51 +01:00
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
inherit autotools git-r3 systemd
DESCRIPTION="The USBGuard software framework helps to protect your computer against BadUSB."
HOMEPAGE="https://github.com/dkopecek/usbguard"
MY_AUTHOR="dkopecek"
EGIT_REPO_URI="https://github.com/${MY_AUTHOR}/${PN}.git"
EGIT_SUBMODULES=( src/ThirdParty/Catch src/ThirdParty/PEGTL src/ThirdParty/usbmon )
if [[ ${PV} == "9999" ]] ; then
EGIT_BRANCH="master"
KEYWORDS=""
else
EGIT_COMMIT="usbguard-${PV}"
KEYWORDS="~x86 ~amd64"
fi
LICENSE="GPL-2"
SLOT="0"
IUSE="crypt +dbus +policykit qt4 qt5 +systemd"
IUSE+=" crypt_gcrypt crypt_sodium"
DEPEND="sys-cluster/libqb
sys-libs/libseccomp
sys-libs/libcap-ng
dev-ruby/asciidoctor
2018-03-10 18:45:51 +01:00
dev-libs/protobuf
systemd? ( sys-apps/systemd )
dbus? ( sys-apps/dbus
dev-libs/dbus-glib )
policykit? ( sys-auth/polkit )
qt4? ( dev-qt/qtgui:4
dev-qt/qtsvg:4
dev-qt/qtcore:4 )
qt5? ( dev-qt/qtgui:5
dev-qt/qtsvg:5
dev-qt/qtwidgets:5
dev-qt/qtcore:5 )
crypt? (
crypt_gcrypt? ( dev-libs/libgcrypt )
crypt_sodium? ( dev-libs/libsodium )
)"
RDEPEND="${DEPEND}
virtual/udev"
REQUIRED_USE="
crypt? (
^^ (
crypt_sodium
crypt_gcrypt
)
)
?? ( qt4 qt5 )"
#PATCHES=(
# "${FILESDIR}/openrc-support.patch"
#)
2018-03-10 18:45:51 +01:00
src_prepare() {
default
eautoreconf
#eapply "${WORKDIR}"/openrc-support.patch
2018-03-10 18:45:51 +01:00
}
src_configure() {
local myconf=()
if use crypt_gcrypt; then
myconf+=( --with-crypto-library=gcrypt )
elif use crypt_sodium; then
myconf+=( --with-crypto-library=sodium )
fi
if use qt5; then
myconf+=( --with-gui-qt=qt5 )
elif use qt4; then
myconf+=( --with-gui-qt=qt4 )
fi
if use policykit; then
myconf+=( --with-polkit )
fi
econf \
$(use_enable systemd) \
$(use_with dbus) \
--with-bundled-catch \
--with-bundled-pegtl \
"${myconf[@]}"
2018-03-10 18:45:51 +01:00
}
src_compile() {
if use qt5; then
export QT_SELECT=qt5
elif use qt4; then
export QT_SELECT=qt4
fi
emake
}
src_install() {
emake DESTDIR="${D}" install
if use systemd; then
systemd_dounit usbguard.service
fi
2018-03-10 18:45:51 +01:00
doinitd "${FILESDIR}"/openRC/usbguard
doinitd "${FILESDIR}"/openRC/usbguard-dbus
doconfd "${FILESDIR}"/openRC/conf.d/usbguard
doconfd "${FILESDIR}"/openRC/conf.d/usbguard-dbus
insinto "/etc/usbguard"
2018-03-10 18:45:51 +01:00
doins usbguard-daemon.conf
}
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"
}