# Maintainer: Andy Weidenbaum # Contributor: Peter Spiess-Knafl # Contributor: Daniel Bomar pkgname=libjson-rpc-cpp-git pkgver=0.6.0.r31.g5e1478b pkgrel=1 pkgdesc="C++ framework for json-rpc 1.0 and 2.0" arch=('i686' 'x86_64') depends=('argtable' 'curl' 'jsoncpp' 'libmicrohttpd') makedepends=('cmake' 'git') 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}/LICENSE" msg 'Cleaning up pkgdir...' find "$pkgdir" -type d -name .git -exec rm -r '{}' + }