#!/bin/sh -ue
NAME=mksh
VERSION=git
RELEASE=1
SOURCE="https://github.com/MirBSD/mksh.git"

build() {
    msg "building mksh with Build.sh..."
    env CC="${CC:-cc}" LDFLAGS="-static" sh Build.sh -r || die "build.sh failed"

    msg "installing mksh..."
    mkdir -p "$PKG/$PREFIX/bin"
    cp mksh "$PKG/$PREFIX/bin/mksh" || die "failed to copy mksh binary"
    chmod 755 "$PKG/$PREFIX/bin/mksh"

    # Install man page if it exists
    if [ -f mksh.1 ]; then
        mkdir -p "$PKG/$PREFIX/share/man/man1"
        cp mksh.1 "$PKG/$PREFIX/share/man/man1/" || true
    fi
}

. ${0%/*}/../../libsh/libdmake.sh
