# Maintainer: Anatol Pomozov
# Contributor: Leen Jewel <leenjewel@gmail.com>
# Contributor: Auguste Pop <auguste [at] gmail [dot] com>

pkgname=msgpack-c
pkgver=1.0.1
_tag=cpp-$pkgver
pkgrel=1
pkgdesc='An efficient object serialization library'
arch=(i686 x86_64)
url='http://msgpack.org/'
license=(Apache)
depends=(glibc)
checkdepends=(gtest)
source=($pkgname-$pkgver.zip::https://github.com/msgpack/msgpack-c/archive/$_tag.zip
        fix_test_failure.patch)
sha1sums=('8e6660ab389ce1321867989677708178bda0e50a'
          'c6abea80cb55279c024d20fc632422c54a603461')

prepare() {
  cd msgpack-c-$_tag
  # upstream fix https://github.com/msgpack/msgpack-c/pull/95
  # patch -p1 < ../fix_test_failure.patch
}

build() {
  cd msgpack-c-$_tag 
  ./bootstrap
  ./configure --prefix=/usr
  make
}

check() {
  cd msgpack-c-$_tag
  make check  
}

package() {
  cd msgpack-c-$_tag
  make DESTDIR="$pkgdir" install
}
