archrelease: copy trunk to community-any
[arch-community.git] / ruby-shellany / trunk / PKGBUILD
blob74282c242f17996da2d213a0d7edd9412198e5a9
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-shellany
4 pkgver=0.0.1
5 _commit=4a9e0d4e23001ae97820af186a9b40df371ad5df
6 pkgrel=2
7 pkgdesc='MRI+JRuby compatible command output capturing'
8 arch=(any)
9 url='https://github.com/guard/shellany'
10 license=(MIT)
11 depends=(ruby)
12 makedepends=(git ruby-nenv ruby-rake ruby-rspec)
13 options=(!emptydirs)
14 source=(git+https://github.com/guard/shellany.git#commit=$_commit)
15 sha256sums=('SKIP')
17 prepare() {
18   cd shellany
19   sed -i '1i require "shellany"' spec/shellany_spec.rb
22 build() {
23   local _gemdir="$(gem env gemdir)"
24   cd shellany
25   gem build shellany.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     shellany-$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 shellany
51   GEM_HOME="tmp_install/$_gemdir" rake
54 package() {
55   cd shellany
56   cp -a tmp_install/* "$pkgdir"/
57   install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/