2021-07-24 10:00:43 +00:00
|
|
|
# Maintainer: George Rawlinson <george@rawlinson.net.nz>
|
|
|
|
|
2022-06-15 00:46:29 +00:00
|
|
|
pkgname=ruby-oj
|
|
|
|
_gemname="${pkgname#ruby-}"
|
2022-08-20 00:33:10 +00:00
|
|
|
pkgver=3.13.21
|
2021-07-24 10:00:43 +00:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc='The fastest JSON parser and object serializer'
|
|
|
|
arch=('x86_64')
|
|
|
|
url='https://github.com/ohler55/oj'
|
|
|
|
license=('MIT')
|
|
|
|
depends=('ruby')
|
2021-08-10 00:09:31 +00:00
|
|
|
makedepends=('ruby-rdoc')
|
2021-07-24 10:00:43 +00:00
|
|
|
options=(!emptydirs)
|
|
|
|
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
|
|
|
|
noextract=("$_gemname-$pkgver.gem")
|
2022-08-20 00:33:10 +00:00
|
|
|
sha512sums=('9a1429cf6197a1ab7b679185dc48570d17bc387e1d62bf0758b36797976ba60c9fca0680af3b64c0b4e1c8e873fe4a892018f571644650fa32bd67a4d03a0c05')
|
|
|
|
b2sums=('70dd1f05e32f906069d6e32d8a5679adfc2f14dfbb10a334eff3dda6754454f5742631f1b00e39ef34f941f6506e867c2601e5c870686f46dc064bdfd50d15fb')
|
2021-07-24 10:00:43 +00:00
|
|
|
|
|
|
|
package() {
|
|
|
|
local _gemdir="$(ruby -e'puts Gem.default_dir')"
|
|
|
|
|
|
|
|
gem install \
|
2021-08-10 00:09:31 +00:00
|
|
|
--verbose \
|
2021-07-24 10:00:43 +00:00
|
|
|
--ignore-dependencies \
|
2021-09-12 08:19:51 +00:00
|
|
|
--no-document \
|
2021-07-24 10:00:43 +00:00
|
|
|
--no-user-install \
|
|
|
|
--install-dir "$pkgdir/$_gemdir" \
|
|
|
|
--bindir "$pkgdir/usr/bin" \
|
|
|
|
"$_gemname-$pkgver.gem"
|
|
|
|
|
|
|
|
# delete cache
|
|
|
|
cd "$pkgdir/$_gemdir"
|
2021-08-10 00:09:31 +00:00
|
|
|
rm -vrf cache
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2021-08-10 00:09:31 +00:00
|
|
|
# delete unnecessary files & folders
|
2021-08-16 22:55:22 +00:00
|
|
|
rm -vrf "extensions/$CARCH-linux/$(basename $_gemdir)/$_gemname-$pkgver/gem_make.out"
|
2021-07-24 10:00:43 +00:00
|
|
|
cd "gems/$_gemname-$pkgver"
|
2021-08-10 00:09:31 +00:00
|
|
|
rm -vrf test ext
|
|
|
|
|
2021-07-24 10:00:43 +00:00
|
|
|
# move documentation
|
|
|
|
install -vd "$pkgdir/usr/share/doc/$pkgname"
|
2021-09-12 08:19:51 +00:00
|
|
|
mv -v *.md pages "$pkgdir/usr/share/doc/$pkgname"
|
2021-08-10 00:09:31 +00:00
|
|
|
|
2021-07-24 10:00:43 +00:00
|
|
|
# license
|
|
|
|
install -vd "$pkgdir/usr/share/licenses/$pkgname"
|
2021-08-10 00:09:31 +00:00
|
|
|
mv -v LICENSE "$pkgdir/usr/share/licenses/$pkgname"
|
2021-09-12 08:19:51 +00:00
|
|
|
|
|
|
|
# generate reproducible documentation
|
|
|
|
install -vd "$pkgdir/$_gemdir/doc/$_gemname-$pkgver"
|
|
|
|
cd "$pkgdir/$_gemdir/gems/$_gemname-$pkgver"
|
|
|
|
rdoc \
|
|
|
|
--format ri \
|
|
|
|
--output "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri" \
|
|
|
|
./lib
|
2022-07-19 21:55:46 +00:00
|
|
|
|
2021-09-12 08:19:51 +00:00
|
|
|
# delete unnecessary rdoc metadata file
|
|
|
|
rm -f "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri/created.rid"
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|