updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / ruby-latest-rubygems / PKGBUILD
blob4450472d355d8249d68c70b0dd86ae53c9158d80
1 # Maintainer: Peter Lewis <plewis@aur.archlinux.org>
2 # Contributor: Allan McRae <allan@archlinux.org>
3 # Contributor: John Proctor <jproctor@prium.net>
4 # Contributor: Jeramy Rutley <jrutley@gmail.com>
6 _pkgname=ruby
7 pkgname=ruby-latest-rubygems
8 pkgver=1.9.3_p0
9 _rubygems_pkgver=1.8.11
10 pkgrel=1
11 pkgdesc="An object-oriented language for quick and easy programming, with updated rubygems"
12 arch=('i686' 'x86_64')
13 url="http://www.ruby-lang.org/en/"
14 license=('custom')
15 depends=('openssl' 'libffi' 'libyaml')
16 provides=('ruby= 1.9.2_p180' 'rubygems' 'rake')
17 conflicts=('ruby' 'rake')
18 optdepends=('tk: for Ruby/TK')
19 makedepends=('openssl' 'tk' 'libffi' 'doxygen' 'graphviz')
20 options=('!emptydirs' '!makeflags')
21 source=("ftp://ftp.ruby-lang.org/pub/${_pkgname}/${pkgver%.*}/${_pkgname}-${pkgver//_/-}.tar.bz2"
22         "http://production.cf.rubygems.org/rubygems/rubygems-${_rubygems_pkgver}.tgz"
23         "rubygems-use-std-dir.patch")
24 sha1sums=('f63c116411b981ef54c2caeefb9ccc4d71a5d2cf'
25           '88677a3443d6becdc0cde540d73304bdfb88fe11'
26           'a014ecf0768ee855b5efc4443722b327a6299f47')
28 build() {
29   cd "${srcdir}/${_pkgname}-${pkgver//_/-}"
30   ./configure --prefix=/usr \
31       --sysconfdir=/etc \
32       --enable-shared \
33       --enable-pthread \
34       --disable-rpath
35   make
38 package() {
39   cd "${srcdir}/${_pkgname}-${pkgver//_/-}"
40   make DESTDIR="${pkgdir}" install-nodoc
41   install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
43   # This would be a nicer option, but I can't get the env variables right...
44   #cd "${pkgdir}"
45   #./usr/bin/gem install rubygems-update -i "${pkgdir}/usr/lib/ruby/gems/1.9.1" -n "${pkgdir}/usr/bin"
46   #GEM_PATH="${pkgdir}/usr/lib/ruby/gems/1.9.1" ./usr/bin/update_rubygems --prefix="${pkgdir}/usr/lib/ruby/1.9.1"
47   #./usr/bin/gem uninstall rubygems-update -i "${pkgdir}/usr/lib/ruby/gems/1.9.1" -n "${pkgdir}/usr/bin" -x
49   cd "${srcdir}/rubygems-${_rubygems_pkgver}"
50   
51   # This works if setup_command.rb is patched to use standard ruby install paths
52   patch -p0 < "../rubygems-use-std-dir.patch"
54   RUBYLIB="${pkgdir}/usr/lib/ruby/1.9.1:${pkgdir}/usr/lib/ruby/1.9.1/${CARCH}-linux" LD_LIBRARY_PATH="${pkgdir}/usr/lib":$LD_LIBRARY_PATH "${pkgdir}/usr/bin/ruby" setup.rb --destdir="${pkgdir}" --prefix="/usr"
56   # The gem binary will have the wrong shebang now, since it uses the ruby it
57   # was called with. Reset it.
58   sed -i 's/#!.*\/usr\/bin\/ruby/#!\/usr\/bin\/ruby/' "${pkgdir}/usr/bin/gem"