app=libarchive
version=3.4.2
build=1sml
homepage="http://libarchive.org"
download="https://www.libarchive.org/downloads/libarchive-$version.tar.gz"
desc="archive reading library"
requires="bzip2 expat zlib xz"

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

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

  CFLAGS="$CFLAGS -D_BSD_SOURCE" \
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --with-pic \
    --without-openssl \
    --without-xml2 \
    --disable-acl \
    --enable-shared \
    --disable-static 

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
16a01dfac7f40ba47ad54a3c32b864d528be89fc34040f859ac4fe77a5050ace81e0795edeadd82ed2956abd4c9c8d3ede71ecfff19e69f6254fc48fb96b8cfb  libarchive-3.4.2.tar.lz
"
