summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 343ea993be455ab28932e4fb555e23d47ac31510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

_gemname=tty-command
pkgname=ruby-$_gemname
pkgver=0.10.1
pkgrel=1
pkgdesc="Execute shell commands with pretty logging"
arch=('any')
url="https://github.com/piotrmurach/tty-command"
license=('MIT')
depends=('ruby' 'ruby-pastel')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('375eed9d9b279664211b49e056e75afd6924571edc50035853f666ad2befac3ef251c803bec0733bd26a6344e1bd8b4650b4f8c33bc7f423fd67823069d62807')

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
}