addpkg: ruby-kramdown-parser-gfm 1.1.0-2

This commit is contained in:
George Rawlinson 2021-07-24 12:12:41 +00:00
parent c2ed7c9a2a
commit 0de9408c8e
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -0,0 +1,45 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Bert Peters <bert@bertptrs.nl>
_gemname=kramdown-parser-gfm
pkgname=ruby-$_gemname
pkgver=1.1.0
pkgrel=2
pkgdesc="A parser for kramdown that converts Markdown documents in the GFM dialect to HTML."
arch=('any')
url='https://github.com/kramdown/parser-gfm'
license=('MIT')
depends=('ruby' 'ruby-kramdown')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
b2sums=('99a77ea02d0f48421cc6c582629f6cdc7504174867cac8927bdc26fd50f851e294c0f71ab985e9d0d6e595906c458b1f96d06903d6765eabf8b6f617c6303f14')
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--ignore-dependencies \
--no-user-install \
--no-document \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
cd "$pkgdir/$_gemdir"
rm -vrf cache
# remove unnecessary files
cd "gems/$_gemname-$pkgver"
rm -rf test
# move documentation
install -vd "$pkgdir/usr/share/doc/$pkgname"
mv -vt "$pkgdir/usr/share/doc/$pkgname" CONTRIBUTERS VERSION
# move license
install -vd "$pkgdir/usr/share/licenses/$pkgname"
mv -vt "$pkgdir/usr/share/licenses/$pkgname" COPYING
}