commit:     64bc2dea286b22f4cce895ece50684affd6bf215
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 14 16:48:13 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Dec 14 17:17:37 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64bc2dea

dev-libs/libratbag: ebuild enhancements

  - use systemd.eclass to determine systemunitdir
  - Set plugdev group as the unix group that may access ratbagd via dbus
  - (R)DEPEND on acct-group/plugdev
  - Add openrc init script for ratbagd

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 dev-libs/libratbag/files/ratbagd.init    | 13 +++++++++++++
 dev-libs/libratbag/libratbag-0.15.ebuild | 17 ++++++++++++++---
 dev-libs/libratbag/metadata.xml          |  5 +++++
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/dev-libs/libratbag/files/ratbagd.init 
b/dev-libs/libratbag/files/ratbagd.init
new file mode 100644
index 00000000000..d3e7d08334c
--- /dev/null
+++ b/dev-libs/libratbag/files/ratbagd.init
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="system daemon to introspect and modify configurable mice"
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/ratbagd"
+start_stop_daemon_args="--quiet"
+command_background="true"
+
+depend() {
+       need dbus
+}

diff --git a/dev-libs/libratbag/libratbag-0.15.ebuild 
b/dev-libs/libratbag/libratbag-0.15.ebuild
index 599db86cfd6..bd064182e84 100644
--- a/dev-libs/libratbag/libratbag-0.15.ebuild
+++ b/dev-libs/libratbag/libratbag-0.15.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit meson python-single-r1 udev
+inherit meson python-single-r1 systemd udev
 
 DESCRIPTION="Library to configure gaming mice"
 HOMEPAGE="https://github.com/libratbag/libratbag";
@@ -37,6 +37,7 @@ BDEPEND="
 "
 RDEPEND="
        ${PYTHON_DEPS}
+       acct-group/plugdev
        dev-libs/gobject-introspection
        dev-libs/libevdev
        virtual/libudev
@@ -63,10 +64,12 @@ src_configure() {
        python_setup
 
        local emesonargs=(
-               $(meson_use systemd)
-               -Dlogind-provider=$(usex elogind elogind systemd)
                $(meson_use doc documentation)
+               $(meson_use systemd)
                $(meson_use test tests)
+               -Ddbus-group="plugdev"
+               -Dlogind-provider=$(usex elogind elogind systemd)
+               -Dsystemd-unit-dir="$(systemd_get_systemunitdir)"
                -Dudev-dir="${EPREFIX}$(get_udevdir)"
        )
 
@@ -76,4 +79,12 @@ src_configure() {
 src_install() {
        meson_src_install
        python_fix_shebang "${ED}"/usr/bin/
+       newinitd "${FILESDIR}"/ratbagd.init ratbagd
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+               elog 'You need to be in "plugdev" group in order to access the'
+               elog 'ratbagd dbus interface'
+       fi
 }

diff --git a/dev-libs/libratbag/metadata.xml b/dev-libs/libratbag/metadata.xml
index 2ae9cbec355..f0fab9cd91a 100644
--- a/dev-libs/libratbag/metadata.xml
+++ b/dev-libs/libratbag/metadata.xml
@@ -9,6 +9,11 @@
     <email>[email protected]</email>
     <name>Proxy Maintainers</name>
   </maintainer>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Lars Wendler</name>
+    <description>Proxy maintainer for Alex</description>
+  </maintainer>
   <upstream>
     <remote-id type="github">libratbag/libratbag</remote-id>
   </upstream>

Reply via email to