arch-pkgs/ruby-oj/PKGBUILD
2021-08-31 23:34:06 +00:00

45 lines
1.2 KiB
Bash

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
_gemname=oj
pkgname=ruby-$_gemname
pkgver=3.13.3
pkgrel=1
pkgdesc='The fastest JSON parser and object serializer'
arch=('x86_64')
url='https://github.com/ohler55/oj'
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=(!emptydirs)
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('a183599bb6f90750e32d58c56a4c1497243c55efe28ccce5d78f7f84f72b3f56a205fa7c4de13bfc9c6062000565627256a951e9a5f602690d8abe2eadccc5b5')
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
rm -vrf "extensions/$CARCH-linux/$(basename $_gemdir)/$_gemname-$pkgver/gem_make.out"
cd "gems/$_gemname-$pkgver"
rm -vrf test ext
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -v README.md pages "$pkgdir/usr/share/doc/$pkgname"
# license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -v LICENSE "$pkgdir/usr/share/licenses/$pkgname"
}