# Maintainer: PktSurf <smlinux@pktsurf.in>
app=physfs
version=3.0.2
build=1sml
homepage="https://icculus.org/physfs/"
download="https://icculus.org/physfs/downloads/physfs-$version.tar.bz2"
desc="Library to provide abstract access to various archives"
requires="zlib"

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

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

build() {
  mkdir -p smbuild && cd smbuild
  cmake .. \
    -DPHYSFS_BUILD_SHARED=ON \
    -DPHYSFS_BUILD_STATIC=OFF \
    -DPHYSFS_BUILD_TEST=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=

  make
  make install DESTDIR=$pkg

  cp ../LICENSE.txt $pkgdocs/

  mkfinalpkg
}

sha512sums="
2d407f3145dde9b8be86a88e1a22286c8663cc929a22155b9e4d4db9127addb4d0b963878e4d695861bf04cef872ef1decbbfb619c3546c486da3af2e908e0ff  physfs-3.0.2.tar.lz
"
