arch-pkgs/ruby-coderay/PKGBUILD

42 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=coderay
pkgname=ruby-$_gemname
pkgver=1.1.3
pkgrel=1
pkgdesc="Fast syntax highlighting for selected languages"
arch=('any')
url="https://github.com/rubychan/coderay"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('2efb285ae1eeef67367959f918ee27aed8ce404cfef28af23475a0ec62ffec7d3e9f2b5a6b81bf6c7088214b344b799662ed0928bd98687cfd5def739c2542e3')
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
cd "gems/$_gemname-$pkgver"
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" README_INDEX.rdoc
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -v MIT-LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}