# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Sheila Aman <sheila@vulpine.house>
pkgname=dash
pkgver=0.5.11.4
pkgrel=0
pkgdesc="Small and fast POSIX-compliant shell"
url="http://gondor.apana.org.au/~herbert/dash/"
arch="all"
license="GPL-2.0+"
depends=""
makedepends=""
subpackages="$pkgname-binsh::noarch $pkgname-doc"
source="http://gondor.apana.org.au/~herbert/$pkgname/files/$pkgname-$pkgver.tar.gz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/ \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
	./src/dash -c 'echo ok'
}

package() {
	make DESTDIR="$pkgdir" install
}

binsh() {
	pkgdesc="Use dash as /bin/sh"
	depends="dash"
	provides="/bin/sh"
	provider_priority=1
	mkdir -p "$subpkgdir"/bin
	ln -s /bin/dash "$subpkgdir"/bin/sh
}

sha512sums="2344782b80f69b74d00eb153a918c2293eec2316825bf83c1eb4ff787eddf78f67ca3026cfce39b1db8d5ede69c7268951eec1e5711903f2306714b665f84160  dash-0.5.11.4.tar.gz"