summaryrefslogtreecommitdiff
path: root/testing/smartmontools
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-18 00:01:40 +0000
committerroot <root@rshg054.dnsready.net>2012-06-18 00:01:40 +0000
commit0838a7ed482f29ddf71cf05e7ec6cf7c2728ce34 (patch)
treec7eab7aecb6ae497d23cfa7074bffd060d5eb8fe /testing/smartmontools
parent61f450a3578b7e51c337e1a687c0cef2bc07ff35 (diff)
Mon Jun 18 00:01:40 UTC 2012
Diffstat (limited to 'testing/smartmontools')
-rw-r--r--testing/smartmontools/PKGBUILD46
-rw-r--r--testing/smartmontools/smartd.conf1
-rwxr-xr-xtesting/smartmontools/smartd.rc39
3 files changed, 86 insertions, 0 deletions
diff --git a/testing/smartmontools/PKGBUILD b/testing/smartmontools/PKGBUILD
new file mode 100644
index 000000000..1cb08bd73
--- /dev/null
+++ b/testing/smartmontools/PKGBUILD
@@ -0,0 +1,46 @@
+# $Id: PKGBUILD 161937 2012-06-16 17:16:57Z dreisner $
+# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
+# Contributor: Jeff Mickey <jeff@archlinux.org>
+# Contributor: Jani Talikka <jani.talikka@gmail.com>
+# Contributor: Ralf Barth <archlinux.org@haggy.org>
+
+pkgname=smartmontools
+pkgver=5.42
+pkgrel=4
+pkgdesc="Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives"
+url="http://smartmontools.sourceforge.net"
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('gcc-libs' 'libcap-ng' 'bash')
+backup=('etc/smartd.conf'
+ 'etc/conf.d/smartd')
+source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ 'smartd.conf'
+ 'smartd.rc')
+md5sums=('4460bf9a79a1252ff5c00ba52cf76b2a'
+ '28c1b80c41dac52d433961dcfb4f70e0'
+ 'fb30e07f87f2c1d99532e018291ad3e8')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --enable-drivedb \
+ --with-libcap-ng=yes \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i -e "s:sysconfig/smartmontools:conf.d/smartd:g" smartd.service
+ sed -i -e "s:smartd_opts:SMARTD_ARGS:g" smartd.service
+
+ make DESTDIR="${pkgdir}" install
+
+ rm -rf ${pkgdir}/etc/rc.d
+ install -Dm755 ${srcdir}/smartd.rc "${pkgdir}/etc/rc.d/smartd"
+ install -Dm644 ${srcdir}/smartd.conf "${pkgdir}/etc/conf.d/smartd"
+}
diff --git a/testing/smartmontools/smartd.conf b/testing/smartmontools/smartd.conf
new file mode 100644
index 000000000..f14870abf
--- /dev/null
+++ b/testing/smartmontools/smartd.conf
@@ -0,0 +1 @@
+SMARTD_ARGS=""
diff --git a/testing/smartmontools/smartd.rc b/testing/smartmontools/smartd.rc
new file mode 100755
index 000000000..16920db12
--- /dev/null
+++ b/testing/smartmontools/smartd.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# source application-specific settings
+SMARTD_ARGS=
+[ -f /etc/conf.d/smartd ] && . /etc/conf.d/smartd
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+
+ start)
+ stat_busy "Starting smartd"
+ /usr/sbin/smartd ${SMARTD_ARGS} &>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ add_daemon smartd
+ stat_done
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping smartd"
+ kill -9 `pidof /usr/sbin/smartd` &>/dev/null
+ rm_daemon smartd
+ stat_done
+ ;;
+
+ restart)
+ stat_busy "Restarting smartd ..."
+ $0 stop
+ $0 start
+ stat_done
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac