# Maintainer: Tim Meusel <tim@bastelfreak.de>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Alfredo Palhares <masterkorp@masterkorp.net>
# Contributor: Jochen Schalanda <jochen+aur@schalanda.name>
_gemname=test-unit
pkgname="ruby-${_gemname}"
pkgver=3.6.1
pkgrel=1
pkgdesc='An xUnit family unit testing framework for Ruby'
arch=('any')
url="https://github.com/${_gemname}/${_gemname}"
license=('GPL')
depends=('ruby')
if [ -z "$_bootstrap" ]; then
depends+=('ruby-power_assert')
makedepends=('ruby-rdoc')
fi
options=('!emptydirs')
source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('0788871faeb9d9c9e2a07cf4cae7b63d9520ff1e1be831889861c9d76b10bd6f59a60c0417c7b5ae97856bfd1c75cffd4e1c9a006f7a0c651432196733aa0f08')
# fix wrong license identifier to match the official ones from https://spdx.org/licenses/
prepare() {
cd "${_gemname}-${pkgver}"
sed --in-place 's/spec.licenses.*/spec.licenses = ["BSD-2-Clause", "PSF-2.0", "Ruby"]/' "${_gemname}.gemspec"
}
build() {
cd "${_gemname}-${pkgver}"
gem build "${_gemname}.gemspec"
}
check() {
cd "${_gemname}-${pkgver}"
ruby test/run-test.rb
}
package() {
cd "${_gemname}-${pkgver}"
local _gemdir="$(gem env gemdir)"
gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
rm -rf "${pkgdir}/${_gemdir}/cache"
install -Dm 644 README.md doc/text/* -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm 644 BSDL COPYING PSFL -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim: ts=2 sw=2 et: