archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-filelock / trunk / PKGBUILD
blobd4ffcd94f2bd540d82ed86f63c0938e08e656f0b
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=ruby-filelock
4 pkgver=1.1.1
5 _commit=7e5efd7bb8ef8513f4a8d39f738d6dcb4310addf
6 pkgrel=2
7 pkgdesc='Heavily tested yet simple filelocking solution using flock'
8 arch=(any)
9 url='https://github.com/sheerun/filelock'
10 license=(MIT)
11 depends=(ruby)
12 makedepends=(git)
13 checkdepends=(ruby-rspec)
14 options=(!emptydirs)
15 source=(git+https://github.com/sheerun/filelock.git#commit=$_commit)
16 sha256sums=('SKIP')
18 prepare() {
19   cd filelock
20   # https://github.com/sheerun/filelock/pull/17
21   git cherry-pick -n 86ca5bc5a38c126a5e9262a7b10251fa79f7c118
24 build() {
25   local _gemdir="$(gem env gemdir)"
26   cd filelock
27   gem build filelock.gemspec
28   gem install \
29     --local \
30     --verbose \
31     --ignore-dependencies \
32     --no-user-install \
33     --install-dir "tmp_install/$_gemdir" \
34     --bindir "tmp_install/usr/bin" \
35     filelock-$pkgver.gem
36   find "tmp_install/$_gemdir/gems/" \
37     -type f \
38     \( \
39         -iname "*.o" -o \
40         -iname "*.c" -o \
41         -iname "*.so" -o \
42         -iname "*.time" -o \
43         -iname "gem.build_complete" -o \
44         -iname "Makefile" \
45     \) \
46     -delete
47   rm -r tmp_install/$_gemdir/cache
50 check() {
51   local _gemdir="$(gem env gemdir)"
52   cd filelock
53   GEM_HOME="tmp_install/$_gemdir" rspec
56 package() {
57   cd filelock
58   cp -a tmp_install/* "$pkgdir"/
59   install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/