archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-unicode-version / trunk / PKGBUILD
blobaa9e493634c89aff097a51389a2de6a26ccf6bb9
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
3 pkgname=ruby-unicode-version
4 _pkgname="${pkgname#ruby-}"
5 pkgver=1.3.0
6 pkgrel=1
7 pkgdesc='Returns Unicode/Emoji versions of current and previous Rubies'
8 arch=('any')
9 url='https://github.com/janlelis/unicode-version'
10 license=('MIT')
11 depends=('ruby')
12 makedepends=('git')
13 checkdepends=('ruby-rake' 'ruby-minitest')
14 options=('!emptydirs')
15 _commit='e5016f56648986f96bca4925f010777581980d46'
16 source=("$pkgname::git+$url#commit=$_commit")
17 b2sums=('SKIP')
19 pkgver() {
20   cd "$pkgname"
22   git describe --tags | sed 's/^v//'
25 build() {
26   cd "$pkgname"
28   gem build "$_pkgname.gemspec"
31 check() {
32   cd "$pkgname"
34   rake spec
37 package() {
38   cd "$pkgname"
40   local _gemdir="$(gem env gemdir)"
42   gem install \
43     --local \
44     --verbose \
45     --ignore-dependencies \
46     --no-user-install \
47     --install-dir "$pkgdir/$_gemdir" \
48     --bindir "$pkgdir/usr/bin" \
49     "$_pkgname-$pkgver.gem"
51   # delete cache
52   rm -rf "$pkgdir/$_gemdir/cache"
54   # license
55   install -vd "$pkgdir/usr/share/licenses/$pkgname"
56   ln -sf "$_gemdir/gems/$_pkgname-$pkgver/MIT-LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname"