summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2012-12-09 21:29:30 +0000
committerChristoph Junghans <ottxor@gentoo.org>2012-12-09 21:29:30 +0000
commit640466a5adf761f2b2ecf3bc094254186f01e2f2 (patch)
tree40d490d0b50a3e757216092a1ed4220b45cd55f1 /app-laptop/tpacpi-bat
parentVersion bump. (diff)
downloadgentoo-2-640466a5adf761f2b2ecf3bc094254186f01e2f2.tar.gz
gentoo-2-640466a5adf761f2b2ecf3bc094254186f01e2f2.tar.bz2
gentoo-2-640466a5adf761f2b2ecf3bc094254186f01e2f2.zip
initial commit
(Portage version: 2.2.0_alpha145/cvs/Linux x86_64, signed Manifest commit with key C2000586)
Diffstat (limited to 'app-laptop/tpacpi-bat')
-rw-r--r--app-laptop/tpacpi-bat/ChangeLog9
-rw-r--r--app-laptop/tpacpi-bat/Manifest4
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.confd.015
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.initd.078
-rw-r--r--app-laptop/tpacpi-bat/metadata.xml11
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild29
6 files changed, 146 insertions, 0 deletions
diff --git a/app-laptop/tpacpi-bat/ChangeLog b/app-laptop/tpacpi-bat/ChangeLog
new file mode 100644
index 000000000000..10641b62bce2
--- /dev/null
+++ b/app-laptop/tpacpi-bat/ChangeLog
@@ -0,0 +1,9 @@
+# ChangeLog for app-laptop/tpacpi-bat
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/ChangeLog,v 1.1 2012/12/09 21:29:30 ottxor Exp $
+
+*tpacpi-bat-9999 (09 Dec 2012)
+
+ 09 Dec 2012; Christoph Junghans <ottxor@gentoo.org> +files/tpacpi-bat.confd.0,
+ +files/tpacpi-bat.initd.0, +metadata.xml, +tpacpi-bat-9999.ebuild:
+ initial commit
diff --git a/app-laptop/tpacpi-bat/Manifest b/app-laptop/tpacpi-bat/Manifest
new file mode 100644
index 000000000000..9f7fe0ead84e
--- /dev/null
+++ b/app-laptop/tpacpi-bat/Manifest
@@ -0,0 +1,4 @@
+AUX tpacpi-bat.confd.0 571 SHA256 b7e964375840a879da3f415c99c01ea95d0459d1c550d55ee82e788a990494e7 SHA512 8233ccdb27c7fbe3113f7e1ba9b7ce54fddfc565486c7504161ddf6df33d94f576e6f8eaedb329ace7bf4e300c3f5531c43d90a1b864995ba32f5003dd252b54 WHIRLPOOL 941d680a0c058527031fbc36dc3c1bf6055ae6a2dc5a6862063da5c1589a7c070ae361e6e1710ae84675b212d5db8830c5fb83075f7b42b78ccb9af6b15ec896
+AUX tpacpi-bat.initd.0 1502 SHA256 cc0cec0230adb113eb15d5b23f5a958fdcccec02e1a11f97b31586608408f3ea SHA512 5381929d738ae01c6d6080940fae3356b29931f8e89e541682b1be9f32ac9d38427e3e8d4706b09b4f3369336232f838acc9dc9731d60d1c88b94c8d827bb4b0 WHIRLPOOL 44771784c9b2ee513629571c0bd3c0915d6b46f8c7057399dadeecd5969dc4981f9334a3ea1aa9373fde5a82213aacc9946e456627975293c25c238720b99d06
+EBUILD tpacpi-bat-9999.ebuild 737 SHA256 81f2e5d73c8f4c898e9575ce9f43651a5426d208cc29471983236b442fe3b479 SHA512 38e52f230d05035ed01cd8a0ba96413003abd4141d82b5fe49be1593bac86289b956d86becf36e1e5982c090ceeeafc7c1a35921d291f56bdaea33523c8e7656 WHIRLPOOL 3aa5d81ea04b18cbc998d6adcde892bb54a499169a9dbc2a7837e411a879a3755d3f2faeadaaa3dba2390376ca2a662dc575734a03a7ea0800c21e06f124d72c
+MISC metadata.xml 329 SHA256 5001b4ef8f5e92a525fcecb7313381be46e9dee384439ee30bc4ca839481603b SHA512 c39feb4f5f0e04aa635b3a6e5b52576f7932c947bf372fadda2c4232a2a5a2a093fa56f8f59e6e64cd30a8a079cab401db02852b72ad47192749cd01a551b15f WHIRLPOOL 89ca5c5158a8cf255d26a7edc41ca2b21f1bf090ef516af546c5a673571dbb2338b21f3f7fb520c509d5c7b5cef6ae8f0d6aae6da220cc3c0e0be590c0b0cf20
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..c33ec00794a7
--- /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="100"
diff --git a/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.0 b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.0
new file mode 100644
index 000000000000..8582fe8a939d
--- /dev/null
+++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.0
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Copyright (C) 2012 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 startChargeThreshold ${bat} ${tstart}
+ /usr/bin/tpacpi-bat stopChargeThreshold ${bat} ${tstop}
+ eend $?
+ done
+}
+
+info() {
+ local tstart
+ local tstop
+ local bat
+
+ require_started
+
+ for bat in ${BATS}; do
+ tstart=$(/usr/bin/tpacpi-bat startChargeThreshold ${bat})
+ tstop=$(/usr/bin/tpacpi-bat stopChargeThreshold ${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..b4e68347fc62
--- /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/tpbattstat-applet</remote-id>
+ </upstream>
+</pkgmetadata>
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..e651dfd572f0
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild,v 1.1 2012/12/09 21:29:30 ottxor Exp $
+
+EAPI=5
+
+inherit eutils git-2
+
+DESCRIPTION="Control battery thresholds of recent ThinkPads, which are not supported by tp_smapi"
+HOMEPAGE="https://github.com/teleshoes/tpbattstat-applet"
+SRC_URI=""
+EGIT_REPO_URI="git://github.com/teleshoes/tpbattstat-applet.git"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS=""
+
+IUSE=""
+
+DEPEND=""
+RDEPEND="sys-power/acpi_call
+ dev-lang/perl"
+
+src_install() {
+ dodoc README.md AUTHORS
+ dobin tpacpi-bat
+ newinitd "${FILESDIR}"/${PN}.initd.0 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd.0 ${PN}
+}