arch-pkgs/ruby-rubocop/PKGBUILD

67 lines
1.9 KiB
Text
Raw Normal View History

2021-08-04 01:28:22 +00:00
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Mario Finelli <mario at finel dot li>
# Contributor: farwayer <farwayer at gmail dot com>
_gemname=rubocop
pkgname=ruby-$_gemname
2021-10-27 23:14:13 +00:00
pkgver=1.22.3
2021-08-04 01:28:22 +00:00
pkgrel=1
pkgdesc="A Ruby static code analyzer and formatter"
arch=('any')
url="https://rubocop.org"
license=('MIT')
2021-08-04 01:28:22 +00:00
depends=(
'ruby'
'ruby-parallel'
'ruby-parser'
'ruby-rainbow'
'ruby-regexp_parser'
'ruby-rexml'
'ruby-rubocop-ast'
'ruby-ruby-progressbar'
'ruby-unicode-display_width'
)
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
2021-10-27 23:14:13 +00:00
sha512sums=('9c5d67abb2f134d4c8cb8f665cc9c46ff337b711e37bb03d50c2a8142e30069e7950d84fce83ef09e7913b80fd1a86d7623f9910e8018b6c1d5affcc556c9697')
b2sums=('b15f0ca76ac994690ca64bb47d405dbd520736a23a5ed81eace70a9aebff5ec7d60aa5172e993852abf3b18a1d83fe44cb9022f1ac964a3dbb9a3f61f6fb8523')
2021-08-04 01:28:22 +00:00
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--verbose \
--ignore-dependencies \
--no-document \
2021-08-04 01:28:22 +00:00
--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
# generate reproducible documentation
install -vd "$pkgdir/$_gemdir/doc/$_gemname-$pkgver"
cd "$pkgdir/$_gemdir/gems/$_gemname-$pkgver"
rdoc \
--format ri \
--output "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri" \
./lib
# delete unnecessary rdoc metadata file
rm -f "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri/created.rid"
2021-08-04 01:28:22 +00:00
}