app=mksh
version=r56c
sversion=R56c
build=1sml
homepage="https://www.mirbsd.org/mksh.htm"
download="http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-$sversion.tgz"
desc="MirBSD Korn Shell, successor to the pdksh"
requires="musl"

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

  tar xf $srcdir/$app-$sversion.tgz
  cd "$app"
  fixbuilddirpermissions

  chmod +x Build.sh
  CFLAGS="-static -O3 -fPIC" ./Build.sh

  install -Dm 644 mksh.1 $pkg/share/man/man1/mksh.1
  install -Dm 755 mksh $pkg/bin/mksh

  head -n 26 Build.sh > $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
7e4cd2d24c6bca2ebad7c6b02d158188e766bd4693d93f5bed198d69238aef078d42ce911431ad4e419e4af55083047d823bfad53973db5c6d8a685482770135  mksh-R56c.tgz
"
