arch-pkgs/ruby-regexp_parser/PKGBUILD
2022-02-12 01:02:22 +00:00

45 lines
1.4 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=regexp_parser
pkgname=ruby-$_gemname
pkgver=2.2.1
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=('bb757d197aec8a1c3740ceaf54d44308639af5161564e6f5937fdae16ef358fef6d26fd65b2c549b7b3e5d1c5309b869940aae67379301c9044013e6469b6545')
b2sums=('bab842c83c2c1a7fd579d8e740ef7455448b58ddd645315dffe5cd0d0969e5eeb3e93d2987aac8c95ff3b3aee30233488ed62453cd49fe61431706546f4efd10')
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
# 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
}