diff options
Diffstat (limited to 'app-laptop/tpacpi-bat')
-rw-r--r-- | app-laptop/tpacpi-bat/Manifest | 2 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/files/tpacpi-bat.confd.0 | 15 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1 | 78 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/metadata.xml | 11 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild | 34 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild | 34 | ||||
-rw-r--r-- | app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild | 34 |
7 files changed, 208 insertions, 0 deletions
diff --git a/app-laptop/tpacpi-bat/Manifest b/app-laptop/tpacpi-bat/Manifest new file mode 100644 index 000000000000..2f013be7fce2 --- /dev/null +++ b/app-laptop/tpacpi-bat/Manifest @@ -0,0 +1,2 @@ +DIST tpacpi-bat-1.1.tar.gz 17781 SHA256 99bfeae60c672d981ea70a98470b8c2a1a9da52da0fce7f669270f216d2230a3 SHA512 7b8838e6db7f98cd5bb674a99dbb880ba6574529de68d97ce704bf225ba416183971aae3c2dd623bc8750767c54a2a52cd0b525bce70640ecf0b307fdba03821 WHIRLPOOL 3a057e57da77f997ed27f679c2503a139d760949027c02aa5dd5bef71579d525acc866655e0008b59ef6ae8b0c567f7de627838baac5c7ed2969523a7355a879 +DIST tpacpi-bat-2.1.tar.gz 17753 SHA256 0a4b273215ef814a1932b0c8ff1571c6e45eecb3b28d8462deab460f0bcdc337 SHA512 7ed4974d84c3f1ddc9fd5cd6d7f103a11e2f808a223692749e3ae0ec2e888b62083d577214e27634cd76e9b616a6b8d5cb5474ddb64f73972d08641051c5c6f8 WHIRLPOOL 303c28a287b657514e985227b8f4c9c3d044fdf46a7dca0e52ce3ab7b6852a65aa46a8805cf6a945b3936432d3c3e43855d0d88c7549b05e95d271e8c605b1b7 diff --git a/app-laptop/tpacpi-bat/files/tpacpi-bat.confd.0 b/app-laptop/tpacpi-bat/files/tpacpi-bat.confd.0 new file mode 100644 index 000000000000..94da0a3eb12a --- /dev/null +++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.confd.0 @@ -0,0 +1,15 @@ +# /etc/conf.d/tpacpi-bat: config file for /etc/init.d/tpacpi-bat + +# use '/etc/init.d/tpacpi-bat info' at any time to check the thresholds +# currently used by the driver + +# default thresholds for '/etc/init.d/tpacpi-bat start' +TPACPI_BAT_THRESH_START="30" +TPACPI_BAT_THRESH_STOP="85" +# values to be used for '/etc/init.d/tpacpi-bat low' +TPACPI_BAT_LOW_THRESH_START="${TPACPI_BAT_THRESH_START}" +TPACPI_BAT_LOW_THRESH_STOP="${TPACPI_BAT_THRESH_STOP}" + +# values to be used for '/etc/init.d/tpacpi-bat high' +TPACPI_BAT_HIGH_THRESH_START="95" +TPACPI_BAT_HIGH_THRESH_STOP="99" #see bug #485526 diff --git a/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1 b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1 new file mode 100644 index 000000000000..a1900794daab --- /dev/null +++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1 @@ -0,0 +1,78 @@ +#!/sbin/runscript +# Copyright (C) 2012-2013 Christoph Junghans <ottxor@gentoo.org> +# +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="low high info" + +BATS="1" + +depend() { + after modules +} + +start() { + local state1 + + ebegin "Making sure that module 'acpi_call' is loaded" + modprobe acpi_call + state1=$? + eend ${state1} + + [ "${state1}" -ne "0" ] && return 1 + + ebegin "Starting ${SVCNAME}" + set_all ${TPACPI_BAT_THRESH_START} ${TPACPI_BAT_THRESH_STOP} + eend $? +} + +stop() { + einfo "Nothing required to be done to stop ${SVCNAME}" +} + +require_started() { + if ! service_started; then + "${RC_SERVICE}" start || return $? + fi +} + +high() { + require_started + + einfo "Switching ${SVCNAME} to high thesholds" + set_all ${TPACPI_BAT_HIGH_THRESH_START} ${TPACPI_BAT_HIGH_THRESH_STOP} +} + +low() { + require_started + + einfo "Switching ${SVCNAME} to low thesholds" + set_all ${TPACPI_BAT_LOW_THRESH_START} ${TPACPI_BAT_LOW_THRESH_STOP} +} + +set_all() { + local tstart=$1 + local tstop=$2 + local bat + + for bat in ${BATS}; do + ebegin " setting thresholds for ${bat}: $tstart $tstop" + /usr/bin/tpacpi-bat -s startThreshold ${bat} ${tstart} + /usr/bin/tpacpi-bat -s stopThreshold ${bat} ${tstop} + eend $? + done +} + +info() { + local tstart + local tstop + local bat + + require_started + + for bat in ${BATS}; do + tstart=$(/usr/bin/tpacpi-bat -g startThreshold ${bat}) + tstop=$(/usr/bin/tpacpi-bat -g stopThreshold ${bat}) + einfo "Battery ${bat}: ${tstart} ${tstop}" + done +} diff --git a/app-laptop/tpacpi-bat/metadata.xml b/app-laptop/tpacpi-bat/metadata.xml new file mode 100644 index 000000000000..730a6cdcb702 --- /dev/null +++ b/app-laptop/tpacpi-bat/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>ottxor@gentoo.org</email> + <name>Christoph Junghans</name> + </maintainer> + <upstream> + <remote-id type="github">teleshoes/tpacpi-bat</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild new file mode 100644 index 000000000000..cf44a50d0420 --- /dev/null +++ b/app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils systemd + +if [ "${PV}" = "9999" ]; then + inherit git-2 + EGIT_REPO_URI="git://github.com/teleshoes/tpacpi-bat.git http://github.com/teleshoes/tpacpi-bat.git" + KEYWORDS="" +else + SRC_URI="https://github.com/teleshoes/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi +DESCRIPTION="Control battery thresholds of recent ThinkPads, which are not supported by tp_smapi" +HOMEPAGE="https://github.com/teleshoes/tpacpi-bat" + +LICENSE="GPL-3" +SLOT="0" +IUSE="" + +DEPEND="" +RDEPEND="sys-power/acpi_call + dev-lang/perl" + +src_install() { + dodoc README battery_asl + dobin tpacpi-bat + newinitd "${FILESDIR}"/${PN}.initd.1 ${PN} + newconfd "${FILESDIR}"/${PN}.confd.0 ${PN} + systemd_newunit tpacpi.service ${PN}.service +} diff --git a/app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild new file mode 100644 index 000000000000..3db6351dfaad --- /dev/null +++ b/app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils systemd + +if [ "${PV}" = "9999" ]; then + inherit git-2 + EGIT_REPO_URI="git://github.com/teleshoes/tpacpi-bat.git http://github.com/teleshoes/tpacpi-bat.git" + KEYWORDS="" +else + SRC_URI="https://github.com/teleshoes/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi +DESCRIPTION="Control battery thresholds of recent ThinkPads, which are not supported by tp_smapi" +HOMEPAGE="https://github.com/teleshoes/tpacpi-bat" + +LICENSE="GPL-3" +SLOT="0" +IUSE="" + +DEPEND="" +RDEPEND="sys-power/acpi_call + dev-lang/perl" + +src_install() { + dodoc README battery_asl + dobin tpacpi-bat + newinitd "${FILESDIR}"/${PN}.initd.1 ${PN} + newconfd "${FILESDIR}"/${PN}.confd.0 ${PN} + systemd_newunit tpacpi.service ${PN}.service +} diff --git a/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild new file mode 100644 index 000000000000..cf44a50d0420 --- /dev/null +++ b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils systemd + +if [ "${PV}" = "9999" ]; then + inherit git-2 + EGIT_REPO_URI="git://github.com/teleshoes/tpacpi-bat.git http://github.com/teleshoes/tpacpi-bat.git" + KEYWORDS="" +else + SRC_URI="https://github.com/teleshoes/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi +DESCRIPTION="Control battery thresholds of recent ThinkPads, which are not supported by tp_smapi" +HOMEPAGE="https://github.com/teleshoes/tpacpi-bat" + +LICENSE="GPL-3" +SLOT="0" +IUSE="" + +DEPEND="" +RDEPEND="sys-power/acpi_call + dev-lang/perl" + +src_install() { + dodoc README battery_asl + dobin tpacpi-bat + newinitd "${FILESDIR}"/${PN}.initd.1 ${PN} + newconfd "${FILESDIR}"/${PN}.confd.0 ${PN} + systemd_newunit tpacpi.service ${PN}.service +} |