archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-sus / trunk / PKGBUILD
blob31b8aeb12f713f2d03f8b38bd8d04dabb6528508
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-sus
4 pkgver=0.20.3
5 _commit=90aee726d033670bfd179c1d6ca4302316514476
6 pkgrel=1
7 pkgdesc='A fast and scalable test runner'
8 arch=(any)
9 url='https://github.com/ioquatix/sus'
10 license=(MIT)
11 depends=(ruby)
12 makedepends=(git)
13 checkdepends=(ruby-bake-test ruby-bake-test-external ruby-covered)
14 options=(!emptydirs)
15 source=(git+https://github.com/ioquatix/sus.git#commit=$_commit)
16 sha256sums=('SKIP')
18 prepare() {
19   cd sus
20   sed -r -e 's|~>|>=|g' -e '/signing_key/d' -i sus.gemspec
21   echo gemspec > gems.rb
24 build() {
25   local _gemdir="$(gem env gemdir)"
26   cd sus
27   gem build sus.gemspec
28   gem install \
29     --local \
30     --verbose \
31     --ignore-dependencies \
32     --no-user-install \
33     --install-dir "tmp_install/$_gemdir" \
34     --bindir "tmp_install/usr/bin" \
35     sus-$pkgver.gem
36   find "tmp_install/$_gemdir/gems/" \
37     -type f \
38     \( \
39         -iname "*.o" -o \
40         -iname "*.c" -o \
41         -iname "*.so" -o \
42         -iname "*.time" -o \
43         -iname "gem.build_complete" -o \
44         -iname "Makefile" \
45     \) \
46     -delete
47   rm -r tmp_install/$_gemdir/cache
50 check() {
51   local _gemdir="$(gem env gemdir)"
52   cd sus
53   PATH="$PWD/tmp_install/usr/bin:$PATH" GEM_HOME="tmp_install/$_gemdir" bake test
56 package() {
57   cd sus
58   cp -a tmp_install/* "$pkgdir"/
59   install -Dm644 license.md -t "$pkgdir"/usr/share/licenses/$pkgname/