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
"
