The Ruby Oniguruma gem pissed me off the other day. I was trying to install the ultraviolet gem, and while building dependencies, compiling was done, that failed. Ultraviolet depended on oniguruma. gem did it’s thing and started installing that, but oniguruma has extensions that must be compiled, and to do so needed some headers from oniguruma itself.
I’m not a debian developer, but I like debs. First, if I was doing this with debs instead of gems, a binary package compiled for my architecture would have been pulled in automatically and life would have moved on. If I really wanted to build this from sources, libonig-dev would have been installed when I ran ‘apt-get build-dep liboniguruma-ruby’.
I’ve built a couple ruby debs in the past by stealing from other debs, but last night in my frustration I went out, read a bunch, chattered some, and started building more. You can find a repo here:
deb http://ubuntu.ninjr.org/ hardy ninjr deb-src http://ubuntu.ninjr.org/ hardy ninjr
And if you so desire grab the key with:
wget http://firstname.lastname@example.org sudo apt-key add email@example.com sudo apt-get update
- apt-get install libsetup-ruby1.8 ruby-pkg-tools fakeroot dpkg-dev debhelper cdbs ruby1.8-dev
- Grab a .tgz or .gem
- untar it (or ‘gem unpack foo.gem’).
- cp /usr/lib/ruby/1.8/setup.rb package-1.1.1/
- mkdir package-1.1.1/debian
- cd package-1.1.1
- dch –create -v1.1.1-1
- fix your email, pick a package name (libpackage-ruby is my choice), put in ‘unstable’
- cd debian
- put this in ‘rules’:
#!/usr/bin/make -f # copyright 2006 by Esteban Manchado Vel�zquez include /usr/share/cdbs/1/rules/simple-patchsys.mk include /usr/share/cdbs/1/rules/debhelper.mk # Ruby package with setup.rb include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
- Make a ‘control’ file like this:
Source: libtextpow-ruby Section: libs Priority: optional Maintainer: Bryan McLellan Build-Depends: cdbs, debhelper (>> 5.0.0), ruby-pkg-tools, ruby1.8 Standards-Version: 3.8.0 Package: libtextpow-ruby Architecture: all Depends: libtextpow-ruby1.8 Description: a library to parse and process Textmate bundles. . This is a dummy package to install the GD library bindings for the default version of Ruby. Package: libtextpow-ruby1.8 Architecture: all Depends: ruby1.8, libplist-ruby, liboniguruma-ruby Description: a library to parse and process Textmate bundles. Package: libtextpow-ruby-doc Section: doc Architecture: all Description: a library to parse and process Textmate bundles. a library to parse and process Textmate bundles . This is the documentation package, with upstream documentation as well as generated rdoc.
On the package libpackage-ruby1.8 line, change architecture to ‘any’ if the package compiles any extensions so your package output will correctly be architecture specific. If the ruby package has no docs, pull that section out.
- cd ..
- dpkg-buildpackage -rfakeroot
That’s about it. Contributing to debian appears difficult. I think you’ve got to know someone who knows someone to get involved. But at least this way you can start building debs.