arch-pkgs/ruby-slop/PKGBUILD

46 lines
1.3 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=ruby-slop
_gemname="${pkgname#ruby-}"
pkgver=4.9.3
pkgrel=1
pkgdesc='A simple option parser with an easy to remember syntax and friendly API'
arch=('any')
url='https://github.com/leejarvis/slop'
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('ad1022f589548265955865fe19c388501c819f8ab703276c662742ef9a9c630eea5c7a713379ff427ab285823513b1d39fc573aa8d7c24c4fea8ef4a9f09dd88')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--local \
--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
# delete unnecessary files & folders
cd "gems/$_gemname-$pkgver"
find . -type f -name ".*" -delete
rm -vrf test "$_gemname.gemspec" Gemfile Rakefile
# 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
}