[DRE-commits] [SCM] gem2deb.git branch, master, updated. 80a3efd4af2de5ca45524fcfcf1084ea9e2aeee1
Vincent Fourmond
fourmond at debian.org
Wed May 11 17:23:04 UTC 2011
The following commit has been merged in the master branch:
commit 80a3efd4af2de5ca45524fcfcf1084ea9e2aeee1
Author: Vincent Fourmond <fourmond at debian.org>
Date: Wed May 11 19:22:55 2011 +0200
Revert setup.rb-related changes to move them (for now) to their own branch
diff --git a/bin/dh_ruby b/bin/dh_ruby
index eafcd1f..1c309cd 100755
--- a/bin/dh_ruby
+++ b/bin/dh_ruby
@@ -20,46 +20,39 @@ require 'gem2deb/dh_ruby'
require 'optparse'
include Gem2Deb
-cls = DhRuby
-
-
optparse = OptionParser.new do |opts|
opts.on('-h', '--help', 'show help') do
puts opts
exit
end
- opts.on('', '--setuprb', 'use setup.rb for installation') do
- cls = DhRubySetupRb
- end
-
opts.on('-v', '--version', 'show dh_ruby version') do
puts "dh_ruby version #{Gem2Deb::VERSION}"
exit
end
opts.on('', '--clean', 'debhelper clean helper') do
- cls.new.clean
+ DhRuby::new.clean
exit(0)
end
opts.on('', '--configure', 'debhelper configure helper') do
- cls.new.configure
+ DhRuby::new.configure
exit(0)
end
opts.on('', '--build', 'debhelper build helper') do
- cls.new.build
+ DhRuby::new.build
exit(0)
end
opts.on('', '--test', 'debhelper test helper') do
- cls.new.test
+ DhRuby::new.test
exit(0)
end
opts.on('', '--install', 'debhelper install helper') do
- cls.new.install(ARGV)
+ DhRuby::new.install(ARGV)
exit(0)
end
end
diff --git a/debhelper7/buildsystem/rubysetuprb.pm b/debhelper7/buildsystem/rubysetuprb.pm
deleted file mode 100644
index 8814bdc..0000000
--- a/debhelper7/buildsystem/rubysetuprb.pm
+++ /dev/null
@@ -1,53 +0,0 @@
-# A debhelper build system class for building Ruby projects.
-#
-# Copyright: © 2011 Lucas Nussbaum
-# License: GPL-2+
-# Strongly based on other build systems. Thanks!
-
-package Debian::Debhelper::Buildsystem::rubysetuprb;
-
-use strict;
-use base 'Debian::Debhelper::Buildsystem';
-
-sub DESCRIPTION {
- "Ruby (Gem2Deb+setup.rb)"
-}
-
-sub check_auto_buildable {
- my $this=shift;
- return 0; # Never autobuildable
-}
-
-sub new {
- my $class=shift;
- my $this=$class->SUPER::new(@_);
- $this->enforce_in_source_building();
- return $this;
-}
-
-sub configure {
- my $this=shift;
- $this->doit_in_sourcedir("dh_ruby", "--setuprb", "--configure", @_);
-}
-
-sub build {
- my $this=shift;
- $this->doit_in_sourcedir("dh_ruby", "--setuprb", "--build", @_);
-}
-
-sub test {
- my $this=shift;
- $this->doit_in_sourcedir("dh_ruby", "--setuprb", "--test", @_);
-}
-
-sub install {
- my $this=shift;
- $this->doit_in_sourcedir("dh_ruby", "--setuprb", "--install", @_);
-}
-
-sub clean {
- my $this=shift;
- $this->doit_in_sourcedir("dh_ruby", "--setuprb", "--clean", @_);
-}
-
-1
diff --git a/debian/gem2deb.install b/debian/gem2deb.install
index 12b3bf5..b853bb3 100644
--- a/debian/gem2deb.install
+++ b/debian/gem2deb.install
@@ -1,4 +1,4 @@
bin/* /usr/bin/
lib/* /usr/lib/ruby/vendor_ruby/
-debhelper7/buildsystem/ruby*.pm /usr/share/perl5/Debian/Debhelper/Buildsystem/
+debhelper7/buildsystem/ruby.pm /usr/share/perl5/Debian/Debhelper/Buildsystem/
debhelper7/sequence/ruby.pm /usr/share/perl5/Debian/Debhelper/Sequence/
diff --git a/lib/gem2deb/dh_ruby.rb b/lib/gem2deb/dh_ruby.rb
index 4a78452..4d6e6c7 100644
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@ -103,50 +103,9 @@ module Gem2Deb
package = packages.first
- internal_install(package, supported_versions)
+ install_files('bin', find_files('bin'), File.join(destdir_for(package), @bindir), 755) if File::directory?('bin')
- File::open("debian/#{package}.substvars", "a") do |fd|
- fd.puts "ruby:Versions=#{supported_versions.join(' ')}"
- end
-
- update_shebangs(package)
-
- # FIXME after install, check for require 'rubygems' and other stupid things, and
- # issue warnings
-
- check_rubygems
- puts " Leaving dh_ruby --install" if @verbose
- end
-
- protected
-
- # This function returns the installation path for the given
- # package and the given "component", which is one of:
- # * :bindir
- # * :libdir
- # * :archdir
- # * :prefix
- #
- # _rubyver_ is the ruby version, needed only for :archdir for now.
- def destdir(package, which, rubyver = nil)
- case which
- when :bindir
- return File.join(destdir_for(package), @bindir)
- when :libdir
- return File.join(destdir_for(package), RUBY_CODE_DIR)
- when :archdir
- return File.join(destdir_for(package), `#{SUPPORTED_RUBY_VERSIONS[rubyver]} -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.chomp)
- when :prefix
- return File.join(destdir_for(package), "usr/")
- end
- end
-
- # Here comes the code for installation specific to the traditional
- # build.
- def internal_install(package, supported_versions)
- install_files('bin', find_files('bin'), destdir(package, :bindir), 755) if File::directory?('bin')
-
- install_files('lib', find_files('lib'), destdir(package, :libdir), 644) if File::directory?('lib')
+ install_files('lib', find_files('lib'), File.join(destdir_for(package), RUBY_CODE_DIR), 644) if File::directory?('lib')
if metadata.has_native_extensions?
@@ -156,8 +115,8 @@ module Gem2Deb
# Remove duplicate files installed by rubygems in the arch dir
# This is a hack to workaround a problem in rubygems
- vendor_dir = destdir(package, :libdir)
- vendor_arch_dir = destdir(package, :archdir, rubyver)
+ vendor_dir = File.join(destdir_for(package), RUBY_CODE_DIR)
+ vendor_arch_dir = File.join(destdir_for(package), `#{SUPPORTED_RUBY_VERSIONS[rubyver]} -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.chomp)
if File::exists?(vendor_dir) and File::exists?(vendor_arch_dir)
remove_duplicate_files(vendor_dir, vendor_arch_dir)
end
@@ -175,8 +134,22 @@ module Gem2Deb
end
end
end
+
+ File::open("debian/#{package}.substvars", "a") do |fd|
+ fd.puts "ruby:Versions=#{supported_versions.join(' ')}"
+ end
+
+ update_shebangs(package)
+
+ # FIXME after install, check for require 'rubygems' and other stupid things, and
+ # issue warnings
+
+ check_rubygems
+ puts " Leaving dh_ruby --install" if @verbose
end
+ protected
+
def remove_duplicate_files(src, dst)
candidates = (Dir::entries(src) & Dir::entries(dst)) - ['.', '..']
candidates.each do |cand|
@@ -429,43 +402,4 @@ module Gem2Deb
end
end
end
-
- class DhRubySetupRb < DhRuby
-
- def spawn(cmd)
- puts cmd
- if ! system(cmd)
- puts " -> failed"
- exit(1)
- end
- end
-
- # Here comes the code for installation specific to the setup.rb
- # build.
- def internal_install(package, supported_versions)
- for rubyver in supported_versions
- ruby = SUPPORTED_RUBY_VERSIONS[rubyver]
- siteruby = destdir(package, :libdir, rubyver)
- bindir = destdir(package, :bindir, rubyver)
- archdir = destdir(package, :archdir, rubyver)
- prefix = destdir(package, :prefix, rubyver)
-
- # First configure
- spawn("#{ruby} setup.rb config --prefix=#{prefix} --bindir=#{bindir} --siteruby=#{siteruby} --siterubyver=#{siteruby} --siterubyverarch=#{archdir}")
-
- # Then setup
- spawn("#{ruby} setup.rb setup")
-
- # Then install
- spawn("#{ruby} setup.rb install")
-
- # Then clean
- spawn("#{ruby} setup.rb clean")
-
- end
- end
-
-
- end
-
end
--
gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list