archrelease: copy trunk to community-any
[arch-community.git] / ruby-unindent / trunk / PKGBUILD
blob990f0711f2a7c1d5c757c42c944072eac9d1360e
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-unindent
4 pkgver=1.0
5 pkgrel=1
6 pkgdesc='Ruby method to unindent strings'
7 arch=(any)
8 url='https://github.com/mynyml/unindent'
9 license=(MIT)
10 depends=(ruby)
11 makedepends=(ruby-nanotest ruby-rake)
12 options=(!emptydirs)
13 source=(https://github.com/mynyml/unindent/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
14 sha256sums=('2d8457406a66d821f458385a51aabd4f77ff19eb53687a38b309d51ab15f080d')
16 prepare() {
17   cd unindent-$pkgver
18   # https://github.com/mynyml/unindent/pull/2
19   sed -i 's/-rubygems//' Rakefile
22 build() {
23   local _gemdir="$(gem env gemdir)"
24   cd unindent-$pkgver
25   gem build unindent.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     unindent-$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 unindent-$pkgver
51   GEM_HOME="tmp_install/$_gemdir" rake
54 package() {
55   cd unindent-$pkgver
56   cp -a tmp_install/* "$pkgdir"/
57   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/