summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/lm_sensors
diff options
context:
space:
mode:
Diffstat (limited to 'abs/extra-testing/lm_sensors')
-rw-r--r--abs/extra-testing/lm_sensors/PKGBUILD41
-rw-r--r--abs/extra-testing/lm_sensors/fancontrol.rc34
-rw-r--r--abs/extra-testing/lm_sensors/sensors-detect.patch61
-rw-r--r--abs/extra-testing/lm_sensors/sensors.install12
-rw-r--r--abs/extra-testing/lm_sensors/sensors.rc127
5 files changed, 275 insertions, 0 deletions
diff --git a/abs/extra-testing/lm_sensors/PKGBUILD b/abs/extra-testing/lm_sensors/PKGBUILD
new file mode 100644
index 0000000..487a6fe
--- /dev/null
+++ b/abs/extra-testing/lm_sensors/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 8687 2008-08-15 15:06:46Z andyrtr $
+# Maintainer: aurelien <aurelien@archlinux.org>
+# Contributor: Aurelien Foret <orelien@chez.com>
+pkgname=lm_sensors
+pkgver=3.0.2
+pkgrel=2
+pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring."
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('perl' 'sysfsutils')
+makedepends=('bison' 'flex' 'rrdtool')
+optdepends=('rrdtool: for logging with sensord')
+backup=(etc/sensors3.conf)
+install=sensors.install
+source=(http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-$pkgver.tar.bz2
+ sensors.rc
+ fancontrol.rc
+ sensors-detect.patch)
+url="http://www.lm-sensors.org/"
+md5sums=('5b210ba9cc01f00161c438fd618484e5'
+ 'c9f7f38964963ae3ced4dff3f1f0b7b9'
+ 'f14e335a8eea27388892c36af8099782'
+ '6fd30ed1e5ac739b8a27f3913ba706f4')
+
+build() {
+ cd ${srcdir}/$pkgname-$pkgver
+ patch -Np0 -i ${srcdir}/sensors-detect.patch || return 1
+
+ make PREFIX=/usr PROG_EXTRA:=sensord user || return 1
+ make user_install PREFIX=/usr DESTDIR=${pkgdir}
+ install -DT -m755 ${srcdir}/$pkgname-$pkgver/prog/sensord/sensord ${pkgdir}/usr/sbin/sensord
+
+ install -DT -m755 ${srcdir}/sensors.rc ${pkgdir}/etc/rc.d/sensors
+ install -DT -m755 ${srcdir}/fancontrol.rc ${pkgdir}/etc/rc.d/fancontrol
+
+ # remove the static lib
+ rm -rf ${pkgdir}/usr/lib/libsensors.a
+
+ # FIXME: avoid conflicts with glibc headers
+ rm -rf ${pkgdir}/usr/include/linux
+}
diff --git a/abs/extra-testing/lm_sensors/fancontrol.rc b/abs/extra-testing/lm_sensors/fancontrol.rc
new file mode 100644
index 0000000..7fc1bbf
--- /dev/null
+++ b/abs/extra-testing/lm_sensors/fancontrol.rc
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting fancontrol"
+ /usr/sbin/fancontrol >/dev/null 2>&1 &
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon fancontrol
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping fancontrol"
+ [ -f /var/run/fancontrol.pid ] && kill `cat /var/run/fancontrol.pid`
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon fancontrol
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/abs/extra-testing/lm_sensors/sensors-detect.patch b/abs/extra-testing/lm_sensors/sensors-detect.patch
new file mode 100644
index 0000000..981ed3d
--- /dev/null
+++ b/abs/extra-testing/lm_sensors/sensors-detect.patch
@@ -0,0 +1,61 @@
+--- prog/detect/sensors-detect.orig 2008-02-07 20:59:25.125302226 +0100
++++ prog/detect/sensors-detect 2008-02-07 21:06:53.821929489 +0100
+@@ -5879,21 +5879,21 @@
+ }
+ }
+
+- my $have_sysconfig = -d '/etc/sysconfig';
+- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
+- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
++ my $have_sysconfig = -d '/etc/conf.d';
++ printf "Do you want to \%s /etc/conf.d/lm_sensors? (\%s): ",
++ (-e '/etc/conf.d/lm_sensors' ? 'overwrite' : 'generate'),
+ ($have_sysconfig ? 'YES/no' : 'yes/NO');
+ $_ = <STDIN>;
+ if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
+ unless ($have_sysconfig) {
+- mkdir '/etc/sysconfig', 0777
+- or die "Sorry, can't create /etc/sysconfig ($!)";
++ mkdir '/etc/conf.d', 0777
++ or die "Sorry, can't create /etc/conf.d ($!)";
+ }
+- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
+- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
++ open(local *SYSCONFIG, ">/etc/conf.d/lm_sensors")
++ or die "Sorry, can't create /etc/conf.d/lm_sensors ($!)";
+ print SYSCONFIG <<'EOT';
+-# /etc/sysconfig/lm_sensors - Defines modules loaded by
+-# /etc/init.d/lm_sensors
++# /etc/conf.d/lm_sensors - Defines modules loaded by
++# /etc/rc.d/sensors
+ # Copyright (c) 1998 - 2001 Frodo Looijaard <frodol@dds.nl>
+ #
+ # This program is free software; you can redistribute it and/or modify
+@@ -5914,8 +5914,8 @@
+ # See also the lm_sensors homepage at:
+ # http://www.lm-sensors.org/
+ #
+-# This file is used by /etc/init.d/lm_sensors and defines the modules to
+-# be loaded/unloaded. This file is sourced into /etc/init.d/lm_sensors.
++# This file is used by /etc/rc.d/sensors and defines the modules to
++# be loaded/unloaded. This file is sourced into /etc/rc.d/sensors.
+ #
+ # The format of this file is a shell script that simply defines the modules
+ # in order as normal variables with the special names:
+@@ -5952,12 +5952,12 @@
+ print SYSCONFIG $sysconfig;
+ close(SYSCONFIG);
+
+- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n".
++ print "Copy prog/init/lm_sensors.init to /etc/rc.d/sensors\n".
+ "for initialization at boot time.\n"
+- unless -f "/etc/init.d/lm_sensors";
++ unless -f "/etc/rc.d/sensors";
+
+- if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
+- system("/sbin/insserv", "/etc/init.d/lm_sensors");
++ if (-x "/sbin/insserv" && -f "/etc/rc.d/sensors") {
++ system("/sbin/insserv", "/etc/rc.d/sensors");
+ } elsif (-x "/sbin/chkconfig" && -f "/etc/init.d/lm_sensors") {
+ system("/sbin/chkconfig", "lm_sensors", "on");
+ if (-x "/sbin/service") {
diff --git a/abs/extra-testing/lm_sensors/sensors.install b/abs/extra-testing/lm_sensors/sensors.install
new file mode 100644
index 0000000..d593f84
--- /dev/null
+++ b/abs/extra-testing/lm_sensors/sensors.install
@@ -0,0 +1,12 @@
+post_install() {
+ echo ">>> to control the lm_sensors daemon type"
+ echo ">>> \"/etc/rc.d/sensors start|stop|restart\" "
+ echo ">>> --------------------------------------"
+ echo ">>> before you can use the fancontrol daemon"
+ echo ">>> first create a fancontrol config file, use \"pwmconfig\""
+ echo ">>> then type \"/etc/rc.d/fancontrol start|stop|restart\" "
+ echo ">>> --------------------------------------"
+ echo ">>> to decode memory SPD timings modprobe eeprom module"
+ echo ">>> and get this perl script from"
+ echo ">>> \"http://www.lm-sensors.org/browser/lm-sensors/trunk/prog/eeprom/decode-dimms.pl\""
+}
diff --git a/abs/extra-testing/lm_sensors/sensors.rc b/abs/extra-testing/lm_sensors/sensors.rc
new file mode 100644
index 0000000..aa086eb
--- /dev/null
+++ b/abs/extra-testing/lm_sensors/sensors.rc
@@ -0,0 +1,127 @@
+#!/bin/bash
+#
+# chkconfig: 2345 26 74
+# description: sensors is used for monitoring motherboard sensor values.
+# config: /etc/sysconfig/sensors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# See also the lm_sensors homepage at:
+# http://www2.lm-sensors.nu/~lm78/index.html
+
+# It uses a config file /etc/sysconfig/sensors that contains the modules to
+# be loaded/unloaded. That file is sourced into this one.
+
+# The format of that file a shell script that simply defines the modules
+# in order as normal shell variables with the special names:
+# MODULE_1, MODULE_2, MODULE_3, etc.
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+if grep -q sysfs /proc/mounts; then
+ WITHSYS=1
+else
+ WITHSYS=0
+fi
+
+CONFIG=/etc/conf.d/lm_sensors
+PSENSORS=/usr/bin/sensors
+if [ ! -x $PSENSORS ]; then
+ PSENSORS=/usr/bin/sensors
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting Up Sensors"
+
+ if [ $WITHSYS == "0" ]; then
+ # If sensors isn't supported by the kernel, try loading the module...
+ [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null
+
+ # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have
+ # support for sensors.
+ [ -e /proc/sys/dev/sensors ] || exit 0
+
+ # If sensors was not already running, unload the module...
+ [ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null
+ fi
+
+
+ if [ -r "$CONFIG" ]; then
+ . "$CONFIG"
+ modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
+ i=0
+ while [ $i -lt $modules ] ; do
+ module=`eval echo '$'MODULE_$i`
+ #echo starting module __${module}__ #debug
+ /sbin/modprobe $module &>/dev/null
+ i=`expr $i + 1`
+ done
+ fi
+ $PSENSORS -s
+
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon sensors
+ stat_done
+ fi
+ ;;
+
+ stop)
+ stat_busy "Shutting Down Sensors"
+
+ if [ -r "$CONFIG" ]; then
+ . "$CONFIG"
+ modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
+ i=`expr $modules`
+ while [ $i -ge 0 ] ; do
+ module=`eval echo '$'MODULE_$i`
+ /sbin/modprobe -r $module &>/dev/null
+ i=`expr $i - 1`
+ done
+ fi
+
+ if [ $WITHSYS == "0" ]; then
+ /sbin/modprobe -r i2c-proc &>/dev/null
+ fi
+
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon sensors
+ stat_done
+ fi
+ ;;
+
+ dostatus)
+ $PSENSORS
+ RETVAL=$?
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ condrestart)
+ [ -e /var/lock/subsys/lm_sensors ] && restart || :
+ ;;
+
+ *)
+ echo "Usage: sensors.init {start|stop|status|restart|reload|condrestart}"
+esac