git » asciidoctor.git » main » tree

[main] / PKGBUILD

# Maintainer:  Christian Rebischke <chris.rebischke@archlinux.org>
# Maintainer:  Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
# Contributor: Stefan Tatschner <rumpelsepp@sevenbyte.org>
# Contributor: Nick Østergaard <oe.nick at gmail dot com>
# Contributor: Nicolas Bigaouette <nbigaouette@chemcomp.com>

pkgname='asciidoctor'
pkgver=2.0.21
pkgrel=1
pkgdesc='An implementation of AsciiDoc in Ruby'
arch=('any')
url='https://asciidoctor.org'
license=('MIT')
makedepends=('ruby-rdoc')
depends=('ruby')
options=('!emptydirs')
source=("https://rubygems.org/downloads/${pkgname}-${pkgver}.gem")
noextract=("$pkgname-$pkgver.gem")
sha512sums=('3fe064d9b00c84ff81803c0645ae522fa66b253b93957b4fe567a240ea77af5a94a47aae04fda4207e698d76f21b2a9bcd44daca388960cfd1cc4f24d03606f0')

package() {
    local _gemdir="$(ruby -e 'puts Gem.default_dir')"

    gem install --ignore-dependencies --no-user-install --verbose \
        -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" \
        "$pkgname-$pkgver.gem"

    install -Dm644 "$pkgdir/$_gemdir/gems/$pkgname-$pkgver/LICENSE" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 "$pkgdir/$_gemdir/gems/$pkgname-$pkgver/man/asciidoctor.1" \
        "$pkgdir/usr/share/man/man1/asciidoctor.1"

    rm "$pkgdir/$_gemdir/cache/$pkgname-$pkgver.gem"
    rm -rf "$pkgdir/$_gemdir/gems/$pkgname-$pkgver/man"
}