aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-09-04 14:59:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-09-04 14:59:24 +0000
commite743f23cb1bd92857e6f378eec6bd765fd778fa2 (patch)
tree8457d9024a7e4777541a0ea05940a55400cd647d
parent3f17b20a0297253197f3ce9ba6e5823a2c289eec (diff)
downloadaports-e743f23cb1bd92857e6f378eec6bd765fd778fa2.tar.bz2
aports-e743f23cb1bd92857e6f378eec6bd765fd778fa2.tar.xz
testing/fancontroled: add init.d script
ref #1175
-rw-r--r--testing/fancontroled/APKBUILD15
-rw-r--r--testing/fancontroled/fancontroled.confd17
-rw-r--r--testing/fancontroled/fancontroled.initd18
3 files changed, 47 insertions, 3 deletions
diff --git a/testing/fancontroled/APKBUILD b/testing/fancontroled/APKBUILD
index 30890d39c2..d087742e69 100644
--- a/testing/fancontroled/APKBUILD
+++ b/testing/fancontroled/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fancontroled
pkgver=0.1
-pkgrel=0
+pkgrel=1
pkgdesc="a temperature dependent fan speed control"
url="http://fancontroled.lukaperkov.net/"
arch="all"
@@ -12,7 +12,10 @@ makedepends="lm_sensors-dev"
install=""
subpackages=""
source="http://code.lukaperkov.net/fancontroled/fancontroled-$pkgver.tar
- link.patch"
+ link.patch
+ fancontroled.confd
+ fancontroled.initd
+ "
_builddir="$srcdir"/fancontroled-$pkgver
prepare() {
@@ -34,7 +37,13 @@ package() {
cd "$_builddir"
mkdir -p "$pkgdir"/usr/sbin
make install DESTDIR="$pkgdir" || return 1
+ install -Dm644 "$srcdir"/fancontroled.confd \
+ "$pkgdir"/etc/conf.d/fancontroled || return 1
+ install -Dm755 "$srcdir"/fancontroled.initd \
+ "$pkgdir"/etc/init.d/fancontroled || return 1
}
md5sums="8c3a7efa99e58216ad4633d1e6ed1358 fancontroled-0.1.tar
-099a824ba948f1f01da8d374024357fd link.patch"
+099a824ba948f1f01da8d374024357fd link.patch
+3b9e5e1557ad4877e23f88411e8b84f0 fancontroled.confd
+b7e49fce1d8182559b808b1ce3b60e7b fancontroled.initd"
diff --git a/testing/fancontroled/fancontroled.confd b/testing/fancontroled/fancontroled.confd
new file mode 100644
index 0000000000..803a9c38d8
--- /dev/null
+++ b/testing/fancontroled/fancontroled.confd
@@ -0,0 +1,17 @@
+# possible options for FANCONTROLED_OPTS:
+# -t --temp-sensor-chip Temperature sensor chip (e.g. lm75)
+# -r --temp-read-field Temperature read fild (e.g. temp1_input)
+# -m --min-temp Min fan speed on this temperature (°C)
+# -M --max-temp Max fan speed on this temperature (°C)
+# -f --fan-sensor-chip Fan sensor chip (e.g. g760a)
+# -c --fan-control-field Fan control field (e.g. pwm1)
+# -p --pwm-fan-min Min fan PWM
+# -P --pwm-fan-max Max fan PWM
+#
+# example:
+# FANCONTROLED_OPTS="-t lm75 -r temp1_input -m 30 -M 50 -f g760a -c pwm1 -p 1 -P 180"
+#
+# see http://fancontroled.lukaperkov.net/ for more info
+
+FANCONTROLED_OPTS=""
+
diff --git a/testing/fancontroled/fancontroled.initd b/testing/fancontroled/fancontroled.initd
new file mode 100644
index 0000000000..1da4422e83
--- /dev/null
+++ b/testing/fancontroled/fancontroled.initd
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+
+command=/usr/sbin/fancontroled
+command_args="${FANCONTROLED_OPTS}"
+pidfile=/var/run/fancontroled.pid
+description="Temperature dependent fan speed control"
+
+depend() {
+ need modules
+}
+
+start_pre() {
+ if [ -z "$FANCONTROLED_OPTS" ]; then
+ eerror "Please set FANCONTROLED_OPTS in /etc/conf.d/$RC_SVCNAME"
+ return 1
+ fi
+}
+