summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 70a972f7579f56619c3ce3939b59fc7ddb77d53a (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
# Maintainer: Marat Moustafine <moustafine-@t-tuta-d.t-io>

_pkgname=qtools
pkgname=$_pkgname-git
pkgver=latest
pkgrel=1
pkgdesc='A toolset for reading/writing flash of Qualcomm chips'
arch=('i686' 'x86_64')
url=https://github.com/forth32/$_pkgname
license=('LGPL3')
depends=('readline')
makedepends=('git')
provides=($_pkgname)
conflicts=($_pkgname)
backup=(etc/$_pkgname/chipset.cfg)
source=(git+$url.git
        chipconfig.patch)
sha256sums=('SKIP'
            '618abb9acc929cdab9964a49254681bca07ffab088e283936501bfcdb5a881e4')

pkgver() {
  cd $_pkgname
  (
    set -o pipefail
    git describe --long --tags 2> /dev/null | sed -r 's/^[r|v]//;s/-/+/g' ||
    printf '%s+%s' $(git rev-list --count HEAD) $(git rev-parse --short HEAD)
  )
}

prepare() {
  cd $_pkgname
  patch -N -p 1 -i ../chipconfig.patch
}

build () {
  cd $_pkgname
  make all
}

package() {
  cd $_pkgname
  install -D -m 755 -t $pkgdir/usr/bin \
    mibibsplit \
    qbadblock \
    qblinfo \
    qcommand \
    qdload \
    qefs \
    qflashparm \
    qident \
    qnvram \
    qrflash \
    qrmem \
    qterminal \
    qwdirect \
    qwflash
  install -D -m 644 -t $pkgdir/usr/lib/$_pkgname/loaders loaders/*.bin
  install -D -m 644 -t $pkgdir/usr/share/doc/$_pkgname doc/*.odt
  install -D -m 644 -t $pkgdir/etc/$_pkgname chipset.cfg
}