[Rubygems-developers] Extension/Binary Install

Mauricio Fernández batsman.geo at yahoo.com
Wed Dec 1 11:10:04 EST 2004

On Wed, Dec 01, 2004 at 09:56:34AM -0500, Chad Fowler wrote:
> >I'm about to try my hand at a gem with a C extension (and 
> >subsequently, a
> >windows-binary gem).  Any hints or advice before I go down this path.  
> >I'm
> >particularly  interested in directory structure issues, especially to
> >interoperate with RPA (and other) packagers.
> >
> The best thing to do is to get setup.rb and use its structure as a 
> guide.

That's good advice.

Some other things to take into account:
* avoid complex build phases if possible -- extconf.rb only is best
* if you use your own build scripts (for instance Rakefiles), make
  sure they don't assume too much about the environment (unfortunately,
  require 'rubygems' is, by design, required, if you're using it to
  build the .gem package)
* make sure the RubyGems package contains all the relevant information,
  _especially_ if it's going to be a gem-only release
* verify that your gem-build scripts are idempotent and/or
  provide the pristine sources separately

In general ask yourself: would a user be able to rebuild the
.gem package from mine? That's a basic requirement for an upstream

Hassle-free packages for Ruby?
RPA is available from http://www.rubyarchive.org/

More information about the Rubygems-developers mailing list