addpkg: ruby-method_source 1.0.0-1

This commit is contained in:
George Rawlinson 2021-07-31 06:06:37 +00:00
parent f4c981e462
commit a54bc7d868
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -0,0 +1,45 @@
# 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
}