To lever my hype skills (and to please our marketing team, for that matter), I decided to take a look at Ruby on Rails, and to package it for Mandriva.
While it's quite simple to install Rails on Mandriva with gem, it's not easy to build a package, because it requires to install it in a fake root.
Debian installs rails in /usr/share and provides a custom wrapper, but that's quite a huge Debian packaging patch.
openSuse has a patched gem with buildroot support to solve the installation in a fake root.
A crappy solution could be to do something like this:
perl -pe "s,^\s+DESTDIR\s+=.*, DESTDIR = '$RPM_BUILD_ROOT'," %{ruby_archdir}/rbconfig.rb > rbconfig.rb ruby -I . /usr/bin/gem install --ignore-dependencies %{SOURCE0}
But finally, a simple gem install --ignore-dependencies --install-dir $RPM_BUILD_ROOT%{ruby_gemdir} %{SOURCE0} is enough, it only requires to move the rails binary in the real bindir.
Maybe we could install it directly in sitelibdir and ridir in future releases, but the gem solution is fine for now.
I had to update some ruby packages (version bump, add missing gemspec files if needed, mysql socket path fix):
- ruby-rake-0.7.1-1mdv2007.0
- ruby-activesupport-1.3.1-1mdv2007.0
- ruby-actionmailer-1.2.3-1mdv2007.0
- ruby-actionwebservice-1.1.4-1mdv2007.0
- ruby-activerecord-1.14.3-2mdv2007.0
- ruby-actionpack-1.12.3-1mdv2007.0
So, rails-1.1.4-1mdv2007.0 is now in cooker.
It isn't integrated with apache yet, but the built-in WEBrick server works fine, as well as the connection to a MySQL database. That's basic stuff, but well... I should keep the Mandriva webapps policy under my pillow ;-)
Some useful links:
- Screencasts of Ruby on Rails
- Rolling with Ruby on Rails
- Rolling with Ruby on Rails, Part 2
- MySQL 5.0 Reference Manual
Let's dive into Web 2.0!
Comments are closed for this story.
Trackbacks are closed for this story.