SUMMARY="The MirBSD Korn Shell"
DESCRIPTION="An actively developed free implementation of the Korn Shell \
programming language and a successor to the Public Domain Korn Shell (pdksh).

mksh targets users who desire a compact, fast, reliable, secure shell not cut \
off modern extensions; a shell with Unicode support; an actively developed, \
current, and portable product; one with developers that listen to their users’ \
requests and implement them if they actually make sense.

mksh aims to replace pdksh in all but very rare use cases (such as support for \
checking the Unix mbox) and in all operating environments (thus including \
patches from pdksh on e.g. Debian)."
HOMEPAGE="https://www.mirbsd.org/mksh.htm"
COPYRIGHT="2002-2019 Thorsten Glaser"
LICENSE="MirOS
	BSD (3-clause)
	ISC"
REVISION="2"
SOURCE_URI="https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R$portVersion.tgz"
CHECKSUM_SHA256="3d101154182d52ae54ef26e1360c95bc89c929d28859d378cc1c84f3439dbe75"
SOURCE_DIR="mksh"
PATCHES="mksh-$portVersion.patchset"
if [ "$targetArchitecture" != x86_gcc2 ]; then
	PATCHES+="
		mksh-$portVersion.patch
		"
fi

ARCHITECTURES="all"

PROVIDES="
	mksh = $portVersion
	cmd:mksh
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"

BUILD_PREREQUIRES="
	cmd:awk
	cmd:cmp
	cmd:ed
	cmd:gcc
	cmd:grep
	cmd:make
	cmd:nroff
	cmd:perl
	"

BUILD()
{
	sh Build.sh
}

INSTALL()
{
	# Installing the shell:
	install -D -c -s -m 555 mksh $binDir/mksh
	install -D -c -m 444 dot.mkshrc $docDir/examples/dot.mkshrc

	# Installing the manual:
	install -D -c -m 444 mksh.1 $manDir/man1/mksh.1
}

TEST()
{
	./test.sh
}
