summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-power/tlp/Manifest1
-rw-r--r--sys-power/tlp/tlp-1.6.0.ebuild48
2 files changed, 49 insertions, 0 deletions
diff --git a/sys-power/tlp/Manifest b/sys-power/tlp/Manifest
index 5cddbd3add64..e6512c67dc16 100644
--- a/sys-power/tlp/Manifest
+++ b/sys-power/tlp/Manifest
@@ -1 +1,2 @@
DIST tlp-1.5.0.tar.gz 126447 BLAKE2B cdd2a5d094d1146a534de07cc646fd428a97f8d40c3d4ed5ec0522848ebe3a4182e36617854feeab7fa8923f7e7ef6797623a09609fdfa2a2b5dda321b188b31 SHA512 93be83f276b902467049160c20a546cdf2f0ec221274bbb4761bf89a8da09f10a494ce2f36379ef9be48ca2e7325de8e582f5dbb823e2ddd339366bae1228122
+DIST tlp-1.6.0.tar.gz 143444 BLAKE2B 71e43312583eeb644ffc7daedef1b100be47b44f0e96160f5fe08e3aa0c33958200b8a652e4a3254af828f2e929ba033a0562595e93911dcef460a22fc8674c5 SHA512 66c8fd736912771718da44e2117cfc51ab8ba8c76607cb9de8facbe73a648832a50ac7f00055fa2b315c71ad58762961851d7ccb96b7d8c6451529a7868045db
diff --git a/sys-power/tlp/tlp-1.6.0.ebuild b/sys-power/tlp/tlp-1.6.0.ebuild
new file mode 100644
index 000000000000..b0bbf7d60684
--- /dev/null
+++ b/sys-power/tlp/tlp-1.6.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit udev optfeature
+
+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"
+
+# It's uncertain if elogind/systemd is actually required, however, without the sleep
+# hooks working, which require one of them, it doesn't seem like this app is very useful.
+RDEPEND="
+ dev-lang/perl
+ virtual/udev
+ || ( sys-auth/elogind sys-apps/systemd )
+"
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ TLP_NO_INIT=1 \
+ TLP_ELOD=/$(get_libdir)/elogind/system-sleep \
+ TLP_WITH_ELOGIND=1 \
+ TLP_WITH_SYSTEMD=1 \
+ install install-man
+
+ fperms 444 /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
+
+ optfeature "disable Wake-on-LAN" sys-apps/ethtool
+ optfeature "see disk drive health info in tlp-stat" sys-apps/smartmontools
+}
+
+pkg_postrm() {
+ udev_reload
+}