# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=dash
pkgver=0.5.12
pkgrel=1
pkgdesc="A POSIX compliant shell that aims to be as small as possible"
arch=('i686' 'x86_64')
url="http://gondor.apana.org.au/~herbert/dash/"
msys2_references=(
  "cpe: cpe:/a:dash:dash"
)
license=('BSD')
depends=('grep' 'sed' 'filesystem')
makedepends=('autotools' 'gcc')
install=dash.install
source=("http://gondor.apana.org.au/~herbert/dash/files/${pkgname}-${pkgver}.tar.gz")
sha256sums=('6a474ac46e8b0b32916c4c60df694c82058d3297d8b385b74508030ca4a8f28a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
      --bindir=/usr/bin \
      --mandir=/usr/share/man \
      --exec-prefix="" \
      CFLAGS='-O2 -static-libgcc'
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # license
  install -m644 -D COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING

  ln -s ${pkgdir}/usr/bin/{d,}ash.exe
  ln -s ${pkgdir}/usr/share/man/man1/{d,}ash.1
}
