summaryrefslogtreecommitdiff
path: root/extra/hddtemp
diff options
context:
space:
mode:
Diffstat (limited to 'extra/hddtemp')
-rw-r--r--extra/hddtemp/PKGBUILD41
-rw-r--r--extra/hddtemp/hddtemp39
-rw-r--r--extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch22
-rw-r--r--extra/hddtemp/hddtemp.confd2
4 files changed, 104 insertions, 0 deletions
diff --git a/extra/hddtemp/PKGBUILD b/extra/hddtemp/PKGBUILD
new file mode 100644
index 000000000..f43fb8f50
--- /dev/null
+++ b/extra/hddtemp/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 98707 2010-11-12 20:24:41Z ibiru $
+# Maintainer: Andrea Scarpino <bash@archlinux.it>
+# Contributor: Roman Kyrylych <roman@archlinux.org>
+# Contributor: Damir Perisa <damir@archlinux.org>
+
+pkgname=hddtemp
+pkgver=0.3.beta15.46
+_origver=0.3-beta15
+_patchver=46
+pkgrel=1
+pkgdesc="Gives you the temperature of your hard drive by reading S.M.A.R.T. information"
+arch=('i686' 'x86_64')
+url="http://www.guzu.net/linux/hddtemp.php"
+license=('GPL')
+depends=('glibc')
+backup=('etc/conf.d/hddtemp')
+source=(http://www.guzu.net/files/hddtemp-${_origver}.tar.bz2
+ http://ftp.debian.org/debian/pool/main/h/hddtemp/hddtemp_${_origver}-${_patchver}.diff.gz
+ 'hddtemp' 'hddtemp.confd' 'hddtemp-0.3-beta15-reg-eip.patch')
+md5sums=('8b829339e1ae9df701684ec239021bb8'
+ '040437845e28771c560b4bb40e41f933'
+ 'b7ebb86dfeef3bc4577ed1040307e36b'
+ 'fdca5c43900406f0be76534ef2a5a697'
+ '526ef28549dd0da7e38d32cfc8523592')
+options=('!libtool')
+
+build() {
+ cd "$srcdir/$pkgname-${_origver}"
+
+ patch -Np1 -i "$srcdir/${pkgname}_${_origver}-${_patchver}.diff"
+ patch -Np1 -i "$srcdir/hddtemp-0.3-beta15-reg-eip.patch"
+
+ ./configure --prefix=/usr --mandir=/usr/share/man --with-db-path=/usr/share/$pkgname/hddtemp.db
+ make
+ make DESTDIR=$pkgdir install
+
+ install -D -m644 "$srcdir/$pkgname-${_origver}/debian/hddtemp.db" \
+ "$pkgdir/usr/share/${pkgname}/hddtemp.db"
+ install -D -m644 "$srcdir/hddtemp.confd" "$pkgdir/etc/conf.d/hddtemp"
+ install -D -m755 "$srcdir/hddtemp" "$pkgdir/etc/rc.d/hddtemp"
+}
diff --git a/extra/hddtemp/hddtemp b/extra/hddtemp/hddtemp
new file mode 100644
index 000000000..62f090808
--- /dev/null
+++ b/extra/hddtemp/hddtemp
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PARAMS=
+DRIVES=
+[ -f /etc/conf.d/hddtemp ] && . /etc/conf.d/hddtemp
+PID=$(pidof -o %PPID /usr/sbin/hddtemp)
+case "$1" in
+ start)
+ stat_busy "Starting HDDTemp"
+ [ -z "$PID" ] && /usr/sbin/hddtemp -d $PARAMS $DRIVES
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon hddtemp
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping HDDTemp"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon hddtemp
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch b/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch
new file mode 100644
index 000000000..504a0366e
--- /dev/null
+++ b/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch
@@ -0,0 +1,22 @@
+__USE_GNU needs to be in effect when including sys/ucontext.h,
+and signal.h pulls it in in some setups.
+
+diff -up hddtemp-0.3-beta15/src/backtrace.c~ hddtemp-0.3-beta15/src/backtrace.c
+--- hddtemp-0.3-beta15/src/backtrace.c~ 2006-04-19 05:38:14.000000000 +0300
++++ hddtemp-0.3-beta15/src/backtrace.c 2010-02-14 21:59:47.000000000 +0200
+@@ -27,13 +27,12 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <linux/ptrace.h>
++#define __USE_GNU
++#include <ucontext.h>
+ #include <signal.h>
+ #include <bits/sigcontext.h>
+ #include <sys/param.h>
+
+-#define __USE_GNU
+-#include <ucontext.h>
+-
+ #define MAX_BTSIZE 64
+
+ void backtrace_handler(int n, siginfo_t *ist, void *extra) {
diff --git a/extra/hddtemp/hddtemp.confd b/extra/hddtemp/hddtemp.confd
new file mode 100644
index 000000000..6a1e18e0b
--- /dev/null
+++ b/extra/hddtemp/hddtemp.confd
@@ -0,0 +1,2 @@
+PARAMS="-q -l 127.0.0.1"
+DRIVES="/dev/sda"