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).
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.
Cheers, -- Johnny C. Lam