archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-minitest-rg / repos / community-any / PKGBUILD
blobc85d017d7876349c6735a7eae661c3b9cadb10a3
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-minitest-rg
4 pkgver=5.2.0
5 pkgrel=1
6 pkgdesc='Colored red/green output for Minitest'
7 arch=(any)
8 url='https://github.com/blowmage/minitest-rg'
9 license=(MIT)
10 depends=(ruby-minitest)
11 checkdepends=(ruby-hoe ruby-rake)
12 options=(!emptydirs)
13 source=(https://github.com/blowmage/minitest-rg/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
14 sha256sums=('49a4a7a27ac8be745ea250fce98c1660f39405b2c9d9fa22fafa322207b918d5')
16 prepare() {
17   cd minitest-rg-$pkgver
18   sed -i "s/s\\.version = .*/s\\.version = \"$pkgver\"/" minitest-rg.gemspec
19   sed -i "s|self.urls        = \['http://blowmage.com/minitest-rg'\]|self.homepage    = 'http://blowmage.com/minitest-rg'|" Rakefile
22 build() {
23   local _gemdir="$(gem env gemdir)"
24   cd minitest-rg-$pkgver
25   gem build minitest-rg.gemspec
26   gem install \
27     --local \
28     --verbose \
29     --ignore-dependencies \
30     --no-user-install \
31     --install-dir "tmp_install/$_gemdir" \
32     --bindir "tmp_install/usr/bin" \
33     minitest-rg-$pkgver.gem
34   find "tmp_install/$_gemdir/gems/" \
35     -type f \
36     \( \
37         -iname "*.o" -o \
38         -iname "*.c" -o \
39         -iname "*.so" -o \
40         -iname "*.time" -o \
41         -iname "gem.build_complete" -o \
42         -iname "Makefile" \
43     \) \
44     -delete
45   rm -r tmp_install/$_gemdir/cache
48 check() {
49   local _gemdir="$(gem env gemdir)"
50   cd minitest-rg-$pkgver
51   GEM_HOME="tmp_install/$_gemdir" rake || echo "Tests failed"
54 package() {
55   cd minitest-rg-$pkgver
56   cp -a tmp_install/* "$pkgdir"/
57   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/