summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/tlp/APKBUILD52
-rwxr-xr-xuser/tlp/tlp.initd15
2 files changed, 67 insertions, 0 deletions
diff --git a/user/tlp/APKBUILD b/user/tlp/APKBUILD
new file mode 100644
index 000000000..dd34fe5cc
--- /dev/null
+++ b/user/tlp/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Ivan Tham <pickfire@riseup.net>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=tlp
+_pkgname=TLP
+pkgver=1.1
+pkgrel=0
+pkgdesc="Linux Advanced Power Management"
+url="http://linrunner.de/en/tlp/tlp.html"
+arch="noarch"
+options="!check" # No test suite.
+license="GPL-2.0+ AND GPL-3.0+"
+depends="/bin/sh perl"
+makedepends=""
+subpackages="$pkgname-doc $pkgname-rdw $pkgname-bash-completion:bashcomp
+ $pkgname-openrc"
+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-man
+ install -Dm755 "$srcdir"/tlp.initd "$pkgdir"/etc/init.d/"$pkgname"
+ # We don't ship systemd
+ find "$pkgdir"/usr/share/man/man8 -name '*.service*' -delete
+}
+
+rdw() {
+ pkgdesc="Linux Advanced Power Management - Radio Device Wizard"
+ depends="tlp"
+
+ cd "$builddir"
+ make DESTDIR="$subpkgdir" install-rdw
+}
+
+bashcomp() {
+ pkgdesc="Bash completions for $pkgname"
+ depends=""
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ mkdir -p "$subpkgdir"/usr/share
+ mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share
+}
+
+sha512sums="3400f2b6c249fd2e1bbbc61f23e3450ff90fabb8dd74f2903ce1f0d07e7ce3d1e61b07295736138d4697235dbee9157d3f32a8d296a649c93f73e03e3555af1e tlp-1.1.tar.gz
+e6de216b2540413812711b3304cdc29c8729d527080cfd747ba382db50166dd21c6c27ff467f9f2a967e92007c7a311b00e88262952c34a22f417578c66cf4e7 tlp.initd"
diff --git a/user/tlp/tlp.initd b/user/tlp/tlp.initd
new file mode 100755
index 000000000..05b4c3b97
--- /dev/null
+++ b/user/tlp/tlp.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+
+description="Initialize tlp"
+extra_started_commands="force_reload"
+
+depend() {
+ need localmount
+}
+
+status() { tlp-stat -s; }
+# TODO: keep the following in one line
+start() { tlp init start; }
+stop() { tlp init stop; }
+restart() { tlp init restart; }
+force_reload() { tlp init force-reload; }