public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Pacho Ramos" <pacho@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/power-profiles-daemon/, sys-power/power-profiles-daemon/files/
Date: Sun, 19 Mar 2023 16:56:44 +0000 (UTC)	[thread overview]
Message-ID: <1679244992.40417f0c131cb66e15dc4442a3104a4cfd295a91.pacho@gentoo> (raw)

commit:     40417f0c131cb66e15dc4442a3104a4cfd295a91
Author:     Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Thu Mar 16 22:29:38 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 16:56:32 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40417f0c

sys-power/power-profiles-daemon: add openrc init script

Closes: https://bugs.gentoo.org/900901
Signed-off-by: Julien Roy <julien <AT> jroy.ca>
Closes: https://github.com/gentoo/gentoo/pull/30166
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 .../files/power-profiles-daemon.initd              | 14 +++++
 .../power-profiles-daemon-0.12-r1.ebuild           | 73 ++++++++++++++++++++++
 2 files changed, 87 insertions(+)

diff --git a/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd
new file mode 100644
index 000000000000..d16735e930f8
--- /dev/null
+++ b/sys-power/power-profiles-daemon/files/power-profiles-daemon.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="power-profiles-daemon"
+description="Makes power profiles handling available over D-Bus"
+
+pidfile="/run/power-profiles-daemon.pid"
+command="/usr/libexec/power-profiles-daemon"
+command_background=true
+
+start_pre() {
+	checkpath -d /var/lib/power-profiles-daemon
+}

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
new file mode 100644
index 000000000000..36656c234b6d
--- /dev/null
+++ b/sys-power/power-profiles-daemon/power-profiles-daemon-0.12-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit meson python-single-r1 systemd
+
+DESCRIPTION="Makes power profiles handling available over D-Bus"
+HOMEPAGE="https://gitlab.freedesktop.org/hadess/power-profiles-daemon/"
+SRC_URI="https://gitlab.freedesktop.org/hadess/${PN}/-/archive/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="gtk-doc test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="${PYTHON_DEPS}
+	$(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
+	dev-libs/glib:2
+	>=dev-libs/libgudev-234
+	>=sys-auth/polkit-0.114
+	sys-power/upower
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	gtk-doc? ( dev-util/gi-docgen )
+	test? (
+		dev-util/umockdev
+		$(python_gen_cond_dep '
+			dev-python/pygobject:3[${PYTHON_USEDEP}]
+			dev-python/python-dbusmock[${PYTHON_USEDEP}]
+		')
+	)
+"
+
+python_check_deps() {
+	if use test; then
+		python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" &&
+		python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]"
+	else
+		python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]"
+	fi
+}
+
+src_configure() {
+	local emesonargs=(
+		-Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
+		$(meson_use gtk-doc gtk_doc)
+		$(meson_use test tests)
+	)
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+	python_fix_shebang "${D}"/usr/bin/powerprofilesctl
+
+	newinitd "${FILESDIR}/power-profiles-daemon.initd" power-profiles-daemon
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		if systemd_is_booted; then
+			elog "You need to enable the service:"
+			elog "# systemctl enable ${PN}"
+		fi
+	fi
+}


                 reply	other threads:[~2023-03-19 16:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1679244992.40417f0c131cb66e15dc4442a3104a4cfd295a91.pacho@gentoo \
    --to=pacho@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox