arch-pkgs/ruby-method_source/PKGBUILD

46 lines
1.3 KiB
Text
Raw Normal View History

2021-07-31 06:06:37 +00:00
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=method_source
pkgname=ruby-$_gemname
pkgver=1.0.0
pkgrel=1
pkgdesc="Retrieve the source code for a method"
arch=('any')
url="https://github.com/banister/method_source"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('1b6b4c23b2e73972acb69bf488f39d88fae3bffdc4e28559d880ce817199b9c1da8183f10cf8be5122535415b938c9f3964c9b4bade1dfba7fb4457c052185dd')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--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 .circleci spec Gemfile Rakefile "$_gemname.gemspec"
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" CHANGELOG.md README.markdown
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}