# Maintainer: PktSurf <smlinux@pktsurf.in>
app=bash
version=5.0
build=3sml
homepage="https://www.gnu.org/software/bash/bash.html"
download="https://ftp.gnu.org/gnu/bash/bash-$version.tar.gz"
requires="netbsd-curses"
desc="GNU Bourne-Again SHell"

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

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

build() {
  bash_cv_getenv_redef=no \
  bash_cv_sys_named_pipes=yes \
  ac_cv_rl_version=5.0 \
  LDFLAGS="-static" \
  ./configure \
    --prefix="" \
    --bindir=/bin \
    --docdir="/share/doc/$app-$version" \
    --without-bash-malloc \
    --disable-rpath \
    --enable-history

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  ( cd $pkg/bin ; ln -s bash sh )

  mkfinalpkg
}

sha512sums="
5795c200a1f930caa1b984006498ea1ecae6fd9f73aa039ccc02403e4b2db0cc0999d47b00dc92eefe1ae25b189b43ca5e3d052606b535ea8712f3e3f6f39470  bash-5.0.tar.lz
"
