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>
2022-06-15 00:41:41 +00:00
pkgname=ruby-rubocop
_gemname="${pkgname#ruby-}"
2022-08-25 09:02:17 +00:00
pkgver=1.35.1
2021-08-04 01:28:22 +00:00
pkgrel=1
2022-06-15 00:41:41 +00:00
pkgdesc='A Ruby static code analyzer and formatter'
2021-08-04 01:28:22 +00:00
arch=('any')
2022-06-15 00:41:41 +00:00
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")
2022-08-25 09:02:17 +00:00
sha512sums=('de1d93badfd124772dbee7bc9d0c9b8ee7b5803b3393bbb01230f778a4af06c0a769920b066643062aa3640275793df73532de841ab250a9748c972a23e935d9')
b2sums=('00fe21f92b01ef0d87f55ba08a24cc1f7dc95ec671709defe36f490f08582035ba8b781cc55ccd2f20776caf9c50ac0b2e6cc6852a7b45cc4005ec6709442bfd')
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
}