[Rubygems-developers] Repackaging a Gem for other Package Managers (e.g. RPM, deb, conary, etc.)

Scott Parkerson scott.parkerson at gmail.com
Wed Jan 24 12:06:11 EST 2007


I'm trying to come up with a relatively good way to take a Gem and
re-package its contents for other package managers. I've seen a
Gem2Spec tool for converting Gems to RPM spec filesout there, but
would like to dig a little deeper. My specific area of interest is
Conary, which is *not* a household name (yet).

Specifically, I need to know a few things:

* The best way to unpack a gem into a temporary root directory. My
guess is to use something like

    gem install <package> --force --ignore-dependencies --no-wrappers \
        --install-dir <temproot>

* Once the temporary root is there, I can then dissect the gem and
pull appropriate things and stuff them into their appropriate places
(e.g. the stuff in lib under the gem should be put in
/usr/lib/ruby/site_ruby/, the docs in
/usr/share/doc/<packagename>/{ri,rdoc}, etc. Binary wrappers will have
to be re-written to work with the native system, I guess (e.g. what
Debian did to /usr/bin/rails).

* I'll have to generate provides/deps based on what Conary (or RPM)
expects, which is different (and not fine-grained to version, like
Gems). That's another issue entirely.

But all this is moot if it's still possible to write code which can
only be run as a Gem. Is Rubygems source-intrusive (i.e. will having
code that has require 'rubygems' bust everything without gems
installed and the code being, well, where gems expects)? If so, that
means whatever I repackage has to do surgery on the code, which seems

The point of all this so that a distribution of Linux, which has its
own package manager, can use its update tools to update Ruby packages
without having to deal with multiple package managers. Specifically, I
want to make appliances that use Ruby-based web apps and make it easy
to update the whole OS + Ruby bits. Furthermore, package mangers like
Conary assemble entire distributions out of Conary changesets; having
a distribution ship Ruby + Rubygems only means having a special
post-process to install the desired Gems seems a bit wrong. Bottom
line is that I'm not trying to  dismiss Gems, or minimize its

Anyways, please let me know! (Hopefully this is not TL;DR fodder.)

Best regards,

scott parkerson. geek, erstwhile prophet and fool.
just a cog in the machinery: http://www.smerpology.org/sprocket/

More information about the Rubygems-developers mailing list