tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: helper Makefile fragment to handle Ruby gems



Hi,

On Tue, Mar 04, 2008 at 03:49:54PM -0500, Johnny C. Lam wrote:
> Stoned Elipot wrote:
>> Inspired by FreeBSD's ports/devel/ruby-gems/Makefile.common
>> I came up with pkgsrc/misc/rubygems/rubygem.mk as a little Makefile 
>> fragment
>> to handle Ruby gems packaging.
>> In the attached tarball you'll find the above mentioned rubygem.mk
>> and 3 "rubygem" packages as test cases: devel/rubygem-ruby-debug
>> and its supporting package devel/rubygem-ruby-debug-base, and 
>> net/rubygem-snmp.
>> devel/rubygem-ruby-debug-base is a nice test case because its
>> corresponding gem contains C sources resulting in a shared library
>> being installed (of course this build is magically made under the
>> tools, buildlink3, ... frameworks).
>
> Looking at this, the only thing I'm concerned about is that gems that 
> require compiling sources will compile them during the install phase.  I 
> had looked at modifying rubygems at one point to see if we could separate 
> the installation from the compiling so that we could hook them into the 
> "build" and "install" phases in pkgsrc.  The worry is only the usual one 
> about building and running stuff as the root user, which opens you up to 
> malicious gem builders.
>
> Can you attempt one more test gem to see if your framework is general 
> enough?  Try creating a package for either the postgres or ruby-xslt gems 
> using your framework.  These would require that you include buildlink3.mk 
> files within your package Makefile, and would test whether the correct 
> files are being used (you can check the work.log to make sure).

=> Unless I'm mistaken ruby-xslt is an "extconf type" distribution, it has a
gem spec but I did not bother to build a gem to try to package it afterward.
Anyway I tried the latest (old) available ruby-postgres gem. As I already
saw it with the ruby-debug-base gem the buildling framework is indeed 
correctly triggered/used.

Also about the build-at-install-time-thus-possibly-as-root issue.
OpenSuSe seems to have proposed a gem install command extra option
to effectively render the installation a "DESTDIR type" one.
Google for rubygem opensuse buildroot.

Using this approach and enforcing rubygem gem packages to be build
with DESTDIR might be an easy way out of this problem...

> One the whole, I think this is worthwhile to commit.  There are some minor 
> adjustments that I would make to the rubygems.mk file, but it's easier to 
> modify them in-tree.

==> I'll commit this in a few hours.

Anyway thanks Johnny for the review.

Cheers, Stoned.


Home | Main Index | Thread Index | Old Index