git » ruby-rake-compiler.git » main » tree

[main] / PKGBUILD

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=rake-compiler
pkgname=ruby-${_gemname}
pkgver=1.2.5
pkgrel=1
pkgdesc='Rake-based Ruby Extension (C, Java) task generator'
url='https://github.com/rake-compiler/rake-compiler'
arch=('any')
license=('MIT')
depends=('ruby' 'rubygems' 'ruby-rake')
#makedepends=('ruby-rdoc')
options=('!emptydirs')
source=(https://github.com/rake-compiler/rake-compiler/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz)
sha512sums=('843b9286f874b487f23a3558b0a7565eea5e2a22144a8ece944b4b69d40945eee16cca8341e2ea3678418df7f36637574c6832899215676ca3294ae61b24ff5a')
b2sums=('9f619026574467e6abd31a449f1825c49e0df691b1f139c7a8829a9361df3401bab65312303ab7a566eaf73f4a3a6b78674c73abe6f1cc72d1f1bbb6f619e51a')

prepare() {
  cd ${_gemname}-${pkgver}
  sed -r 's|~>|>=|g' -i ${_gemname}.gemspec
  su -c "pacman -S --noconfirm --overwrite='*' ruby-rdoc"
}

build() {
  cd ${_gemname}-${pkgver}
  gem build ${_gemname}.gemspec
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" \
    -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md History.md -t "${pkgdir}/usr/share/doc/${pkgname}"

  cd "${pkgdir}/${_gemdir}"
  rm -rf cache gems/${_gemname}-${pkgver}/{ext,lib/*/*.so} \
    extensions/*/*/${_gemname}-${pkgver}/{mkmf.log,gem_make.out}
}

# vim: ts=2 sw=2 et: