First version of RubyGems in the FreeBSD ports tree

Posted by Jonathan

After a weekend working on the infrastructure for RubyGems in the FreeBSD ports tree, I finally have a version that is worth releasing.

It works by wrapping the gem install calls in make install/pkg_add. I created the following ports:

  • devel/gem-rake
  • devel/gem-activesupport
  • databases/gem-activerecord
  • www/gem-actionpack
  • www/gem-actionwebservice
  • www/gem-rails
  • www/gem-redcloth
  • www/typo

The various gem ports include my Makefile.common (placed in devel/ruby-gems). This Makefile sets common install instructions and variables.
A new gem-port has now not much to tell in it’s Makefile.

From www/gem-actionpack/Makefile:

PORTNAME= actionpack
PORTVERSION= 1.8.1
CATEGORIES= www gem

MAINTAINER= jw@innerewut.net
COMMENT= Action Controller and Action View of Rails MVC Framework

MASTER_SITES= http://rubyforge.org/frs/download.php/4149/

BUILD_DEPENDS= ${LOCALBASE}/${SPEC_DIR}/activesupport-1.0.4.gemspec:${PORTSDIR}/devel/gem-activesupport
RUN_DEPENDS= ${BUILD_DEPENDS}

.include <bsd.port.pre.mk>
.include ”${PORTSDIR}/devel/ruby-gems/Makefile.common”
.include <bsd.port.post.mk>

You further have to create a pkg-plist file that lists all files installed by this gem-port. At first I thought about getting these from the gem specification as it lists all installed files. But the gemspec does not include the rdoc files and creating the pkg-plist file with pkg_trackinst/pkg_genplist is very easy.

For now the gem-rails and typo port have no webserver or database listed as a dependency. They come with WEBrick and installing MySQL or SQLite is not complicated. I plan to include them in the future.

You can get my work here. Read the README for instructions.

Please test this and comment!

Comments

Leave a response