[DRE-commits] r5934 - in trunk/ruby-pkg-tools: . buildsystems debian

Antonio Terceiro terceiro-guest at alioth.debian.org
Sun Oct 17 16:03:38 UTC 2010


Author: terceiro-guest
Date: 2010-10-17 16:03:32 +0000 (Sun, 17 Oct 2010)
New Revision: 5934

Added:
   trunk/ruby-pkg-tools/buildsystems/
   trunk/ruby-pkg-tools/buildsystems/ruby.pm
Modified:
   trunk/ruby-pkg-tools/debian/changelog
   trunk/ruby-pkg-tools/debian/ruby-pkg-tools.install
Log:
adding a initial version of a ruby debhelper buildsystem



Added: trunk/ruby-pkg-tools/buildsystems/ruby.pm
===================================================================
--- trunk/ruby-pkg-tools/buildsystems/ruby.pm	                        (rev 0)
+++ trunk/ruby-pkg-tools/buildsystems/ruby.pm	2010-10-17 16:03:32 UTC (rev 5934)
@@ -0,0 +1,85 @@
+# A build system class for handling Ruby setup.rb projects. Most Ruby libraries
+# released as gems should also build using this. This file was based on
+# perl_build.pm
+#
+# Copyright: © 2010 Antonio Terceiro
+#            © 2008-2009 Joey Hess
+#            © 2008-2009 Modestas Vainius
+# License: GPL-2+
+
+package Debian::Debhelper::Buildsystem::ruby;
+
+use strict;
+use base 'Debian::Debhelper::Buildsystem';
+
+my $PACKAGED_RUBY_SETUP_CMD = '/usr/lib/ruby/1.8/setup.rb';
+
+sub DESCRIPTION {
+	"Ruby common buildsystem (setup.rb)"
+}
+
+sub check_auto_buildable {
+	my ($this, $step) = @_;
+	return 0;
+}
+
+sub run_setuprb {
+	my $this=shift;
+	my $setuprb = $this->get_sourcepath('setup.rb');
+	if (! -l $setuprb) {
+		if (-f $setuprb) {
+			$this->doit_in_sourcedir('mv', $setuprb, $setuprb . 'moved_away_by_debian_build');
+		}
+		symlink($PACKAGED_RUBY_SETUP_CMD, $setuprb)
+	}
+	$this->doit_in_sourcedir("ruby", $setuprb, @_);
+}
+
+sub run_setuprb_config {
+	my $this=shift;
+	# for now, assume that Ruby code is compatible with all Ruby versions 
+	$this->run_setuprb('config', '--installdirs=site', '--siterubyver=/usr/lib/ruby/vendor_ruby', @_);
+}
+
+sub new {
+	my $class=shift;
+	my $this= $class->SUPER::new(@_);
+	$this->enforce_in_source_building();
+	return $this;
+}
+
+sub configure {
+	my $this=shift;
+	$this->run_setuprb_config(@_);
+}
+
+sub build {
+	my $this=shift;
+	$this->run_setuprb("setup", @_);
+}
+
+sub test {
+	my $this=shift;
+	# nothing yet
+}
+
+sub install {
+	my $this=shift;
+	my $destdir=shift;
+	$this->run_setuprb('install' , "--prefix=$destdir", @_);
+}
+
+sub clean {
+	my $this=shift;
+	$this->run_setuprb_config(@_);
+	$this->run_setuprb('distclean', @_);
+	my $setuprb = $this->get_sourcepath('setup.rb');
+	if (-l $setuprb) {
+		system('rm', $setuprb);
+	}
+	if (-f $setuprb . '.moved_away_by_debian_build') {
+		system('mv', $setuprb . '.moved_away_by_debian_build', $setuprb);
+	}
+}
+
+1

Modified: trunk/ruby-pkg-tools/debian/changelog
===================================================================
--- trunk/ruby-pkg-tools/debian/changelog	2010-10-17 14:36:03 UTC (rev 5933)
+++ trunk/ruby-pkg-tools/debian/changelog	2010-10-17 16:03:32 UTC (rev 5934)
@@ -19,8 +19,9 @@
     tarballs.
   * Bumped Standars-Version to 3.9.1 (no changes).
   * Added debian/source/format
+  * Added a 'ruby' buildsystem for debhelper.
 
- -- Antonio Terceiro <terceiro at softwarelivre.org>  Sat, 16 Oct 2010 20:46:55 -0300
+ -- Antonio Terceiro <terceiro at softwarelivre.org>  Sat, 16 Oct 2010 21:02:19 -0300
 
 ruby-pkg-tools (0.17) unstable; urgency=low
 

Modified: trunk/ruby-pkg-tools/debian/ruby-pkg-tools.install
===================================================================
--- trunk/ruby-pkg-tools/debian/ruby-pkg-tools.install	2010-10-17 14:36:03 UTC (rev 5933)
+++ trunk/ruby-pkg-tools/debian/ruby-pkg-tools.install	2010-10-17 16:03:32 UTC (rev 5934)
@@ -2,4 +2,5 @@
 pkg-ruby-extras.*               usr/share/ruby-pkg-tools/
 bin/*                           usr/bin
 sequences/*                     usr/share/perl5/Debian/Debhelper/Sequence/
+buildsystems/*                  usr/share/perl5/Debian/Debhelper/Buildsystem/
 lib/*                           usr/lib/ruby/1.8/




More information about the Pkg-ruby-extras-commits mailing list