# Generated by gem2arch (https://github.com/anatol/gem2arch)
# Maintainer (arch): Aoibhinn di Tori <email@aoibh.in>
# Contributor: Artem Vorotnikov <artem@vorotnikov.me>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_gemname=haml
pkgname=ruby-$_gemname
pkgver=5.0.4
pkgdesc='An elegant, structured (X)HTML/XML templating engine.'
url='http://haml.info/'
license=(MIT)

pkgrel=1
arch=(any)
depends=(ruby ruby-tilt)
makedepends=(rubygems git)
options=(!emptydirs)
source=($pkgname-$pkgver.tar.gz::https://github.com/haml/haml/archive/v$pkgver.tar.gz)
sha256sums=('3317a8b2593e5c438c4160f7a5c073184b5a29b6a26654cc357132fc22f027dd')

build() {
  cd "$srcdir/$_gemname-$pkgver"

  gem build $_gemname.gemspec
}

package() {
  cd "$srcdir/$_gemname-$pkgver"

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

  install -Dm644 "$srcdir"/$_gemname-$pkgver/MIT-LICENSE \
                 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
