# Maintainer:  Jonathan Steel <jsteel at archlinux.org>
# Contributor: Yunhui Fu <yhfudev@gmail.com>

pkgname=rapidjson
pkgver=1.1.0
pkgrel=2
pkgdesc="A fast JSON parser/generator for C++ with both SAX/DOM style API"
arch=('any')
url="https://github.com/miloyip/rapidjson"
license=('MIT')
makedepends=('gcc' 'cmake')
source=($pkgname-$pkgver.tar.gz::https://github.com/miloyip/$pkgname/archive/v$pkgver.tar.gz)
md5sums=('badd12c511e081fec6c89c43a7027bce')

build () {
  cd $pkgname-$pkgver

  mkdir -p build
  cd build

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr ..

  make
}

package() {
  cd $pkgname-$pkgver/build

  DESTDIR="$pkgdir" make install

  install -Dm644 ../license.txt "$pkgdir"/usr/share/licenses/$pkgname/license.txt
}
