i've found a way to build current rpms for fedora-12.
Here a short howto:
0. First install a source rpm (
ftp://sftp.mudynamics.com/pub/ruby1....p129-3.src.rpm) from
labs.mudynamics.com, where Aaron made a nice rpm-spec file, that is the basis.
1. Download the actual source from the ruby developement page
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9....1-p376.tar.gz
2. You need the rpmbuild-tools:
yum install rpm-build
3. If you have just yum by the hand, install tcl/tk-devel, if happened not jet:
yum install tcl-devel tk-devel
4. now unpack the ruby source files:
tar -xzf ruby-1.9.1-p376.tar.gz
5. Because of Fedora-12 you need a patch for openssl. RedHat went to Version 1.0.0 beta. I've got the Patch from :
http://redmine.ruby-lang.org/issues/show/2022
The Patch can't used directly. The following changes are necessary:
Here is the diff to show the changes i've made:
diff ruby-openssl-1.0.patch my-ruby-openssl-1.0.patch
1,3c1,3
< diff -up ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c.ossl10 ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c
< --- ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c.ossl10 2007-02-13 00:01:19.000000000 +0100
< +++ ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl.c 2009-08-26 12:29:41.000000000 +0200
---
> diff -up ruby-1.9.1-p376/ext/openssl/ossl.c.ossl10 ruby-1.9.1-p376/ext/openssl/ossl.c
> --- ruby-1.9.1-p376/ext/openssl/ossl.c.ossl10 2007-02-13 00:01:19.000000000 +0100
> +++ ruby-1.9.1-p376/ext/openssl/ossl.c 2009-08-26 12:29:41.000000000 +0200
31,33c31,33
< diff -up ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_pkcs7.c.ossl10 ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_pkcs7.c
< --- ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_pkcs7.c.ossl10 2007-02-13 00:01:19.000000000 +0100
< +++ ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_pkcs7.c 2009-08-26 12:53:05.000000000 +0200
---
> diff -up ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c.ossl10 ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c
> --- ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c.ossl10 2007-02-13 00:01:19.000000000 +0100
> +++ ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c 2009-08-26 12:53:05.000000000 +0200
127,129c127,129
< diff -up ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c.ossl10 ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c
< --- ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c.ossl10 2007-03-12 05:12:32.000000000 +0100
< +++ ruby-1.8.6.369/ruby-1.8.6-p369/ext/openssl/ossl_ssl.c 2009-08-26 12:08:48.000000000 +0200
---
> diff -up ruby-1.9.1-p376/ext/openssl/ossl_ssl.c.ossl10 ruby-1.9.1-p376/ext/openssl/ossl_ssl.c
> --- ruby-1.9.1-p376/ext/openssl/ossl_ssl.c.ossl10 2007-03-12 05:12:32.000000000 +0100
> +++ ruby-1.9.1-p376/ext/openssl/ossl_ssl.c 2009-08-26 12:08:48.000000000 +0200
Now you apply the patch:
you have to stay in the same directory where the unpacked ruby sources are:
patch -p0 < my-ruby-openssl-1.0.patch
6. Pack the sources again:
tar -czf ruby-1.9.1-p376.tar.gz ruby-1.9.1-p376/
7. Place the ruby-1.9.1-p376.tar.gz to the directory rpmbuild it wants to expect:
mv ruby-1.9.1-p376.tar.gz /usr/src/redhat/SOURCES/
8. Now it's time to customize your SPEC-file ruby-1.9.1.spec:
cd /usr/src/redhat/SPECS/
Here the difference:
# diff ruby-1.9.1.spec my-ruby-1.9.1.spec
26,28c26,28
< %define V_dist 1.9.1-p129
< %define V_subdir 1.9.1-p129
< %define V_opkg 1.9.1p129
---
> %define V_dist 1.9.1-p376
> %define V_subdir 1.9.1-p376
> %define V_opkg 1.9.1p376
32c32
< %define _patchlevel 129
---
> %define _patchlevel 376
< %{_libdir}/ruby%{rubyxver}/%{rubyver}/json
< %{_libdir}/ruby%{rubyxver}/%{rubyver}/json/pure
---
> %{_libdir}/ruby%{rubyxver}/%{rubyver}/json/*.rb
> #%{_libdir}/ruby%{rubyxver}/%{rubyver}/json/pure
228c228
< %{_libdir}/ruby%{rubyxver}/%{rubyver}/rubygems
---
> %{_libdir}/ruby%{rubyxver}/%{rubyver}/rubygems/*.rb
264,265c264,265
< %{_prefix}/lib/ruby%{rubyxver}/%{rubyver}/%{_normalized_cpu}-%{_target_os}
< %{_prefix}/lib/ruby%{rubyxver}/%{rubyver}/%{_normalized_cpu}-%{_target_os}/enc
---
> #%{_prefix}/lib/ruby%{rubyxver}/%{rubyver}/%{_normalized_cpu}-%{_target_os}
> %{_prefix}/lib/ruby%{rubyxver}/%{rubyver}/%{_normalized_cpu}-%{_target_os}/enc/*.so
341c341
< %{_datadir}/ri
---
> %{_datadir}/ri1.9
9. We are ready to build the rpms:
rpmbuild -bb ./my-ruby-1.9.1.spec
10.The RPM files you can find in
/usr/src/redhat/RPMS/i686.
Install using:
rpm -ivh /usr/src/redhat/RPMS/i686/*.rpm
You can install the ruby1.9 rpm files parallel to ruby1.8.x. To call the ruby1.9 executables you have to append 1.9, for instance
/usr/bin/ruby1.9.