sys-apps/bolt: add openrc support

thanks to redflyhacker+gentoo@gmail.com for providing the init script
and the kernel config checks.

Closes: https://bugs.gentoo.org/692510
Package-Manager: Portage-3.0.4, Repoman-2.3.23
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
This commit is contained in:
Matthew Thode
2020-08-24 13:14:15 -05:00
parent be8e156ac4
commit 046e89752c
2 changed files with 66 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-info meson systemd
DESCRIPTION="Userspace system daemon to enable security levels for Thunderbolt 3"
HOMEPAGE="https://gitlab.freedesktop.org/bolt/bolt"
SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc systemd"
DEPEND="
>=dev-libs/glib-2.56.0:2
dev-util/glib-utils
virtual/libudev
virtual/udev
dev-util/umockdev
sys-auth/polkit[introspection]
systemd? ( sys-apps/systemd )
doc? ( app-text/asciidoc )"
RDEPEND="${DEPEND}"
pkg_pretend() {
CONFIG_CHECK="~THUNDERBOLT"
ERROR_THUNDERBOLT="This package requires the thunderbolt kernel driver."
check_extra_config
CONFIG_CHECK="~HOTPLUG_PCI"
ERROR_HOTPLUG_PCI="Thunderbolt requires PCI hotplug support."
check_extra_config
}
src_configure() {
local emesonargs=(
-Dman=$(usex doc true false)
--sysconfdir=/etc
--localstatedir=/var
--sharedstatedir=/var/lib
)
meson_src_configure
}
src_install() {
meson_src_install
newinitd "${FILESDIR}"/${PN}.openrc boltd
keepdir /var/lib/boltd
}
+14
View File
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="Thunderbolt Security Daemon"
description="Userspace system daemon to enable security levels for Thunderbolt 3"
command="/usr/libexec/boltd"
command_background="true"
pidfile="/var/run/boltd.pid"
depend() {
need dbus
before xdm
}