addpkg: ruby-ast 2.4.2-1

This commit is contained in:
George Rawlinson 2021-07-31 21:49:58 +00:00
parent 6de48701e0
commit 855be1230f
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

42
ruby-ast/PKGBUILD Normal file
View file

@ -0,0 +1,42 @@
# 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
}