rmpkg: ruby-regexp_parser

This commit is contained in:
George Rawlinson 2022-11-13 20:07:29 +13:00
parent 396689dcf4
commit 6a4e526b4e
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -1,46 +0,0 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=ruby-regexp_parser
_gemname="${pkgname#ruby-}"
pkgver=2.6.0
pkgrel=1
pkgdesc='A library for tokenizing, lexing, and parsing Ruby regular expressions'
arch=('any')
url='https://github.com/ammar/regexp_parser'
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('48f76e19cf8fe9d263eaf5441e3a15465ba137821204e876f05be8c1e9c1db1f6ef201107c1767ffcb5f77dfdc5d10886377f87bb2ea2438adf37109a633b48a')
b2sums=('7758a91fb66514e1ef2f60a6ed9a8566731b5b98d3aac35f76d65992b3157c99accb30465881999c13c72d9d7fe68893646fa419c0582a29602ab04e37563e7a')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--local \
--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
# delete unnecessary files & folders
cd "gems/$_gemname-$pkgver"
rm -vrf spec Gemfile Rakefile "$_gemname.gemspec"
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" *.md
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}