summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a700181ab2d68d7e404f2c5d2b202cafb61e2215 (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: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Peter Spiess-Knafl <psk@autistici.org>
# Contributor: Daniel Bomar <dbdaniel42@gmail.com>

pkgname=libjson-rpc-cpp-git
pkgver=0.6.0.r28.g4066b2b
pkgrel=1
pkgdesc="C++ framework for json-rpc 1.0 and 2.0"
arch=('i686' 'x86_64')
depends=('argtable' 'curl' 'jsoncpp' 'libmicrohttpd')
makedepends=('cmake')
checkdepends=('boost')
url="https://github.com/cinemast/libjson-rpc-cpp"
license=('MIT')
source=(git+https://github.com/cinemast/libjson-rpc-cpp)
sha256sums=('SKIP')
provides=('libjson-rpc-cpp')
conflicts=('libjson-rpc-cpp')
install=libjson-rpc-cpp.install

pkgver() {
  cd ${pkgname%-git}
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}
prepare() {
 cd "${srcdir}"/${pkgname%-git}
}

build() {
  msg2 "Creating build directories"
  mkdir -p ${pkgname%-git}/build
  cd ${pkgname%-git}/build
  msg2 "Invoking cmake"
  cmake -DCMAKE_INSTALL_PREFIX=/usr ..
  msg2 "Building the framework"
  make
}

check() {
  cd ${pkgname%-git}/build
  msg2 "Running unit tests"
  make test
}

package() {
  cd ${pkgname%-git}/build
  msg2 "Packing all together"
  make DESTDIR="${pkgdir}" install
  msg2 "Add MIT License to package"
  install -D -m644 "${srcdir}/${pkgname%-git}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"

  msg 'Cleaning up pkgdir...'
  find "$pkgdir" -type d -name .git -exec rm -r '{}' +
}