diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2011-11-07 17:51:46 +0100 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2011-11-07 17:51:46 +0100 |
commit | 9c8440f3bd85fc6c0f7dedabeedae38b113b7b86 (patch) | |
tree | fe0d4122241130e8dbe22ca51a450c8e68bd5ed4 | |
parent | d3487be0fb1100dcdfa044fbe778be893002c8c9 (diff) | |
download | abslibre-9c8440f3bd85fc6c0f7dedabeedae38b113b7b86.tar.gz abslibre-9c8440f3bd85fc6c0f7dedabeedae38b113b7b86.tar.bz2 abslibre-9c8440f3bd85fc6c0f7dedabeedae38b113b7b86.zip |
Add thinkfan from AUR.
-rw-r--r-- | ~mtjm/thinkfan/PKGBUILD | 36 | ||||
-rw-r--r-- | ~mtjm/thinkfan/thinkfan | 54 |
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 |