arch-pkgs/ruby-rubocop-ast/PKGBUILD

43 lines
1.3 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=ruby-rubocop-ast
_gemname="${pkgname#ruby-}"
pkgver=1.19.1
pkgrel=1
pkgdesc="RuboCop's AST extensions and Node/NodePattern functionality"
arch=('any')
url='https://github.com/rubocop/rubocop-ast'
license=('MIT')
depends=('ruby' 'ruby-parser')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('d2709c30b3e9a512571871a7d6f84390dd6db67a5d26ec5667c5ce533c0e983240c185febd2e1ef2b92678b8aa19815ead965ca792b45b551b61f18c29c1f3f1')
b2sums=('7f62acf07eadf2e0f3ac077b2c8682506461e122e01d4ba343f4880e7e2714d27de1da00b8c8d027913076729d82b1f467142f716d645e6564b55be170c3a679')
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.md
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}