summaryrefslogtreecommitdiff
path: root/libre/ruby-rdiscount/PKGBUILD
blob: bb413b4d10b7c15fe022dc69da90937d726d11ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net
# Maintainer (AUR): Alexsandr Pavlov <kidoz at mail dot ru>
# Contributor (Arch): Massimiliano Torromeo <massimiliano.torromeo at gmail dot com>

_gemname=rdiscount
pkgname=ruby-$_gemname
pkgver=2.1.7
pkgdesc="C implementation of John Gruber's Markdown."
url="http://dafoster.net/projects/rdiscount/"

license=('BSD3')

pkgrel=1
arch=('i686' 'x86_64' 'mips64el')
depends=('ruby')
makedepends=('rubygems')
source=(http://gems.rubyforge.org/gems/$_gemname-$pkgver.gem)
md5sums=('33fcd949e204dcacff0002e597cdd7e7')
noextract=($_gemname-$pkgver.gem)

package() {
  cd "${srcdir}"
  local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"
  gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" -n "$pkgdir/usr/bin" \
    "$_gemname-$pkgver.gem"

  install -d "$pkgdir"/usr/share/licenses/$pkgname
  ln -sr "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/COPYING \
    "$pkgdir"/usr/share/licenses/$pkgname/COPYING

  shopt -s nullglob
  for file in "$pkgdir$_gemdir"/gems/$_gemname-$pkgver/man/*.{1..8}; do
    install -Dm644 "$file" "$pkgdir"/usr/share/man/man${file##*.}/${file##*/}
  done
}