summaryrefslogtreecommitdiff
path: root/community/gsmartcontrol/PKGBUILD
blob: 852b0ea58e9d80a5064aa87f054622e72b5dccdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
}