# Author: Oleg A. Khlybov <fougas@mail.ru>

_realname=shellspec
pkgname=${_realname}
pkgver=0.28.1
pkgrel=1
pkgdesc='BDD style unit testing framework for POSIX compliant shell script'
url='https://shellspec.info'
msys2_repository_url="https://github.com/shellspec/shellspec"
license=('MIT')

arch=('any')
depends=('bash')
makedepends=()

noextract=(${_realname}-${pkgver}.tar.gz)
source=("${_realname}-${pkgver}.tar.gz::https://github.com/shellspec/shellspec/archive/${pkgver}.tar.gz")
sha256sums=('400d835466429a5fe6c77a62775a9173729d61dd43e05dfa893e8cf6cb511783')

prepare() {
  [[ -d ${srcdir}/${pkgname}-${pkgver} ]] && rm -rf ${srcdir}/${pkgname}-${pkgver}
  tar -xzf ${srcdir}/${pkgname}-${pkgver}.tar.gz -C ${srcdir}
  cd ${srcdir}/${pkgname}-${pkgver}
  for p in ${srcdir}/../*patch; do patch -p1 -i $p; done
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" PREFIX=/usr install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_realname}/LICENSE"
}