summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9c79febbd6f0838ec22c6513e71ec01df93ff557 (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
42
43
44
45
46
47
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Haochen Tong <i at hexchain dot org>

_gemname=binman
pkgname=ruby-$_gemname
pkgver=5.1.0
pkgrel=2
pkgdesc="Produces UNIX manual pages for executable scripts"
arch=('any')
url="https://github.com/sunaku/binman"
license=('ISC')
depends=('ruby' 'ruby-opener')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('1ee74ba77c6f92f815d876dfded6fa236b79d56599cfb201b63f0ecb2e4a9254a38a69c656f8328c5902db0b29d66ef1e17b23d60ff651a6e62f96fb32519b81')

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

  # remove unnecessary files
  cd "gems/$_gemname-$pkgver"
  rm -f .gitignore

  # move documentation
  install -vd "$pkgdir/usr/share/doc/$pkgname"
  mv -vt "$pkgdir/usr/share/doc/$pkgname" \
    README.markdown VERSION.markdown

  # move license
  install -vd "$pkgdir/usr/share/licenses/$pkgname"
  mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}