forked from BlackArch/blackarch-pkgbuilds
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKGBUILD-ruby-lib-gem
36 lines (28 loc) · 1.14 KB
/
PKGBUILD-ruby-lib-gem
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
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
pkgname=ruby-NAME
_gemname=${pkgname#ruby-}
pkgver=VERSION
pkgrel=1
pkgdesc='Short description without using the package name itself.'
arch=('any' OR 'x86_64' 'aarch64')
groups=('blackarch' MORE_BLACKARCH_GROUPS_HERE)
url='URL pointing to download section of package'
license=('WHATEVER' OR 'custom:unknown')
depends=('ruby')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=()
package() {
cd $_gemname
_gemdir="$(ruby -e'puts Gem.default_dir')"
gem install --ignore-dependencies --no-user-install --no-document \
-i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
rm "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
rm -r "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/test"
find "$pkgdir/$_gemdir/extensions/" -name *.so -delete
# Only install license if required according to
# https://wiki.archlinux.org/index.php/PKGBUILD#license
install -Dm 644 "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/LICENSE.txt" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}