musl_root/pkgs/mksh/build.sh

48 lines
1.3 KiB
Bash
Raw Normal View History

2018-11-10 00:42:27 +02:00
#!/bin/bash
pkgname="mksh"
pkgver="R56c"
src="http://www.mirbsd.org/MirOS/dist/mir/mksh/${pkgname}-${pkgver}.tgz"
prepare () {
[ -f "${pkgname}-src.tar.gz" ] || curl -o "${pkgname}-src.tar.gz" "${src}"
tar -C "${srcdir}" -xvf "${pkgname}-src.tar.gz"
}
build () {
cd "${srcdir}/mksh"
sh ./Build.sh -j
}
package () {
cd "${srcdir}/mksh"
strip --strip-all mksh
local PREFIX
PREFIX="/usr"
# Create directory structure
install -d "${pkgdir}${PREFIX}"/bin
install -d "${pkgdir}"/usr/share/man/cat1/
install -d "${pkgdir}"/usr/share/man/man1/
install -d "${pkgdir}"/usr/share/doc/mksh/examples/
# Copy files
install -s -m 555 mksh "${pkgdir}${PREFIX}"/bin/mksh
install -m 444 dot.mkshrc "${pkgdir}"/usr/share/doc/mksh/examples/
install -m 444 lksh.cat1 "${pkgdir}"/usr/share/man/cat1/lksh.0
install -m 444 mksh.cat1 "${pkgdir}"/usr/share/man/cat1/mksh.0
install -m 444 lksh.1 "${pkgdir}"/usr/share/man/man1/lksh.1
install -m 444 mksh.1 "${pkgdir}"/usr/share/man/man1/mksh.1
# Symlink /usr/bin/sh to /usr/bin/mksh
ln -s "${PREFIX}"/bin/mksh "${pkgdir}${PREFIX}"/bin/sh
#grep -x "${PREFIX}"/bin/mksh "${pkgdir}"/etc/shells > /dev/null || \
# echo "${PREFIX}"/bin/mksh >> "${pkgdir}"/etc/shells
}
. ../common.sh