arch-pkgs/ruby-oj/PKGBUILD
2021-07-27 01:09:50 +00:00

41 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
_gemname=oj
pkgname=ruby-$_gemname
pkgver=3.12.2
pkgrel=1
pkgdesc='The fastest JSON parser and object serializer'
arch=('x86_64')
url='https://github.com/ohler55/oj'
license=('MIT')
depends=('ruby')
options=(!emptydirs)
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('f162adce83759520befe19612c4d0125683c555573d2170dc7711f2a43dc4fe3f7b7865294ccc090ba6958f350c1e649f4385fd9934eb423776a452ccdb26c9b')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--ignore-dependencies \
--no-user-install \
--no-document \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
cd "$pkgdir/$_gemdir"
rm -rf cache
cd "gems/$_gemname-$pkgver"
# delete unnecessary folders
rm -rf test ext
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv README.md pages "$pkgdir/usr/share/doc/$pkgname"
# license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv LICENSE "$pkgdir/usr/share/licenses/$pkgname"
}