# Maintainer: PktSurf <smlinux@pktsurf.in>
app=p7zip
version=16.02
build=1sml
homepage="https://sourceforge.net/projects/p7zip/"
download=""
desc="file archiver and a port of the 7z windows archive utility"
requires="gcc-libs"

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

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

build() {
  sed -i -e 's/strip /#strip /' \
   -e 's/chmod 555/chmod 755/' \
   -e 's/chmod 444/chmod 644/' install.sh && make all3 OPTFLAGS="$CXXFLAGS" || true

  make install DEST_HOME="" DEST_DIR="$pkg" DEST_MAN="/share/man"

  cp DOC/License.txt $pkgdocs/

  mkfinalpkg
}

sha512sums="
72beac97a0d298d5416a25db6863d7f5033408e979555d1dae61a847e0d9062a4b5eca7e31f47bfeb26eda95b567fea081a13e1a20098a6e57a6de0ab39715ee  p7zip-16.02.tar.lz
"
