summaryrefslogtreecommitdiff
path: root/app-laptop/tpacpi-bat
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-laptop/tpacpi-bat
reinit the tree, so we can have metadata
Diffstat (limited to 'app-laptop/tpacpi-bat')
-rw-r--r--app-laptop/tpacpi-bat/Manifest15
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.confd.015
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.confd.119
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.initd.178
-rw-r--r--app-laptop/tpacpi-bat/files/tpacpi-bat.initd.276
-rw-r--r--app-laptop/tpacpi-bat/metadata.xml11
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild33
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild33
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-3.0-r1.ebuild33
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-3.0.ebuild33
-rw-r--r--app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild33
11 files changed, 379 insertions, 0 deletions
diff --git a/app-laptop/tpacpi-bat/Manifest b/app-laptop/tpacpi-bat/Manifest
new file mode 100644
index 000000000000..4a4865de211c
--- /dev/null
+++ b/app-laptop/tpacpi-bat/Manifest
@@ -0,0 +1,15 @@
+AUX tpacpi-bat.confd.0 587 SHA256 ff7d489d67ea2a2d95850d53ddb8ecbc846dcc3ae6d5b8e2784aa05c15d79eef SHA512 a2131a32123e649cd5958aea67d4c96a9bd35ba19bc2c5eef794be7f7e386085e0eb825517783999d6da7abd025b004e357daa024f39d71ea6f653b4ed934271 WHIRLPOOL a42d7de2f4a86303663de2c602546e5e6422cb14aae13630fbfec664a476af61eff9b55d1e9857ec65e1e3230cc12433c031a3188098109af4a48985a47ce4e4
+AUX tpacpi-bat.confd.1 668 SHA256 23fbfd271bb0a30c621b620307222efc4eb51f74904f7bae75a9942fe9e899e5 SHA512 570824184f85e9f4b687e67131165671389b836d94f15edbd4bd14c77b0c6546c2991da25bc0172ccdee03cc8c0ad82c378e982e147334e9cb83334d0382038b WHIRLPOOL 7db522f8d08c99f68ba61d46144948b24db889882adf7bea8ccfadc14c1b21b8ce9d6a526a4c611df25e184dee28f3686ecf2eee70ac746916a0c137e7045d04
+AUX tpacpi-bat.initd.1 1498 SHA256 1479b2feb497c3ecbfb29108ac87f90f54852e35fef414d85937ed64defd4ec9 SHA512 1e06d2f4c4356f97c40752d532ea448db9ca39186028bddbe58125fce0e236ed3abd262621c16152b8c44ff24a160c62a51097a37c02dba191403ec71ee005ac WHIRLPOOL 1ca4668c75965029cd9b5b8d1e200a58453259d76916e0e8a2a739d61c090a8cc45023a6f8365b4250957bf0e3bd25141351c71385e758f2a65a124cbee53c5a
+AUX tpacpi-bat.initd.2 1488 SHA256 6340632c02ca80a8ab9200decaaa3bdccc81c4641a496c7007d08c2692252c0f SHA512 ccd84bc4cd44ed8a3b2c101501ae220d8add3b189f172e4ba5fe9532ba5a64a188b90054696cc60b7bc1b3d72f636649e4678c020c789933d0b4d25f6ffd386d WHIRLPOOL c9f5eaea7692b4cce06af82e8064b01afe8647e1cae30ba4c75fd877568e6abcd966a500e2bb99410c929bf7c5f03b8cf9b6adcccf3e1659a8d35c4b8a6c3d68
+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
+DIST tpacpi-bat-3.0.tar.gz 18137 SHA256 f9aa8be181df6a7d41eac6224abb6dadf1d147022449e9159c4aa09397b7a485 SHA512 2beab3e5495f028b53d673a4243a2128f4ff85e19e18ac7d53663a1d62e20b271442d6c2c8f19cb41d618ddf7ebb4d9b8390f7f185f77bdca33c69bb19463128 WHIRLPOOL 9329ea83fdd0913cc47446895e6ab385f09ca42e7a19533b5c7fa44cb62bebd07ba24f89b0deacc89d6b3aff3ff826f2a53f8d2e918f137d0f6215aa6eaa9198
+EBUILD tpacpi-bat-1.1-r1.ebuild 795 SHA256 5c5eba430d47eb0ebd06dda2067b866a860d048c6a8ab87077802ca16358db04 SHA512 a0e8169ed9db5d7949ca9a0f8a9076b65fafd20f290dcb93a236fbd25e58a64fcf866dd29a570a2e9662dbc38fe89d2abd1cbf4638e8e21cacf4e940fed06aef WHIRLPOOL fc46a86a5b99091071b7408c7262256569e1c9c636b7cbd030e5bcf8295ff401101fb22fa767ddafdae978c1612a00ca4bde617f5140e2aaf6788d233a46afa9
+EBUILD tpacpi-bat-2.1.ebuild 795 SHA256 5c5eba430d47eb0ebd06dda2067b866a860d048c6a8ab87077802ca16358db04 SHA512 a0e8169ed9db5d7949ca9a0f8a9076b65fafd20f290dcb93a236fbd25e58a64fcf866dd29a570a2e9662dbc38fe89d2abd1cbf4638e8e21cacf4e940fed06aef WHIRLPOOL fc46a86a5b99091071b7408c7262256569e1c9c636b7cbd030e5bcf8295ff401101fb22fa767ddafdae978c1612a00ca4bde617f5140e2aaf6788d233a46afa9
+EBUILD tpacpi-bat-3.0-r1.ebuild 788 SHA256 0706024a5d7b3a76f861d97a9ea28eb311a758bfb5820e22baf7539d4be67715 SHA512 615131330143d13acf30e82552f3addf2a596626be89dfda1bc25afca3c56df48741c501ccc9b40ff4493c24e009c139288dd415e20a0dd82b49c5e6f187f14d WHIRLPOOL 293075d20c4a088dfd35dbfaf756c3ab03e2e1437621acf981f3e89c49bc49bd6874c87b36faf841c276954093bbaa983ca58f8138e7b57dca9bae3550694e37
+EBUILD tpacpi-bat-3.0.ebuild 795 SHA256 5c5eba430d47eb0ebd06dda2067b866a860d048c6a8ab87077802ca16358db04 SHA512 a0e8169ed9db5d7949ca9a0f8a9076b65fafd20f290dcb93a236fbd25e58a64fcf866dd29a570a2e9662dbc38fe89d2abd1cbf4638e8e21cacf4e940fed06aef WHIRLPOOL fc46a86a5b99091071b7408c7262256569e1c9c636b7cbd030e5bcf8295ff401101fb22fa767ddafdae978c1612a00ca4bde617f5140e2aaf6788d233a46afa9
+EBUILD tpacpi-bat-9999.ebuild 789 SHA256 41c10a5388c594406e09d50568dfe83dbcbe6a76cd834dfe19e6a53e24a82a1c SHA512 c9dd392897b43155a1fc58a7a11f69e50856dd23b7810575ab21a6620cc6efc9bfbfeeda2a0d8ba05126ed18655eca4866b8296e696cd39ab7fdc82971f9ccd3 WHIRLPOOL 4a131a0004d390aaddb4fef4408854e07925d26132b9c9453a03dca03232c8a7f0a72f9292f8438c86e81b39b1305c839c82b41b7ae742edd564e58bcf5adc1c
+MISC ChangeLog 3555 SHA256 6192dbc1086269f73945754994044dddfd814f285b6be0d3e37f42bfb9caf803 SHA512 e8d37ce3698e5e1c507dedd69769054190f7f13bb4c44107525468604a5adafa97da156941c08a04bb9ecf6ea483b721e01073b9f2eb724e6ab21edca589d045 WHIRLPOOL 17be141073142c530264ccf832426c2eac6588ac8dcb6126ac48631f0252ab14757617e713a19bf5f1393790e77c7f91c0db0c54658a51673471cde0842eb1d1
+MISC ChangeLog-2015 1593 SHA256 f88474311ca487892f3c087caf697007a8e9ad3927b15e1ef4a6ed8b75de3fe0 SHA512 fd577eca1681add680549dece50fb6b8731c84b1e9b9cc107b0447ae53e2484069a573ad2bd0754e838a64f707faf92dc918fd0e0f3293bad6861585468dda11 WHIRLPOOL 9df590046fdb80bff8c50d5efd9fe86260b5be0e8be8cd0ec0df383e7d8094eb85e71342f5f9f15e56058b7cd0766607cf1f39bb119e03ed614bf38f441b1e7b
+MISC metadata.xml 338 SHA256 81a7de6a48debfe0ff7eca8e154378672e80098758e8c726f785309c2779107b SHA512 e6cb10546e9a71a1c5fbcea24b4ca97c5eed95e4553d3cd4bbedbf1180da9533a0e570fa674ccf12574825cb369d6197e51969361945958f4322d6cb91e25714 WHIRLPOOL 24da06fd1a79253203d9e0d1dd532b21c738bfc60d9617a5a7075453bfd9996044e5d8707a4d440a4b6d1e66d8fc5afe71dcd16f4561a8ccd627a94782673ffb
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.confd.1 b/app-laptop/tpacpi-bat/files/tpacpi-bat.confd.1
new file mode 100644
index 000000000000..f1faf1d7fd47
--- /dev/null
+++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.confd.1
@@ -0,0 +1,19 @@
+# /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
+
+# list of batteries the script should manage
+# for example: BATS="1 2"
+BATS="1"
+
+# 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..d9f5de7fb3dd
--- /dev/null
+++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.1
@@ -0,0 +1,78 @@
+#!/sbin/openrc-run
+# Copyright (C) 2012-2016 Christoph Junghans <junghans@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/files/tpacpi-bat.initd.2 b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.2
new file mode 100644
index 000000000000..7c92b739193d
--- /dev/null
+++ b/app-laptop/tpacpi-bat/files/tpacpi-bat.initd.2
@@ -0,0 +1,76 @@
+#!/sbin/openrc-run
+# Copyright (C) 2012-2016 Christoph Junghans <junghans@gentoo.org>
+#
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="low high info"
+
+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..a50d8d26b076
--- /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 type="person">
+ <email>junghans@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..1560013b9e10
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-1.1-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils systemd
+
+if [ "${PV}" = "9999" ]; then
+ inherit git-2
+ EGIT_REPO_URI="https://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, 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..1560013b9e10
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-2.1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils systemd
+
+if [ "${PV}" = "9999" ]; then
+ inherit git-2
+ EGIT_REPO_URI="https://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, 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-3.0-r1.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-3.0-r1.ebuild
new file mode 100644
index 000000000000..4a1fac9d20b9
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-3.0-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd
+
+if [ "${PV}" = "9999" ]; then
+ inherit git-2
+ EGIT_REPO_URI="https://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, 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.2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd.1 ${PN}
+ systemd_newunit tpacpi.service ${PN}.service
+}
diff --git a/app-laptop/tpacpi-bat/tpacpi-bat-3.0.ebuild b/app-laptop/tpacpi-bat/tpacpi-bat-3.0.ebuild
new file mode 100644
index 000000000000..1560013b9e10
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-3.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils systemd
+
+if [ "${PV}" = "9999" ]; then
+ inherit git-2
+ EGIT_REPO_URI="https://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, 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..c3feb204bff7
--- /dev/null
+++ b/app-laptop/tpacpi-bat/tpacpi-bat-9999.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd
+
+if [ "${PV}" = "9999" ]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://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, 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.2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd.1 ${PN}
+ systemd_newunit tpacpi.service ${PN}.service
+}