archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / ruby-patron / trunk / PKGBUILD
blob069b50784d340e6bc8aa9b130fe0cdc6863a3ccf
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-patron
4 pkgver=0.13.3
5 _commit=6828083e8db2d2c5f7ea1db7143a9e1a9d13ef78
6 pkgrel=2
7 pkgdesc='Ruby HTTP client library based on libcurl'
8 arch=(x86_64)
9 url='https://github.com/toland/patron'
10 license=(MIT)
11 depends=(ruby curl)
12 makedepends=(git ruby-rake-compiler ruby-rack ruby-rspec ruby-puma ruby-yard)
13 options=(!emptydirs)
14 source=(git+https://github.com/toland/patron.git#commit=$_commit
15         $pkgname-puma-5.patch)
16 sha256sums=('SKIP'
17             '85977d0082234adb7b31308c4338f870a6ae30c3f2182c81d7c1736c33c0dc25')
19 prepare() {
20   cd patron
21   patch -p1 -i ../$pkgname-puma-5.patch
22   # we don't do version pinning
23   sed -r -e 's|~>|>=|g' -i patron.gemspec
26 build() {
27   local _gemdir="$(gem env gemdir)"
28   cd patron
29   rake build
30   gem install \
31     --local \
32     --verbose \
33     --ignore-dependencies \
34     --no-user-install \
35     --install-dir "tmp_install/$_gemdir" \
36     --bindir "tmp_install/usr/bin" \
37     pkg/patron-$pkgver.gem
38   find "tmp_install/$_gemdir/gems/" \
39     -type f \
40     \( \
41         -iname "*.o" -o \
42         -iname "*.c" -o \
43         -iname "*.so" -o \
44         -iname "*.time" -o \
45         -iname "gem.build_complete" -o \
46         -iname "Makefile" \
47     \) \
48     -delete
51 check() {
52   local _gemdir="$(gem env gemdir)"
53   cd patron
54   # https://github.com/toland/patron/pull/193
55   GEM_HOME="tmp_install/$_gemdir" rake spec || echo "Tests failed"
58 package() {
59   cd patron
60   cp -a tmp_install/* "$pkgdir"/
62   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/