summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: df8fa29b6429f6ddb32a0ea5ffb2d68679fd69ee (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
# Maintainer: Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com>

pkgname=libbox0-git
_pkgname=libbox0
pkgver=69.aa871fc
pkgrel=1
pkgdesc="C library for communicating with Box0 implementations"
arch=('i686' 'x86_64')
url="https://www.madresistor.org/box0"
license=('GPL')
provides=(libbox0)
conflicts=(libbox0)
replaces=(libbox0)
source=("git+https://gitlab.com/madresistor/$_pkgname.git")
depends=('libusb')
makedepends=('cmake' 'git')
md5sums=('SKIP')


pkgver() {
  cd "$srcdir/$_pkgname"
  echo "$(git rev-list --count HEAD).$(git describe --always )"
}

prepare() {
  cd "$srcdir/$_pkgname"
  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build
}

build() {
  cd "$srcdir/$_pkgname/build"
  # We are not building demo examples as they will not be installed
  cmake \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='lib' \
    -DBUILD_DEMO=NO \
    -DBUILD_SHARED_LIBS='TRUE' ..
  make
}

package() {
  cd "$srcdir/$_pkgname"
  install -Dm644 "extra/udev/box0-v5.rules" "$pkgdir/usr/lib/udev/rules.d/27-box0-v5.rules"
  make -C "build" DESTDIR="${pkgdir}" install
}