arch-pkgs/ruby-parallel/PKGBUILD
2022-03-21 19:41:46 +13:00

51 lines
1.6 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Mario Finelli <mario at finel dot li>
# Contributor: Benjamin Chrétien <chretien dot b plus aur at gmail dot com>
_gemname=parallel
pkgname=ruby-$_gemname
pkgver=1.22.0
pkgrel=1
pkgdesc="Ruby: parallel processing made simple and fast"
arch=('any')
url="https://github.com/grosser/parallel"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('a72f5eb646ae91962e622333e4c36f46cd3e4b227b456b821bc86dbbf5a7e2e26a2b173b858bce0a55c663ea3e4eb3802406f1557ad78602be9befe9cfe83230')
b2sums=('3b1d89312141040428f0b62d049c99097a30854f70927dc64fdb921371ce0dfee19db3b62f221e6f571f86c6e03fd15036144f6f991b3f13d5f3bea86b04dbf3')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--verbose \
--ignore-dependencies \
--no-document \
--no-user-install \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
cd "$pkgdir/$_gemdir"
rm -vrf cache
# move license
cd "gems/$_gemname-$pkgver"
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" MIT-LICENSE.txt
# generate reproducible documentation
install -vd "$pkgdir/$_gemdir/doc/$_gemname-$pkgver"
cd "$pkgdir/$_gemdir/gems/$_gemname-$pkgver"
rdoc \
--format ri \
--output "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri" \
./lib
# delete unnecessary rdoc metadata file
rm -f "$pkgdir$_gemdir/doc/$_gemname-$pkgver/ri/created.rid"
}