summaryrefslogtreecommitdiff
path: root/community/gsmartcontrol
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
committerroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
commit7a65a910b77ad191d69881098c47f9b0c852d92e (patch)
tree9564e611af1442f8952a8cbddb3b0ad25ed71aab /community/gsmartcontrol
parent60da6abff6c9577a783d72865f11de7a585e912e (diff)
Tue Aug 13 01:31:08 PDT 2013
Diffstat (limited to 'community/gsmartcontrol')
-rw-r--r--community/gsmartcontrol/PKGBUILD50
-rw-r--r--community/gsmartcontrol/gsmartcontrol.desktop9
-rw-r--r--community/gsmartcontrol/gsmartcontrol.install14
-rw-r--r--community/gsmartcontrol/org.archlinux.pkexec.gsmartcontrol.policy19
4 files changed, 92 insertions, 0 deletions
diff --git a/community/gsmartcontrol/PKGBUILD b/community/gsmartcontrol/PKGBUILD
new file mode 100644
index 000000000..852b0ea58
--- /dev/null
+++ b/community/gsmartcontrol/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Jelle van der Waa <jelle@vdwaa.nl>
+
+pkgname=gsmartcontrol
+pkgver=0.8.7
+pkgrel=3
+pkgdesc="A graphical user interface for the smartctl hard disk drive health inspection tool."
+arch=('i686' 'x86_64')
+url="http://gsmartcontrol.berlios.de/home/index.php/en/Home"
+license=('GPL3')
+depends=('smartmontools' 'gtkmm' 'xorg-xmessage' 'hicolor-icon-theme' 'polkit')
+optdepends=('polkit-gnome: to run gsmartcontrol directly from menu')
+install=${pkgname}.install
+source=(http://download.berlios.de/gsmartcontrol/${pkgname}-${pkgver}.tar.bz2
+ org.archlinux.pkexec.gsmartcontrol.policy)
+md5sums=('6d104c2ffc1e693cd1a8052a6d7e3b30'
+ 'e403f8e06e6b8a3d1a99da5e584b2257')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+}
+
+check() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ make DESTDIR=${pkgdir} install
+
+ # We need rename the original binary
+ mv "${pkgdir}/usr/bin/gsmartcontrol" "${pkgdir}/usr/bin/gsmartcontrol.elf"
+
+ # Install launcher script
+ echo '#!/bin/sh' > ${pkgdir}/usr/bin/gsmartcontrol
+ echo 'pkexec --disable-internal-agent "/usr/bin/gsmartcontrol.elf" "$@"' \
+ >> ${pkgdir}/usr/bin/gsmartcontrol
+ chmod 755 ${pkgdir}/usr/bin/gsmartcontrol
+
+ # Modify desktop file
+ sed -i -e "s|^Exec=.*|Exec=/usr/bin/gsmartcontrol|" \
+ "${pkgdir}/usr/share/applications/gsmartcontrol.desktop"
+
+ # Install policy file
+ install -Dm766 $srcdir/org.archlinux.pkexec.gsmartcontrol.policy \
+ $pkgdir/usr/share/polkit-1/actions/org.archlinux.pkexec.gsmartcontrol.policy
+}
diff --git a/community/gsmartcontrol/gsmartcontrol.desktop b/community/gsmartcontrol/gsmartcontrol.desktop
new file mode 100644
index 000000000..e65a26ef6
--- /dev/null
+++ b/community/gsmartcontrol/gsmartcontrol.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Name=GSmartControl
+GenericName=Hard Disk Health Inspection
+Comment=Monitor and control SMART data on hard disks
+Icon=gsmartcontrol
+Exec=pkexec /usr/bin/gsmartcontrol
+Type=Application
+Categories=GTK;GNOME;System;Filesystem;
diff --git a/community/gsmartcontrol/gsmartcontrol.install b/community/gsmartcontrol/gsmartcontrol.install
new file mode 100644
index 000000000..f636406f2
--- /dev/null
+++ b/community/gsmartcontrol/gsmartcontrol.install
@@ -0,0 +1,14 @@
+post_install() {
+ which xdg-icon-resource 1>/dev/null 2>/dev/null && xdg-icon-resource forceupdate || true
+ echo 'If you use a lightweight windowmanager, remember to run'
+ echo '/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 to enable'
+ echo 'graphical authentication, which may be needed for pkexec to work.'
+}
+
+post_upgrade() {
+ which xdg-icon-resource 1>/dev/null 2>/dev/null && xdg-icon-resource forceupdate || true
+}
+
+post_remove() {
+ which xdg-icon-resource 1>/dev/null 2>/dev/null && xdg-icon-resource forceupdate || true
+}
diff --git a/community/gsmartcontrol/org.archlinux.pkexec.gsmartcontrol.policy b/community/gsmartcontrol/org.archlinux.pkexec.gsmartcontrol.policy
new file mode 100644
index 000000000..b71db7904
--- /dev/null
+++ b/community/gsmartcontrol/org.archlinux.pkexec.gsmartcontrol.policy
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+
+ <action id="org.archlinux.pkexec.gsmartcontrol">
+ <message>Authentication is required to run the GSmartControl</message>
+ <icon_name>gsmartcontrol</icon_name>
+ <defaults>
+ <allow_any>auth_admin</allow_any>
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/gsmartcontrol.elf</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+
+</policyconfig>