[DRE-commits] [SCM] gem2deb.git branch, master, updated. e54f196cd9435c5147d4b83469a2be5cf12303b1

Lucas Nussbaum lucas at lucas-nussbaum.net
Fri Mar 25 07:20:15 UTC 2011


The following commit has been merged in the master branch:
commit ac0fa6c67e7b0776b2866871903bf23564b37561
Author: Lucas Nussbaum <lucas at lucas-nussbaum.net>
Date:   Wed Mar 23 16:48:35 2011 +0100

    Rewrite depends after dh_shlibdeps to create ORed deps.

diff --git a/bin/dh_ruby b/bin/dh_ruby_fixdepends
similarity index 55%
copy from bin/dh_ruby
copy to bin/dh_ruby_fixdepends
index 1c309cd..c2deddd 100755
--- a/bin/dh_ruby
+++ b/bin/dh_ruby_fixdepends
@@ -17,86 +17,50 @@
 
 require 'gem2deb'
 require 'gem2deb/dh_ruby'
-require 'optparse'
 include Gem2Deb
 
-optparse = OptionParser.new do |opts|
-  opts.on('-h', '--help', 'show help') do
-    puts opts
-    exit
-  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
-    DhRuby::new.clean
-    exit(0)
-  end
-
-  opts.on('', '--configure', 'debhelper configure helper') do
-    DhRuby::new.configure
-    exit(0)
-  end
-
-  opts.on('', '--build', 'debhelper build helper') do
-    DhRuby::new.build
-    exit(0)
-  end
-
-  opts.on('', '--test', 'debhelper test helper') do
-    DhRuby::new.test
-    exit(0)
-  end
-
-  opts.on('', '--install', 'debhelper install helper') do
-    DhRuby::new.install(ARGV)
-    exit(0)
+`dh_listpackages`.split.each do |package|
+  s = IO::read("debian/#{package}.substvars")
+  fd = File::new("debian/#{package}.substvars", "w")
+  s.each_line do |l|
+    if l =~ /^shlibs:Depends=/
+      deps = l.chomp.split('=', 2)[1].split(', ')
+      std_deps = []
+      ruby_deps = []
+      deps.each do |dep|
+        if ['libruby1.8', 'libruby1.9.1'].include?(dep.split(' ')[0])
+          ruby_deps << dep
+        else
+          std_deps << dep
+        end
+      end
+      # p ruby_deps
+      # p std_deps
+      newdeps = (std_deps + [(ruby_deps.join(' | '))]).join(', ')
+      fd.puts "shlibs:Depends=#{newdeps}"
+    else
+      fd.puts l
+    end
   end
+  fd.close
 end
-optparse.parse!
-
-puts optparse
-exit(1)
-
 __END__
 =head1 NAME
 
-dh_ruby - debhelper7 build system for Ruby software
+dh_ruby_fixdepends - fix dependencies in shlibs file after dh_shlibdeps
 
 =head1 SYNOPSIS
 
-B<dh_ruby> [I<OPTIONS>]
+B<dh_ruby_fixdepends>
 
 =head1 DESCRIPTION
 
-B<dh_ruby> is a Debhelper 7 build system for Ruby software.
-
-See dh_ruby --help for details.
-
-=head1 OPTIONS
-
-=over
-
-=item B<--clean>, B<--configure>, B<--build>, B<--test>, B<--install>
-
-Commands called by debhelper at various steps of the build process.
-
-=item B<-h>, B<--help>
-
-Displays B<dh_ruby> usage information.
-
-=item B<-v>, B<--version>
-
-Displays B<dh_ruby> version information.
-
-=back
+B<dh_ruby_fixdepends> is called by the I<ruby> dh sequence. You should
+not call it directly.
 
 =head1 SEE ALSO
 
-L<B<gem2deb>>(1)
+L<B<gem2deb>>(1), L<B<dh_ruby>>(1)
 
 =head1 COPYRIGHT AND AUTHORS
 
diff --git a/debhelper7/sequence/ruby.pm b/debhelper7/sequence/ruby.pm
index 57524d1..88bc49e 100644
--- a/debhelper7/sequence/ruby.pm
+++ b/debhelper7/sequence/ruby.pm
@@ -5,8 +5,6 @@ use warnings;
 use strict;
 use Debian::Debhelper::Dh_Lib;
 
-#insert_after("dh_perl", "dh_python2");
-#remove_command("dh_pycentral");
-#remove_command("dh_pysupport");
+insert_after("dh_shlibdeps", "dh_ruby_fixdepends");
 
 1
diff --git a/debian/changelog b/debian/changelog
index 7b525b3..659d8aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,8 +14,9 @@ gem2deb (0.1.1) experimental; urgency=low
   * Put everything in the same binary package.
   * Add a dh7 sequence.
   * Better detection of test failures. 
+  * Rewrite depends after dh_shlibdeps to create ORed deps.
 
- -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Wed, 23 Mar 2011 16:47:30 +0100
+ -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Wed, 23 Mar 2011 16:48:01 +0100
 
 gem2deb (0.1.0) experimental; urgency=low
 

-- 
gem2deb.git



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