aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tlp
diff options
context:
space:
mode:
authorIvan Tham <pickfire@riseup.net>2017-03-16 19:22:56 +0800
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-16 15:33:51 +0000
commitc860144b5b79ea667fbedcc34a800637b0339b88 (patch)
treeeab538a28476701a45f79fa4ae8568a936baa2ab /testing/tlp
parent7da4e0efc8372ec248d94b64225da8b4ecbde7ae (diff)
downloadaports-c860144b5b79ea667fbedcc34a800637b0339b88.tar.bz2
aports-c860144b5b79ea667fbedcc34a800637b0339b88.tar.xz
testing/tlp: new aport
http://linrunner.de/en/tlp/tlp.html Linux Advanced Power Management
Diffstat (limited to 'testing/tlp')
-rw-r--r--testing/tlp/APKBUILD49
-rwxr-xr-xtesting/tlp/tlp.initd24
2 files changed, 73 insertions, 0 deletions
diff --git a/testing/tlp/APKBUILD b/testing/tlp/APKBUILD
new file mode 100644
index 0000000000..1202fc63e1
--- /dev/null
+++ b/testing/tlp/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Ivan Tham <pickfire@riseup.net>
+# Maintainer: Ivan Tham <pickfire@riseup.net>
+pkgname=tlp
+_pkgname=TLP
+pkgver=0.9
+pkgrel=0
+pkgdesc="Linux Advanced Power Management"
+url="http://linrunner.de/en/tlp/tlp.html"
+arch="noarch"
+license="GPL2"
+subpackages="$pkgname-doc $pkgname-rdw:rdw $pkgname-bash-completion:bashcomp"
+source="$_pkgname-$pkgver.tar.gz::https://github.com/linrunner/${_pkgname}/archive/${pkgver}.tar.gz
+ $pkgname.initd"
+builddir="$srcdir/"$_pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install-tlp
+ install -dm755 "$pkgdir"/usr/share/man/man1
+ install -m644 man/*.1 "$pkgdir"/usr/share/man/man1
+ install -dm755 "$pkgdir"/usr/share/man/man8
+ install -m644 man/*.8 "$pkgdir"/usr/share/man/man8
+ install -m755 "$srcdir"/tlp.initd "$pkgdir"/etc/init.d/$pkgname
+}
+
+rdw() {
+ depends="tlp"
+ pkgdesc="Linux Advanced Power Management - Radio Device Wizard"
+
+ cd "$builddir"
+ make DESTDIR="$subpkgdir" install-rdw
+}
+
+bashcomp() {
+ depends=""
+ pkgdesc="Bash completions for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ mkdir -p "$subpkgdir"/usr/share
+ mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share
+}
+
+sha512sums="126d11739f2438eb9cf8c496fc7d8cecfb05b578c2ae99264ee53d9fb85dfeab59456483867f21c621d0db6793468f7b0bd77868e999801115e157e1ba383610 TLP-0.9.tar.gz
+26b910acf3987c76fbf9fd24a3fbc95e8cd4b06fedf5b53c17147c9b371a99e1250c30f55bedcc817072f72145dc3d3f059dc9306af984c8d855fa22f2b22837 tlp.initd"
diff --git a/testing/tlp/tlp.initd b/testing/tlp/tlp.initd
new file mode 100755
index 0000000000..4f29bd3a62
--- /dev/null
+++ b/testing/tlp/tlp.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+
+description="Initialize tlp"
+command=/usr/sbin/tlp
+
+extra_commands="force-reload"
+
+depend() {
+ need localmount
+}
+
+status() {
+ tlp-stat -s
+}
+
+# TODO: I don't know how to write this initd
+case "$1" in
+ start|\
+ stop|\
+ restart|\
+ force-reload)
+ tlp init $1
+ ;;
+esac