summaryrefslogtreecommitdiff
path: root/pcr/thinkfan
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-11-25 01:27:50 -0800
committerroot <root@rshg054.dnsready.net>2012-11-25 01:27:50 -0800
commit7078408fce09d86886894f26c22cc36fc16aa4cc (patch)
treef905a603edb7119736dc6fbc704ec059d821dd77 /pcr/thinkfan
parentc65624e6d74bffd70dcd67cc28448b5a50596efb (diff)
Sun Nov 25 01:27:22 PST 2012
Diffstat (limited to 'pcr/thinkfan')
-rw-r--r--pcr/thinkfan/PKGBUILD27
-rw-r--r--pcr/thinkfan/thinkfan54
-rw-r--r--pcr/thinkfan/thinkfan.service9
3 files changed, 90 insertions, 0 deletions
diff --git a/pcr/thinkfan/PKGBUILD b/pcr/thinkfan/PKGBUILD
new file mode 100644
index 000000000..18a97754f
--- /dev/null
+++ b/pcr/thinkfan/PKGBUILD
@@ -0,0 +1,27 @@
+# Maintainer: nblock <nblock [/at\] archlinux DOT us>
+# Contributor: Frederik Alkærsig (FALKER) <havnelisten AT gmail.com>
+
+pkgname=thinkfan
+pkgver=0.8.1
+pkgrel=3
+pkgdesc="A minimalist fan control program. Supports the sysfs hwmon interface and thinkpad_acpi"
+arch=('i686' 'x86_64' 'mips64el')
+license=('GPL')
+source=(http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ "thinkfan" "thinkfan.service")
+url="http://thinkfan.sourceforge.net/"
+md5sums=('aaa6c88bab3b43756ac5a1638622828c'
+ '16fc3a83a1468e3ccaeba67e14ab2177'
+ '7639b82035fcee712753e05de6b0601d')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make
+ install -D -m755 ${pkgname} ${pkgdir}/usr/sbin/${pkgname}
+ install -D -m755 ${srcdir}/${pkgname} ${pkgdir}/etc/rc.d/${pkgname}
+ install -D -m644 README ${pkgdir}/usr/share/doc/${pkgname}/README
+ install -D -m644 ${srcdir}/thinkfan.service ${pkgdir}/usr/lib/systemd/system/thinkfan.service
+ cp -r examples ${pkgdir}/usr/share/doc/${pkgname}/
+}
+
+# vim:set ts=2 sw=2 noet:
diff --git a/pcr/thinkfan/thinkfan b/pcr/thinkfan/thinkfan
new file mode 100644
index 000000000..d37c81424
--- /dev/null
+++ b/pcr/thinkfan/thinkfan
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+test -f /usr/sbin/thinkfan || exit 0
+
+case "$1" in
+ start)
+ stat_busy "Starting thinkfan"
+ /usr/sbin/thinkfan -- -q -s5 >/dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon thinkfan
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping thinkfan"
+ PID=$(</var/run/thinkfan.pid)
+ kill $PID
+ rm -f /var/run/thinkfan.pid
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon thinkfan
+ stat_done
+ fi
+ ;;
+ restart)
+ stat_busy "Restarting thinkfan"
+
+ PID=$(</var/run/thinkfan.pid)
+ kill $PID
+ rm -f /var/run/thinkfan.pid
+ if [ $? -gt 0 ]; then
+ stat_fail
+ rm_daemon thinkfan
+ else
+ /usr/sbin/thinkfan -- -q -s5 >/dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ rm_daemon thinkfan
+ else
+ stat_done
+ fi
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {stop|start|restart}"
+ ;;
+esac
+exit 0
diff --git a/pcr/thinkfan/thinkfan.service b/pcr/thinkfan/thinkfan.service
new file mode 100644
index 000000000..7895b8d3a
--- /dev/null
+++ b/pcr/thinkfan/thinkfan.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Thinkfan Daemon - simple and lightweight fan control program
+After=basic.target
+
+[Service]
+ExecStart=/usr/sbin/thinkfan -n -s5 -q
+
+[Install]
+WantedBy=multi-user.target