app=libgit2
version=1.0.1
build=1sml
homepage="https://libgit2.github.com/"
download="https://github.com/libgit2/libgit2/releases/download/v1.0.1/libgit2-1.0.1.tar.gz"
desc="C library for custom Git applications"
requires="pcre libssh2"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  mkdir -p smbuild && cd smbuild
  cmake .. \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX="" \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DTHREADSAFE=ON \
    -Wno-dev 

  make 
  make install DESTDIR=$pkg 

  cp ../{COPYING,README.md,SECURITY.md} $pkgdocs/

  mkfinalpkg
}

sha512sums="
2499ee5517da96afd56bcecddb412d4d50bbe325c642cffdf7796867a072a886c914d7afb139cc33313604a6a03c1a5a658d16a2848a95008981e0d2b6a65c11  libgit2-1.0.1.tar.lz
"
