summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1bdb28a6304e55aa384bd71b5e54739dbc1a507c (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
# Maintainer: dreieck
# Contributor: petRUShka

_pkgname='huaweicalc'
pkgname="${_pkgname}-git"
pkgver=r19.20190705.91911fe
pkgrel=1
pkgdesc='Huawei modem unlock code calculator.'
arch=('i686' 'x86_64')
url="https://github.com/forth32/huaweicalc"
license=('GPL3')
depends=(
  'qt5-base'
)
makedepends=(
  'git'
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
options=()

source=("${_pkgname}::git+https://github.com/forth32/huaweicalc.git")
sha256sums=('SKIP')


pkgver() {
  cd "${srcdir}/${_pkgname}"

  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_rev}" ]; then
    error "Git commit count could not be determined."
    return 1
  else
    printf '%s' "r${_rev}.${_date}.${_hash}"
  fi
}


build() {
  cd "${srcdir}/${_pkgname}"

  qmake
  make
}

package() {
  cd "${srcdir}/${_pkgname}"

  install -D -v -m755 huaweicalc "${pkgdir}/usr/bin/${_pkgname}"

  install -D -v -m644 README.md "${pkgdir}/usr/share/doc/${_pkgname}/README.md"

  install -D -v -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}