addpkg: ruby-formatador 0.3.0-1

This commit is contained in:
George Rawlinson 2021-07-31 00:42:35 +00:00
parent 7e921cc053
commit 38ef67cb68
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

45
ruby-formatador/PKGBUILD Normal file
View file

@ -0,0 +1,45 @@
# Maintainer: Mario Finelli <mario at finel dot li>
_gemname=formatador
pkgname=ruby-$_gemname
pkgver=0.3.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")
b2sums=('228773d700810c5fa0b40b589bf0180346baf9b46cd2c87394def5a69e29a062db3de8c95b03351a87dadcd33d2d91a2fe2f6aa0bc76e5e5ef4ce05cdf495e1c')
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
}