arch-pkgs/ruby-yajl-ruby/PKGBUILD

48 lines
1.5 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=ruby-yajl-ruby
_gemname="${pkgname#ruby-}"
pkgver=1.4.3
pkgrel=1
pkgdesc='C binding to the excellent YAJL JSON parsing and generation library'
arch=('x86_64')
url='https://github.com/brianmario/yajl-ruby'
license=('MIT')
depends=('ruby')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('8cfde677f11ad80a468dce7876b97aa87fa35d78fcd727d4542e00c09cc28d1cca3301cf7c4e1f773edf2192262ec8d6ffab93b11d488d2b048d8013f6c7645a')
b2sums=('f4ea86014ed7570530e77ba4a2c67bf39c998b816f6100a526406b62ee8c30bb3b7be61853432cd1f6febdc19b20596915a242b2f47645da734b21f2a2c879c3')
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 -rf cache
# delete unnecessary files & folders
rm -vrf "extensions/$CARCH-linux/$(basename $_gemdir)/$_gemname-$pkgver/gem_make.out"
cd "gems/$_gemname-$pkgver"
find . -type f -name ".*" -delete
rm -vrf \
.github ext spec script tasks benchmark examples \
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
}