arch-pkgs/ruby-formatador/PKGBUILD
2022-01-26 16:35:47 +00:00

46 lines
1.3 KiB
Bash

# Maintainer: Mario Finelli <mario at finel dot li>
_gemname=formatador
pkgname=ruby-$_gemname
pkgver=1.1.0
pkgrel=1
pkgdesc="STDOUT text formatting"
arch=('any')
url="https://github.com/geemus/formatador"
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('4f0056954b997b29c6a03500840c6047f2f4b61c9e70d7620ba33d0efa97be75e4918ca0e66b8b72e96106b145cd318c266f5d7a0b9ba7617d64a9d002b52abc')
b2sums=('3f5bf0021e118f4f7195dae6b72a73d278ec2260e15ba31edd026505ea5eb12160bb6bf6927ff4769e5f1008b1ad53cc94b5d2fb2e41be89995c470f914fb767')
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"
rm -vrf "$_gemname.gemspec" tests Rakefile Gemfile
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.md
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" *.md changelog.txt
}