summaryrefslogtreecommitdiff
path: root/~mtjm
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-11-07 23:14:55 +0000
committerroot <root@rshg054.dnsready.net>2011-11-07 23:14:55 +0000
commiteffb26c3b1f00bf8bea4e2562f07f9a06eb67606 (patch)
tree428924ac7d0c871e4b7ca1fed9e221e5ef7b8081 /~mtjm
parenta4d309341dbcd3c28ee68e818c1d5ef54114adf8 (diff)
Mon Nov 7 23:14:55 UTC 2011
Diffstat (limited to '~mtjm')
-rw-r--r--~mtjm/thinkfan/PKGBUILD36
-rw-r--r--~mtjm/thinkfan/thinkfan54
2 files changed, 90 insertions, 0 deletions
diff --git a/~mtjm/thinkfan/PKGBUILD b/~mtjm/thinkfan/PKGBUILD
new file mode 100644
index 000000000..9bb9a4793
--- /dev/null
+++ b/~mtjm/thinkfan/PKGBUILD
@@ -0,0 +1,36 @@
+# Parabola maintainer: Michał Masłowski <mtjm@mtjm.eu>
+# From https://aur.archlinux.org/packages.php?ID=24359
+# Maintainer: nblock <nblock [/at\] archlinux DOT us>
+# Contributor: Frederik Alkærsig (FALKER) <havnelisten AT gmail.com>
+
+pkgname=thinkfan
+pkgver=0.7.3
+pkgrel=1
+pkgdesc="A minimalist fan control program. Supports the sysfs hwmon interface and thinkpad_acpi"
+arch=('i686' 'x86_64' 'mips64el')
+license=('GPL3')
+source=(http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver}.tar.gz "thinkfan")
+url="http://thinkfan.sourceforge.net/"
+#backup=('etc/thinkfan.conf')
+md5sums=('d1b0d7a05b37cce412ee227cf759a9f6'
+ '16fc3a83a1468e3ccaeba67e14ab2177')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make
+ install -D -m755 ${pkgname} ${pkgdir}/usr/sbin/${pkgname}
+ install -D -m755 ${srcdir}/${pkgname} ${pkgdir}/etc/rc.d/${pkgname}
+
+ # A better way would be to check it at install time.
+# if ! [[ -f /proc/acpi/ibm/fan ]]; then
+# echo "thinkpad_acpi procfs entries don't seem to exist." \
+# "You'll need to use the generic sysfs hwmon interface. Will use sysfs conf."
+ install -D -m644 thinkfan.conf.sysfs ${pkgdir}/etc/thinkfan.conf.sysfs
+# else
+# echo "This seems to be a Thinkpad. You should use the IBM" \
+# "interface. Will use thinkfan conf."
+ [ "${CARCH}" = "mips64el" ] || install -D -m644 thinkfan.conf.thinkpad ${pkgdir}/etc/thinkfan.conf.thinkpad
+# fi
+}
+
+# vim:set ts=2 sw=2 noet:
diff --git a/~mtjm/thinkfan/thinkfan b/~mtjm/thinkfan/thinkfan
new file mode 100644
index 000000000..d37c81424
--- /dev/null
+++ b/~mtjm/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