From 13a53b0255f00a0fdb3ac9c6724f4394da38457e Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 26 Nov 2012 08:56:18 -0600
Subject: hddtemp: updated from abs

---
 abs/extra/hddtemp/ChangeLog                        | 14 -----
 abs/extra/hddtemp/PKGBUILD                         | 62 +++++++++++++---------
 abs/extra/hddtemp/conf.d                           |  2 +
 abs/extra/hddtemp/hddtemp                          | 39 --------------
 abs/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch | 22 --------
 abs/extra/hddtemp/hddtemp.confd                    |  2 -
 abs/extra/hddtemp/rc.d                             | 39 ++++++++++++++
 abs/extra/hddtemp/service                          |  9 ++++
 8 files changed, 87 insertions(+), 102 deletions(-)
 delete mode 100644 abs/extra/hddtemp/ChangeLog
 create mode 100644 abs/extra/hddtemp/conf.d
 delete mode 100644 abs/extra/hddtemp/hddtemp
 delete mode 100644 abs/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch
 delete mode 100644 abs/extra/hddtemp/hddtemp.confd
 create mode 100644 abs/extra/hddtemp/rc.d
 create mode 100644 abs/extra/hddtemp/service

diff --git a/abs/extra/hddtemp/ChangeLog b/abs/extra/hddtemp/ChangeLog
deleted file mode 100644
index d9b03e7..0000000
--- a/abs/extra/hddtemp/ChangeLog
+++ /dev/null
@@ -1,14 +0,0 @@
-2009-03-05 Andreas Radke <andyrtr@archlinux.org>
-* pkg moved to extra from AUR
-
-2008-01-23 Roman Kyrylych <roman@archlinux.org>
-* Updated to v38 of Debian's patchset
-
-2007-11-30 Roman Kyrylych <roman@archlinux.org>
-* Backup /etc/conf.d/hddtemp
-
-2007-11-09 Roman Kyrylych <roman@archlinux.org>
-* Updated to v37 of Debian's patchset
-
-2007-06-26 tardo <tardo@nagi-fanboi.net>
-* Built for x86_64
diff --git a/abs/extra/hddtemp/PKGBUILD b/abs/extra/hddtemp/PKGBUILD
index f43fb8f..94073ce 100644
--- a/abs/extra/hddtemp/PKGBUILD
+++ b/abs/extra/hddtemp/PKGBUILD
@@ -1,41 +1,53 @@
-# $Id: PKGBUILD 98707 2010-11-12 20:24:41Z ibiru $
-# Maintainer: Andrea Scarpino <bash@archlinux.it>
+# $Id: PKGBUILD 163630 2012-07-17 14:24:03Z bisson $
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Contributor: Ionut Biru <ibiru@archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
 # 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
+_patchver=${_origver}-52
+pkgver=${_patchver//-/.}
 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"
+url='https://savannah.nongnu.org/projects/hddtemp/'
 license=('GPL')
-depends=('glibc')
+arch=('i686' 'x86_64')
 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')
+source=("http://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${_origver}.tar.bz2"
+        "http://ftp.debian.org/debian/pool/main/h/${pkgname}/${pkgname}_${_patchver}.diff.gz"
+        'rc.d'
+        'conf.d'
+        'service')
+sha1sums=('65393b0a4d9862c030c81702d95c1acd00da275b'
+          'b9bcdd0537c1540e55e5056445b571ea61d5a4a3'
+          '71159486b1505ec6acfb7585e0d8fbe78afe54ec'
+          'd45e3022f614dbf8904ecb1a3e702bb71fcaa808'
+          '501fcf4faf8b2689d010f9cbbf39f917211f611f')
+
 options=('!libtool')
 
 build() {
-  cd "$srcdir/$pkgname-${_origver}"
+	cd "${srcdir}/${pkgname}-${_origver}"
+
+	patch -p1 -i "../${pkgname}_${_patchver}.diff"
+
+	./configure \
+		--prefix=/usr \
+		--mandir=/usr/share/man \
+		--with-db-path="/usr/share/${pkgname}/hddtemp.db"
+
+	make
+}
 
-  patch -Np1 -i "$srcdir/${pkgname}_${_origver}-${_patchver}.diff"
-  patch -Np1 -i "$srcdir/hddtemp-0.3-beta15-reg-eip.patch"
+package() {
+	cd "${srcdir}/${pkgname}-${_origver}"
 
-  ./configure --prefix=/usr --mandir=/usr/share/man --with-db-path=/usr/share/$pkgname/hddtemp.db
-  make
-  make DESTDIR=$pkgdir install
+	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"
+	install -Dm644 "../${pkgname}-${_origver}/debian/hddtemp.db" "${pkgdir}/usr/share/${pkgname}/hddtemp.db"
+	install -Dm644 '../service' "${pkgdir}/usr/lib/systemd/system/hddtemp.service"
+	install -Dm644 '../conf.d' "${pkgdir}/etc/conf.d/hddtemp"
+	install -Dm755 '../rc.d' "${pkgdir}/etc/rc.d/hddtemp"
 }
diff --git a/abs/extra/hddtemp/conf.d b/abs/extra/hddtemp/conf.d
new file mode 100644
index 0000000..6a1e18e
--- /dev/null
+++ b/abs/extra/hddtemp/conf.d
@@ -0,0 +1,2 @@
+PARAMS="-q -l 127.0.0.1"
+DRIVES="/dev/sda"
diff --git a/abs/extra/hddtemp/hddtemp b/abs/extra/hddtemp/hddtemp
deleted file mode 100644
index 62f0908..0000000
--- a/abs/extra/hddtemp/hddtemp
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/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/abs/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch b/abs/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch
deleted file mode 100644
index 504a036..0000000
--- a/abs/extra/hddtemp/hddtemp-0.3-beta15-reg-eip.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-__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/abs/extra/hddtemp/hddtemp.confd b/abs/extra/hddtemp/hddtemp.confd
deleted file mode 100644
index 6a1e18e..0000000
--- a/abs/extra/hddtemp/hddtemp.confd
+++ /dev/null
@@ -1,2 +0,0 @@
-PARAMS="-q -l 127.0.0.1"
-DRIVES="/dev/sda"
diff --git a/abs/extra/hddtemp/rc.d b/abs/extra/hddtemp/rc.d
new file mode 100644
index 0000000..62f0908
--- /dev/null
+++ b/abs/extra/hddtemp/rc.d
@@ -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/abs/extra/hddtemp/service b/abs/extra/hddtemp/service
new file mode 100644
index 0000000..bc56d16
--- /dev/null
+++ b/abs/extra/hddtemp/service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hard drive temperature monitor daemon
+
+[Service]
+EnvironmentFile=/etc/conf.d/hddtemp 
+ExecStart=/usr/sbin/hddtemp -dF $PARAMS $DRIVES
+
+[Install]
+WantedBy=multi-user.target
-- 
cgit v0.12

