arch-pkgs/ruby-regexp_parser/PKGBUILD
2021-12-05 06:28:09 +00:00

45 lines
1.4 KiB
Bash

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