archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-brass / trunk / PKGBUILD
blobe00abb3731c58c6581f0811fb6c0eb02b4cb2daf
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-brass
4 pkgver=1.2.1
5 pkgrel=2
6 pkgdesc='Bare-Metal Ruby Assertions System Standard'
7 arch=(any)
8 url='https://github.com/rubyworks/brass'
9 license=(BSD)
10 depends=(ruby)
11 checkdepends=(ruby-lemon ruby-rubytest-cli ruby-simplecov)
12 options=(!emptydirs)
13 source=(https://github.com/rubyworks/brass/archive/$pkgver/$pkgname-$pkgver.tar.gz)
14 sha256sums=('8f3f97e35014753155ccbc91c64543012628cdfebb0593550e46abb78973ee8c')
16 prepare() {
17   cd brass-$pkgver
18   sed -e '1i require "simplecov"' \
19       -e "/cov.coverage_dir/d" \
20       -i .test
23 build() {
24   local _gemdir="$(gem env gemdir)"
25   cd brass-$pkgver
26   gem build .gemspec
27   gem install \
28     --local \
29     --verbose \
30     --ignore-dependencies \
31     --no-user-install \
32     --install-dir "tmp_install/$_gemdir" \
33     --bindir "tmp_install/usr/bin" \
34     brass-$pkgver.gem
35   find "tmp_install/$_gemdir/gems/" \
36     -type f \
37     \( \
38         -iname "*.o" -o \
39         -iname "*.c" -o \
40         -iname "*.so" -o \
41         -iname "*.time" -o \
42         -iname "gem.build_complete" -o \
43         -iname "Makefile" \
44     \) \
45     -delete
46   rm -r tmp_install/$_gemdir/cache
49 check() {
50   local _gemdir="$(gem env gemdir)"
51   cd brass-$pkgver
52   GEM_HOME="tmp_install/$_gemdir" rubytest test
55 package() {
56   cd brass-$pkgver
57   cp -a tmp_install/* "$pkgdir"/
58   install -Dm644 COPYING.rdoc -t "$pkgdir"/usr/share/licenses/$pkgname/