summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01a1a2b694e89307cad9ba78e888f92e7d1c7f64 (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
# Maintainer: dreieck

_pkgname="balong-fbtools"
pkgname="${_pkgname}-git"
pkgver=r36.20171009.22a228c
pkgrel=4
pkgdesc="Utilities for working with flash modems on the balong platform. Contains 'fbrflash'."
arch=('i686' 'x86_64')
url="https://github.com/forth32/${_pkgname}"
license=('GPL3')
depends=('libusb')
makedepends=('git')
optdepends=()
provides=(
  "${_pkgname}"
  'fbrflash'
  "fbrflash-git=${pkgver}"
)
conflicts=(
  "${_pkgname}"
  'fbrflash'
)

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

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}"

  _CFLAGSADDITION=" -Wno-error=deprecated-declarations"
  CFLAGS+="${_CFLAGSADDITION}"
  CXXFLAGS+="${_CFLAGSADDITION}"
  export CFLAGS
  export CXXFLAGS

  make
}

package() {
  cd "${srcdir}/${_pkgname}"
  install -D -v -m755 fbrflash "${pkgdir}/usr/bin/fbrflash"

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