arch-pkgs/ruby-ast/PKGBUILD

42 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=ast
pkgname=ruby-$_gemname
pkgver=2.4.2
pkgrel=1
pkgdesc="A small library for working with immutable abstract syntax trees"
arch=('any')
url="https://github.com/whitequark/ast"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('3317475dd7823f407f5c8cbf2f06486228566f2dd5d434b5f533001a7cfbf09169e510e86f807e9aa0cb240ee28d518aaa326990b3c1b21c83879461f1869d6a')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--verbose \
--ignore-dependencies \
--no-user-install \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
cd "$pkgdir/$_gemdir"
rm -vrf cache
cd "gems/$_gemname-$pkgver"
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" README.YARD.md
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.MIT
}