From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 209A7158090 for ; Wed, 4 May 2022 22:03:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 298B9E07C7; Wed, 4 May 2022 22:03:29 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A6F0E07C7 for ; Wed, 4 May 2022 22:03:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 93660341B67 for ; Wed, 4 May 2022 22:03:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0614E447 for ; Wed, 4 May 2022 22:03:26 +0000 (UTC) From: "Duje Mihanović" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Duje Mihanović" Message-ID: <1651701788.87d38d871ba96affad6d8c34b05efe46fdc745fb.duje.mihanovic@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: sys-power/tlp/files/, sys-power/tlp/ X-VCS-Repository: repo/proj/guru X-VCS-Files: sys-power/tlp/Manifest sys-power/tlp/files/tlp-1.5.0-Makefile.patch sys-power/tlp/files/tlp.init sys-power/tlp/metadata.xml sys-power/tlp/tlp-1.5.0.ebuild X-VCS-Directories: sys-power/tlp/ sys-power/tlp/files/ X-VCS-Committer: duje.mihanovic X-VCS-Committer-Name: Duje Mihanović X-VCS-Revision: 87d38d871ba96affad6d8c34b05efe46fdc745fb X-VCS-Branch: dev Date: Wed, 4 May 2022 22:03:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4a4a3afb-e571-41b3-b882-0434e363ef09 X-Archives-Hash: 76cd7c32f765dbe70a9afbc81f39b08b commit: 87d38d871ba96affad6d8c34b05efe46fdc745fb Author: Duje Mihanović skole hr> AuthorDate: Wed May 4 22:03:08 2022 +0000 Commit: Duje Mihanović skole hr> CommitDate: Wed May 4 22:03:08 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=87d38d87 sys-power/tlp: initial import Signed-off-by: Duje Mihanović skole.hr> sys-power/tlp/Manifest | 1 + sys-power/tlp/files/tlp-1.5.0-Makefile.patch | 18 +++++++++ sys-power/tlp/files/tlp.init | 28 +++++++++++++ sys-power/tlp/metadata.xml | 8 ++++ sys-power/tlp/tlp-1.5.0.ebuild | 59 ++++++++++++++++++++++++++++ 5 files changed, 114 insertions(+) diff --git a/sys-power/tlp/Manifest b/sys-power/tlp/Manifest new file mode 100644 index 000000000..5cddbd3ad --- /dev/null +++ b/sys-power/tlp/Manifest @@ -0,0 +1 @@ +DIST tlp-1.5.0.tar.gz 126447 BLAKE2B cdd2a5d094d1146a534de07cc646fd428a97f8d40c3d4ed5ec0522848ebe3a4182e36617854feeab7fa8923f7e7ef6797623a09609fdfa2a2b5dda321b188b31 SHA512 93be83f276b902467049160c20a546cdf2f0ec221274bbb4761bf89a8da09f10a494ce2f36379ef9be48ca2e7325de8e582f5dbb823e2ddd339366bae1228122 diff --git a/sys-power/tlp/files/tlp-1.5.0-Makefile.patch b/sys-power/tlp/files/tlp-1.5.0-Makefile.patch new file mode 100644 index 000000000..58667ee21 --- /dev/null +++ b/sys-power/tlp/files/tlp-1.5.0-Makefile.patch @@ -0,0 +1,18 @@ +diff --git a/Makefile b/Makefile +index b81451c..d154b6b 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,10 +14,10 @@ TLP_CONFDIR ?= /etc/tlp.d + TLP_CONFDEF ?= /usr/share/tlp/defaults.conf + TLP_CONFREN ?= /usr/share/tlp/rename.conf + TLP_CONF ?= /etc/default/tlp +-TLP_SYSD ?= /lib/systemd/system +-TLP_SDSL ?= /lib/systemd/system-sleep ++TLP_SYSD ?= /@LIBDIR@/systemd/system ++TLP_SDSL ?= /@LIBDIR@/systemd/system-sleep + TLP_SYSV ?= /etc/init.d +-TLP_ELOD ?= /lib/elogind/system-sleep ++TLP_ELOD ?= /@LIBDIR@/elogind/system-sleep + TLP_SHCPL ?= /usr/share/bash-completion/completions + TLP_MAN ?= /usr/share/man + TLP_META ?= /usr/share/metainfo diff --git a/sys-power/tlp/files/tlp.init b/sys-power/tlp/files/tlp.init new file mode 100644 index 000000000..f50de9029 --- /dev/null +++ b/sys-power/tlp/files/tlp.init @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +command=/usr/sbin/tlp +name="TLP" +extra_started_commands="reload stat" + +depend() { + need udev +} + +start() { + ebegin "Starting tlp..." + $command init start + eend $? +} + +reload() { + ebegin "Reloading tlp's configuration..." + $command start + eend $? +} + +stop() { + elog "Reboot to stop tlp." +} + +stat() { + /usr/bin/tlp-stat +} diff --git a/sys-power/tlp/metadata.xml b/sys-power/tlp/metadata.xml new file mode 100644 index 000000000..62988a0d4 --- /dev/null +++ b/sys-power/tlp/metadata.xml @@ -0,0 +1,8 @@ + + + + + duje.mihanovic@skole.hr + Duje Mihanović + + diff --git a/sys-power/tlp/tlp-1.5.0.ebuild b/sys-power/tlp/tlp-1.5.0.ebuild new file mode 100644 index 000000000..624b437c5 --- /dev/null +++ b/sys-power/tlp/tlp-1.5.0.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit udev + +DESCRIPTION="Optimize laptop battery life" +HOMEPAGE="https://linrunner.de/tlp/" +SRC_URI="https://github.com/linrunner/TLP/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/TLP-${PV}" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="bash-completion elogind systemd" +RESTRICT="mirror" +RDEPEND="virtual/udev + bash-completion? ( app-shells/bash app-shells/bash-completion ) + elogind? ( sys-auth/elogind ) + systemd? ( sys-apps/systemd )" +DEPEND="${RDEPEND}" +REQUIRED_USE="?? ( elogind systemd )" +PATCHES="${FILESDIR}/${PN}-1.5.0-Makefile.patch" +CONFIG_PROTECT="/etc/tlp.conf /etc/tlp.d" + +src_prepare() { + default + sed -i "s/@LIBDIR@/$(get_libdir)/g" "${S}/Makefile" +} + +src_compile() { + emake +} + +src_install() { + if use bash-completion; then export bashcomp=0; else export bashcomp=1; fi + if use elogind; then export elogind=1; else export elogind=0; fi + if use systemd; then export systemd=1; else export systemd=0; fi + + emake \ + DESTDIR="${D}" \ + TLP_NO_INIT=1 \ + TLP_NO_BASHCOMP=$bashcomp \ + TLP_WITH_ELOGIND=$elogind \ + TLP_WITH_SYSTEMD=$systemd \ + install install-man + + chmod 444 "${D}/usr/share/tlp/defaults.conf" # manpage says this file should not be edited + newinitd "${FILESDIR}/tlp.init" tlp + keepdir "/var/lib/tlp" # created by Makefile, probably important +} + +pkg_postinst() { + udev_reload + + elog "Consider installing these optional dependencies:" + elog "- sys-apps/ethtool to allow disabling WoL" + elog "- sys-apps/smartmontools for disk drive health info in tlp-stat" +}