On Tue, Apr 16, 2013 at 01:05:55PM -0500, Felipe Contreras wrote: > On Tue, Apr 16, 2013 at 12:50 PM, Antonio Terceiro <terceiro@debian.org> wrote: > > Hello Felipe, > > > > On Mon, Apr 15, 2013 at 12:10:02PM -0500, Felipe Contreras wrote: > >> Hi, > >> > >> Following the guidelines to package a ruby C extension[1], one comes > >> up with this simple extconf.rb: > >> > >> require 'mkmf' > >> create_makefile("Test") > >> > >> But then, when installing it goes to: > >> > >> /usr/local/lib/site_ruby/1.9.1/x86_64-linux > >> > >> This is clearly wrong, since /usr/local is not allowed for packages. > >> This is because ruby was configured with > >> --with-sitedir=/usr/local/lib/site_ruby, which is wrong. > > > > If you are building/installing the package by hand (ruby mkmf.rb && make > > && make install), that's actually the correct behavior. > > > > If you are creating a Debian package with gem2deb/dh_ruby, and you still > > got the files installed in /usr/local, I would like to look at your > > package because it might be a bug in gem2deb. > > These are not exclusive, one can be using 'ruby extconfg.rb' *and* be > creating a debian package. There are arguments you need to pass to `ruby extconfig.rb` to make it install to the right place. gem2deb (dh_ruby, actually) does that automatically for you. This is just like packages that use GNU autotools; you have to pass --prefix=/usr to `./configure` to make it install to /usr instead of /usr/local. You can do that by hand, or you can use debhelper and let it do the right thing for you. > >> So what is a package supposed to do? There's no information at all for > >> packages using mkmf. Shouldn't the ruby package be fixed? > > > > building such a package with dh_ruby shoult Just Work™. If it doesn't, > > we need to wee the package source to figure out. > > That requires gem2deb, doesn't it? I don't see why I should use > gem2deb, if this package doesn't have a gem, and doesn't need one. That's not correct. You don't needed to actually create the source package from a gem with the `gem2deb` binary. All you need is use this as debian/rules: %: dh $@ --buildsystem=ruby --with ruby and build-depend on gem2deb. gem2deb is named like that because having gems _is_ the standard for Ruby development, but it also supports "old-style" Ruby packages BTW gems are layed out just like "old-style" Ruby packages, plus the gem metadata, so there is not much difference between a source package that comes from a gem and one that doesn't. -- Antonio Terceiro <terceiro@debian.org>
Attachment:
signature.asc
Description: Digital signature