summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1d28ea87a5b0eaa923912827153ffc13d696a934 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Contributor: John Lane <archlinux at jelmail dot com>
# Contributor: Michal Wojdyla < micwoj9292 at gmail dot com >
# Based on community/gsmartcontrol

pkgname=gsmartcontrol-svn
pkgver=r253
pkgrel=1
pkgdesc="A graphical user interface for the smartctl hard disk drive health inspection tool."
arch=('i686' 'x86_64')
url="https://gsmartcontrol.sourceforge.io/home/"
license=('GPL')
conflicts=('gsmartcontrol')
provides=('gsmartcontrol')
depends=('smartmontools' 'gtkmm3' 'xorg-xmessage' 'hicolor-icon-theme')
optdepends=('polkit: to run gsmartcontrol directly from menu'
            'xterm: to update the drive database')
makedepends=('subversion')
install=${pkgname}.install
source=(${pkgname}::svn+https://svn.code.sf.net/p/gsmartcontrol/code/trunk
        org.archlinux.pkexec.gsmartcontrol.policy
        gsmartcontrol_polkit)
md5sums=('SKIP'
         '503989a7e6a9a287d81e91243d03f162'
         '33bdda04d8db1525f2507485f3f2a663')

pkgver() {
  cd "$pkgname"
  local ver="$(svnversion)"
  printf "r%s" "${ver//[[:alpha:]]}"
}

prepare() {
	cd "${srcdir}/${pkgname}/gsmartcontrol"

        ./autogen.sh

        # Modify desktop file
        sed -i "s|^Exec=.*|Exec="@prefix@/bin/gsmartcontrol_polkit"|" \
                data/gsmartcontrol.desktop.in
}


build() {
	cd "${srcdir}/${pkgname}/gsmartcontrol"
	CXXFLAGS+=' -std=c++17' ./configure --prefix=/usr --sbindir=/usr/bin/
	make 
}

check() {
	cd "${srcdir}/${pkgname}/gsmartcontrol"
        make check
}

package() {
	cd "${srcdir}/${pkgname}/gsmartcontrol"

	make DESTDIR=${pkgdir} install

        # Install launcher script
        install -m755 ${srcdir}/gsmartcontrol_polkit \
                "${pkgdir}/usr/bin/gsmartcontrol_polkit"

        # Install policy file
        install -Dm644 ${srcdir}/org.archlinux.pkexec.gsmartcontrol.policy \
                "${pkgdir}/usr/share/polkit-1/actions/org.archlinux.pkexec.gsmartcontrol.policy"
}