#!/bin/sh

#shellcheck disable=SC2034
#shellcheck disable=SC2154
#shellcheck disable=SC2086

#ebs.formulae
ebsver=1

pkgname=shush
pkgver=0.2.0
pkgsrc=https://dl.juanvel400.com/shush/shush-$pkgver.tar.xz
pkgchecksum=sha256:f3edb5f3088d55d1cb9e93401c9f8df0fd29c6ad3ba4f31061c75e3d4138d378
pkgdesc="a minimal POSIX sh implementation"
pkgmaintainer="juanvel400 <me@juanvel400.com>"
pkglicense="BSD-3-Clause"
pkghomepage="https://git.sr.ht/~juanvel400/shush"
pkgcheck=false
pkgtriggers="shells"
pkgdeps="musl,libedit"

build() {
    make WITH_LIBEDIT=true
}

package() {
    "${1:-fakeroot}" make install DESTDIR="$pkgdir" PREFIX="/usr" INSTALL_MAN=true

    "${1:-fakeroot}" mkdir -p "$pkgdir/usr/share/shells.d"
    printf "/usr/bin/shush\n/bin/shush\n" >"$pkgdir/usr/share/shells.d/shush"
}
