arch-pkgs/ruby-tty-which/PKGBUILD

42 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=tty-which
pkgname=ruby-$_gemname
pkgver=0.5.0
pkgrel=1
pkgdesc="Cross-platform implementation of Unix 'which' command"
arch=('any')
url="https://github.com/piotrmurach/tty-color"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('505b7671cec9356339c228f3c61ee23d355448ffa3a569dacb8894a0362051a3c874d60f1a64b20e5788ac0999efc1daafdbbece7b689213e5802e54de6c9746')
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" *.md
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}