addpkg: ruby-tty-which 0.4.2-1

This commit is contained in:
George Rawlinson 2021-07-29 08:56:32 +00:00
parent ed50a591b2
commit 7559096be9
Signed by: grawlinson
GPG Key ID: E0959FEA8B550539
1 changed files with 41 additions and 0 deletions

41
ruby-tty-which/PKGBUILD Normal file
View File

@ -0,0 +1,41 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=tty-which
pkgname=ruby-$_gemname
pkgver=0.4.2
pkgrel=1
pkgdesc="Cross-platform implementation of Unix 'which' command"
arch=('any')
url="https://github.com/piotrmurach/tty-color"
license=('MIT')
depends=('ruby')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('9701534985a9fef2d2c6fee14cb8e1e817757b4e1e1504d4f5efcf8c1c01b41d3adf6d57ded84ac01190966e3fd96fd1cf5e85ebbdb6f03ebc4e18b7a6086c0b')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--ignore-dependencies \
--no-user-install \
--no-document \
--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
}