summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d209ba2dc7651dba177cf3309fb49bd0d8d2a5b9 (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
# Maintainer: Gauthier B <gogoprog at gmail dot com>
pkgname=qbat-qt5
pkgver=20170423
pkgrel=1
pkgdesc="Light qt5 tool to display battery stats in system tray"
arch=('i686' 'x86_64')
url="https://github.com/gogoprog/qbat"
license=('GPL2')
depends=('qt5-base')
makedepends=('git')
conflicts=('qbat')

_gitroot="https://github.com/gogoprog/qbat"
_gitname="qbat"

build() {
    # update/download git files
    cd ${srcdir}/
    msg "Connecting to the GIT server..."
    if [[ -d ${srcdir}/${_gitname} ]] ; then
        cd ${_gitname}/
        git stash
        git pull origin
        msg "The local files are updated..."
    else
        git clone ${_gitroot} ${_gitname}
    fi
    # checkout of actual/working branch
    cd ${srcdir}/${_gitname}
    git checkout master
    msg "GIT checkout done."

    cd build
    msg "Building..."
    qmake
    make clean || return 1
    make all || return 1
    make DESTDIR="${pkgdir}" install || return 1
    msg "Build done."
}

package() {
    mkdir -p ${pkgdir}/usr/bin/
    cp ${srcdir}/${_gitname}/build/qbat ${pkgdir}/usr/bin/
}