1 |
commit: 40417f0c131cb66e15dc4442a3104a4cfd295a91 |
2 |
Author: Julien Roy <julien <AT> jroy <DOT> ca> |
3 |
AuthorDate: Thu Mar 16 22:29:38 2023 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 19 16:56:32 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40417f0c |
7 |
|
8 |
sys-power/power-profiles-daemon: add openrc init script |
9 |
|
10 |
Closes: https://bugs.gentoo.org/900901 |
11 |
Signed-off-by: Julien Roy <julien <AT> jroy.ca> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/30166 |
13 |
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org> |
14 |
|
15 |
.../files/power-profiles-daemon.initd | 14 +++++ |
16 |
.../power-profiles-daemon-0.12-r1.ebuild | 73 ++++++++++++++++++++++ |
17 |
2 files changed, 87 insertions(+) |
18 |
|
19 |
diff --git a/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd |
20 |
new file mode 100644 |
21 |
index 000000000000..d16735e930f8 |
22 |
--- /dev/null |
23 |
+++ b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd |
24 |
@@ -0,0 +1,14 @@ |
25 |
+#!/sbin/openrc-run |
26 |
+# Copyright 1999-2023 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+ |
29 |
+name="power-profiles-daemon" |
30 |
+description="Makes power profiles handling available over D-Bus" |
31 |
+ |
32 |
+pidfile="/run/power-profiles-daemon.pid" |
33 |
+command="/usr/libexec/power-profiles-daemon" |
34 |
+command_background=true |
35 |
+ |
36 |
+start_pre() { |
37 |
+ checkpath -d /var/lib/power-profiles-daemon |
38 |
+} |
39 |
|
40 |
diff --git a/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild b/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild |
41 |
new file mode 100644 |
42 |
index 000000000000..36656c234b6d |
43 |
--- /dev/null |
44 |
+++ b/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild |
45 |
@@ -0,0 +1,73 @@ |
46 |
+# Copyright 1999-2023 Gentoo Authors |
47 |
+# Distributed under the terms of the GNU General Public License v2 |
48 |
+ |
49 |
+EAPI=8 |
50 |
+PYTHON_COMPAT=( python3_{9..11} ) |
51 |
+ |
52 |
+inherit meson python-single-r1 systemd |
53 |
+ |
54 |
+DESCRIPTION="Makes power profiles handling available over D-Bus" |
55 |
+HOMEPAGE="https://gitlab.freedesktop.org/hadess/power-profiles-daemon/" |
56 |
+SRC_URI="https://gitlab.freedesktop.org/hadess/${PN}/-/archive/${PV}/${P}.tar.bz2" |
57 |
+ |
58 |
+LICENSE="GPL-3+" |
59 |
+SLOT="0" |
60 |
+KEYWORDS="~amd64" |
61 |
+ |
62 |
+IUSE="gtk-doc test" |
63 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
64 |
+ |
65 |
+RESTRICT="!test? ( test )" |
66 |
+ |
67 |
+RDEPEND="${PYTHON_DEPS} |
68 |
+ $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]') |
69 |
+ dev-libs/glib:2 |
70 |
+ >=dev-libs/libgudev-234 |
71 |
+ >=sys-auth/polkit-0.114 |
72 |
+ sys-power/upower |
73 |
+" |
74 |
+DEPEND="${RDEPEND}" |
75 |
+BDEPEND=" |
76 |
+ gtk-doc? ( dev-util/gi-docgen ) |
77 |
+ test? ( |
78 |
+ dev-util/umockdev |
79 |
+ $(python_gen_cond_dep ' |
80 |
+ dev-python/pygobject:3[${PYTHON_USEDEP}] |
81 |
+ dev-python/python-dbusmock[${PYTHON_USEDEP}] |
82 |
+ ') |
83 |
+ ) |
84 |
+" |
85 |
+ |
86 |
+python_check_deps() { |
87 |
+ if use test; then |
88 |
+ python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" && |
89 |
+ python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" |
90 |
+ else |
91 |
+ python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" |
92 |
+ fi |
93 |
+} |
94 |
+ |
95 |
+src_configure() { |
96 |
+ local emesonargs=( |
97 |
+ -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)" |
98 |
+ $(meson_use gtk-doc gtk_doc) |
99 |
+ $(meson_use test tests) |
100 |
+ ) |
101 |
+ meson_src_configure |
102 |
+} |
103 |
+ |
104 |
+src_install() { |
105 |
+ meson_src_install |
106 |
+ python_fix_shebang "${D}"/usr/bin/powerprofilesctl |
107 |
+ |
108 |
+ newinitd "${FILESDIR}/power-profiles-daemon.initd" power-profiles-daemon |
109 |
+} |
110 |
+ |
111 |
+pkg_postinst() { |
112 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
113 |
+ if systemd_is_booted; then |
114 |
+ elog "You need to enable the service:" |
115 |
+ elog "# systemctl enable ${PN}" |
116 |
+ fi |
117 |
+ fi |
118 |
+} |