diff options
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | tlp-arch.patch | 47 | ||||
-rw-r--r-- | tlp-pmu.install | 33 |
4 files changed, 166 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2a2a9ed9bd47 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = tlp-pmu + pkgdesc = Advanced Power Management for Linux, with pm-utils support + pkgver = 0.7 + pkgrel = 2.2 + url = http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html + install = tlp-pmu.install + arch = any + license = GPL2 + license = GPL3 + depends = hdparm + depends = iw + depends = pciutils + depends = rfkill + depends = usbutils + depends = util-linux + depends = pm-utils + optdepends = acpi_call: Sandy Bridge and newer ThinkPad battery functions + optdepends = ethtool: Disable Wake On Lan + optdepends = lsb-release: Display LSB release version in tlp-stat + optdepends = smartmontools: Display S.M.A.R.T. data in tlp-stat + optdepends = tp_smapi: ThinkPad battery functions + optdepends = x86_energy_perf_policy: Set energy versus performance policy on x86 processors + provides = tlp + conflicts = laptop-mode-tools + conflicts = tlp + backup = etc/default/tlp + source = https://github.com/linrunner/TLP/archive/0.7.tar.gz + source = tlp-arch.patch + sha256sums = bd313f478f897a658f2ca7db9665b8ce6796431b952f7df9aa80e59072cea4ea + sha256sums = ba49a3cb8ea97c2fb06d3e17b006b9b1710b3d625db7993c2f6ebd10fa948298 + +pkgname = tlp-pmu + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6bb9271216de --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# $Id$ +# Contributor: Maxime Gauduin <alucryd@archlinux.org> +# Contributor: Marc Schulte <bomba@nerdstube.de> +# Maintainer: Aaditya Bagga <aaditya_gnulinux@zoho.com> + +pkgname=('tlp-pmu') +_pkgname=tlp +pkgver=0.7 +pkgrel=2.2 +pkgdesc='Advanced Power Management for Linux, with pm-utils support' +depends=('hdparm' 'iw' 'pciutils' 'rfkill' 'usbutils' 'util-linux' 'pm-utils') +optdepends=('acpi_call: Sandy Bridge and newer ThinkPad battery functions' + 'ethtool: Disable Wake On Lan' + 'lsb-release: Display LSB release version in tlp-stat' + 'smartmontools: Display S.M.A.R.T. data in tlp-stat' + 'tp_smapi: ThinkPad battery functions' + 'x86_energy_perf_policy: Set energy versus performance policy on x86 processors') +conflicts=('laptop-mode-tools' 'tlp') +provides=($_pkgname) +backup=('etc/default/tlp') +install=("$pkgname.install") +arch=('any') +url='http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html' +license=('GPL2' 'GPL3') +source=("https://github.com/linrunner/TLP/archive/${pkgver}.tar.gz" + 'tlp-arch.patch') +sha256sums=('bd313f478f897a658f2ca7db9665b8ce6796431b952f7df9aa80e59072cea4ea' + 'ba49a3cb8ea97c2fb06d3e17b006b9b1710b3d625db7993c2f6ebd10fa948298') + +prepare() { + cd TLP-${pkgver} + + patch -Np1 -i ../tlp-arch.patch +} + +package() { + + cd TLP-${pkgver} + + export TLP_SBIN='/usr/bin' + export TLP_ULIB='/usr/lib/udev' + export TLP_NO_INIT='0' + export TLP_NO_PMUTILS='0' + export TLP_WITH_SYSTEMD='0' + + make DESTDIR="${pkgdir}" install-tlp + + install -dm 755 "${pkgdir}"/usr/share/man/man{1,8} + install -m 644 man/*.1 "${pkgdir}"/usr/share/man/man1/ + install -m 644 man/*.8 "${pkgdir}"/usr/share/man/man8/ +} + +# vim: ts=2 sw=2 et: diff --git a/tlp-arch.patch b/tlp-arch.patch new file mode 100644 index 000000000000..6f98fc863314 --- /dev/null +++ b/tlp-arch.patch @@ -0,0 +1,47 @@ +diff -rupN TLP-0.7.orig/Makefile TLP-0.7/Makefile +--- TLP-0.7.orig/Makefile 2015-02-24 10:41:23.600434433 +0100 ++++ TLP-0.7/Makefile 2015-02-24 10:45:59.877307094 +0100 +@@ -67,7 +67,7 @@ endif + install -D -m 644 thinkpad-radiosw $(_ACPI)/events/thinkpad-radiosw + install -m 755 thinkpad-radiosw.sh $(_ACPI)/ + ifneq ($(TLP_NO_BASHCOMP),1) +- install -D -m 644 tlp.bash_completion $(DESTDIR)/etc/bash_completion.d/tlp ++ install -D -m 644 tlp.bash_completion $(DESTDIR)/usr/share/bash-completion/completions/tlp + endif + + install-rdw: +@@ -102,7 +102,7 @@ uninstall-tlp: + rm -f $(_PLIB)/sleep.d/49tlp + rm $(_ACPI)/events/thinkpad-radiosw + rm $(_ACPI)/thinkpad-radiosw.sh +- rm -f $(DESTDIR)/etc/bash_completion.d/tlp ++ rm -f $(DESTDIR)/usr/share/bash-completion/completions/tlp + + uninstall-rdw: + # Package tlp-rdw +diff -rupN TLP-0.7.orig/tlp.rules TLP-0.7/tlp.rules +--- TLP-0.7.orig/tlp.rules 2015-02-24 10:41:23.600434433 +0100 ++++ TLP-0.7/tlp.rules 2015-02-24 10:41:35.026696729 +0100 +@@ -4,7 +4,7 @@ + # This software is licensed under the GPL v2 or later. + + # handle change of power source ac/bat +-ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/sbin/tlp auto" ++ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/tlp auto" + + # handle added usb devices (exclude subdevices via DRIVER=="USB") +-ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ENV{DEVTYPE}=="usb_device", RUN+="/lib/udev/tlp-usb-udev %p" ++ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/udev/tlp-usb-udev %p" +diff -rupN TLP-0.7.orig/tlp.service TLP-0.7/tlp.service +--- TLP-0.7/tlp.init 2015-02-01 03:02:48.000000000 +0530 ++++ TLP-0.7/tlp.init.new 2015-02-25 10:49:46.079992409 +0530 +@@ -17,7 +17,7 @@ + +-. /lib/lsb/init-functions ++#. /lib/lsb/init-functions + +-TLP=/usr/sbin/tlp ++TLP=/usr/bin/tlp + [ -x $TLP ] || exit 0 + + case "$1" in diff --git a/tlp-pmu.install b/tlp-pmu.install new file mode 100644 index 000000000000..c796c0270b56 --- /dev/null +++ b/tlp-pmu.install @@ -0,0 +1,33 @@ +post_install() { +# Mask conflicting pm-utils hooks +if [ -d /usr/lib/pm-utils/power.d ] && [ -d /etc/pm/power.d ]; then + for i in $(find /usr/lib/pm-utils/power.d -type f -printf "%f\n"); do + if [ -x /usr/lib/pm-utils/power.d/$i ]; then + # Executable hook in /usr/lib/pm-utils/power.d/ exists + if [ -f /etc/pm/power.d/$i ]; then + # Exclude symlinks to tlp-nop + if [ "$( readlink -s /etc/pm/power.d/$i )" != "/usr/lib/tlp-pm/tlp-nop" ]; then + # Move aside superseding hook of same name in /etc/pm/power.d/ + mv -n /etc/pm/power.d/$i /etc/pm/power.d/$i.tlp-save + fi + fi + # Make a soft link to tlp-nop in /etc/pm/power.d/ + # to disable corresponding hook /usr/lib/pm-utils/power.d/ + ln -sf /usr/lib/tlp-pm/tlp-nop /etc/pm/power.d/$i + fi + done +fi +} + +post_upgrade() { + post_install +} + +post_remove() { +# Unmask pm-utils hooks +for i in $(find /etc/pm/power.d -printf "%f\n"); do + if [ "$( readlink /etc/pm/power.d/$i )" = "/usr/lib/tlp-pm/tlp-nop" ]; then + rm /etc/pm/power.d/$i + fi +done +} |