archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-async-rest / trunk / PKGBUILD
blobc4d18c025a8abb60a98ea97a72e9e2fd9f3ffb43
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-async-rest
4 pkgver=0.12.4
5 pkgrel=2
6 pkgdesc='A library for RESTful clients (and hopefully servers)'
7 arch=(any)
8 url='https://github.com/socketry/async-rest'
9 license=(MIT)
10 depends=(ruby-async-http ruby-protocol-http)
11 checkdepends=(ruby-async-rspec ruby-bake ruby-covered ruby-rake ruby-rspec)
12 options=(!emptydirs)
13 source=(https://github.com/socketry/async-rest/archive/v$pkgver/$pkgname-$pkgver.tar.gz
14         https://github.com/felixonmars/async-rest/commit/279bf0bd28c7e9a209c95fc0e1b458bf3a494b36.patch)
15 sha256sums=('7aa5959a4684090a6d1d9edb0a74ca1961376160580e815cff8f502ad6b151d6'
16             '0738f594b3671b65a94602af4f4e95150e56e5b2d3f9a0d142a52f5da67fbba4')
18 prepare() {
19   cd async-rest-$pkgver
20   patch -p1 -i ../279bf0bd28c7e9a209c95fc0e1b458bf3a494b36.patch
21   sed -r -e 's|~>|>=|g' -i async-rest.gemspec
22   echo gemspec > gems.rb
25 build() {
26   local _gemdir="$(gem env gemdir)"
27   cd async-rest-$pkgver
28   gem build async-rest.gemspec
29   gem install \
30     --local \
31     --verbose \
32     --ignore-dependencies \
33     --no-user-install \
34     --install-dir "tmp_install/$_gemdir" \
35     --bindir "tmp_install/usr/bin" \
36     async-rest-$pkgver.gem
37   find "tmp_install/$_gemdir/gems/" \
38     -type f \
39     \( \
40         -iname "*.o" -o \
41         -iname "*.c" -o \
42         -iname "*.so" -o \
43         -iname "*.time" -o \
44         -iname "gem.build_complete" -o \
45         -iname "Makefile" \
46     \) \
47     -delete
48   rm -r tmp_install/$_gemdir/cache
51 check() {
52   local _gemdir="$(gem env gemdir)"
53   cd async-rest-$pkgver
54   GEM_HOME="tmp_install/$_gemdir" rspec
57 package() {
58   cd async-rest-$pkgver
59   cp -a tmp_install/* "$pkgdir"/