[DRE-commits] [ruby-rjb] 02/04: Initial Debian packaging

Jérémy Bobbio lunar at alioth.debian.org
Tue Aug 13 21:34:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-rjb.

commit 686f631b3deb245709b25bff2b9acdea86e501cb
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Mon Aug 12 16:00:29 2013 +0200

    Initial Debian packaging
---
 debian/changelog                                   |    2 +-
 debian/control                                     |   23 +++--
 debian/copyright                                   |   58 ++++++++-----
 debian/gbp.conf                                    |    6 ++
 ...e-file-to-be-specified-using-the-RJB_BRID.patch |   22 +++++
 .../0002-Fix-paths-to-jars-in-test-suite.patch     |   74 ++++++++++++++++
 .../patches/0003-Remove-broken-encoding-test.patch |   91 ++++++++++++++++++++
 ...od-that-always-returns-an-object-in-test_.patch |   30 +++++++
 ...OME-with-a-sensible-value-if-not-set-when.patch |   46 ++++++++++
 debian/patches/series                              |    5 ++
 debian/ruby-rjb.docs                               |    1 -
 debian/ruby-rjb.install                            |    4 +-
 debian/ruby-test-files.yaml                        |    2 -
 debian/ruby-tests.rb                               |    7 ++
 debian/rules                                       |   55 +++++++++---
 debian/source/local-options                        |    1 +
 16 files changed, 380 insertions(+), 47 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1699608..da83110 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
 ruby-rjb (1.4.8-1) UNRELEASED; urgency=low
 
-  * Initial release (Closes: #nnnn)
+  * Initial release (Closes: #719301)
 
  -- Jérémy Bobbio <lunar at debian.org>  Mon, 12 Aug 2013 12:40:15 +0200
diff --git a/debian/control b/debian/control
index 73a69d0..ccb22c1 100644
--- a/debian/control
+++ b/debian/control
@@ -3,16 +3,27 @@ Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders: Jérémy Bobbio <lunar at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.4.1~)
+Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.4.1~), default-jdk
 Standards-Version: 3.9.4
-#Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-rjb.git
-#Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-rjb.git;a=summary
+Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-rjb.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-rjb.git;a=summary
 Homepage: http://rjb.rubyforge.org/
 XS-Ruby-Versions: all
 
 Package: ruby-rjb
 Architecture: any
 XB-Ruby-Versions: ${ruby:Versions}
-Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter
-Description: Ruby Java bridge
- RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
+Depends:
+ ruby | ruby-interpreter,
+ default-jre | java5-runtime,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Ruby-Java bridge using Java Native Interface
+ Rjb is a library that connect between Ruby and Java using the Java Native
+ Interface.
+ .
+ Among others, it supports importing Java classes into Ruby's environemnt,
+ instanciating objects with a number of type matching rules, calling instance
+ method (overloaded or not), accessing fields, binding Ruby objects to Java
+ interfaces, throws java exception in ruby-bounded-object, and inspecting
+ object classes.
diff --git a/debian/copyright b/debian/copyright
index 798d569..4db098b 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,35 +1,47 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: rjb
-Source: FIXME <http://example.com/>
+Source: https://github.com/arton/rjb
 
 Files: *
-Copyright: <years> <put author's name and email here>
-           <years> <likewise for another author>
-License: GPL-2+ (FIXME)
+Copyright: 2004-2013 arton
+License: LGPL-2.1+
+
+Files: ext/jniwrap.h
+       ext/riconv.c
+       ext/riconv.h
+Copyright: 2004-2006 Kuwashima
+License: LGPL-2.1+
+
+Files: lib/rjb/extension.rb
+Copyright: 2008 Andreas Ronge
+           2010 arton
+License: LGPL-2.1+
+
+Files: setup.rb
+Copyright: 2000-2004 Minero Aoki
+License: LGPL-2.1+
 
 Files: debian/*
 Copyright: 2013 Jérémy Bobbio <lunar at debian.org>
-License: GPL-2+ (FIXME)
-Comment: the Debian packaging is licensed under the same terms as the original package.
+License: LGPL-2.1+
+Comment:
+ The Debian packaging is licensed under the same terms as the original
+ package.
 
-License: GPL-2+ (FIXME)
- This program is free software; you can redistribute it
- and/or modify it under the terms of the GNU General Public
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later
- version.
+ version 2.1 of the License, or (at your option) any later version.
  .
- This program is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE.  See the GNU General Public License for more
- details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
  .
- You should have received a copy of the GNU General Public
- License along with this package; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA  02110-1301 USA
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  .
- On Debian systems, the full text of the GNU General Public
- License version 2 can be found in the file
- `/usr/share/common-licenses/GPL-2'.
+ On Debian systems, the complete text of the GNU Lesser General Public
+ License can be found in the file `/usr/share/common-licenses/LGPL-2.1'.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..59a5eda
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,6 @@
+[DEFAULT]
+pristine-tar = True
+
+[git-import-orig]
+filter = ['*.class', '*.jar', 'jp_co_infoseek_hp_arton_rjb_RBridge.h']
+filter-pristine-tar = True
diff --git a/debian/patches/0001-Allow-bridge-file-to-be-specified-using-the-RJB_BRID.patch b/debian/patches/0001-Allow-bridge-file-to-be-specified-using-the-RJB_BRID.patch
new file mode 100644
index 0000000..1f54fda
--- /dev/null
+++ b/debian/patches/0001-Allow-bridge-file-to-be-specified-using-the-RJB_BRID.patch
@@ -0,0 +1,22 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Mon, 12 Aug 2013 16:14:12 +0200
+Subject: Allow bridge file to be specified using the RJB_BRIDGE_FILE
+ environment variable
+
+---
+ lib/rjb.rb |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rjb.rb b/lib/rjb.rb
+index 97125dc..1836f7b 100755
+--- a/lib/rjb.rb
++++ b/lib/rjb.rb
+@@ -24,7 +24,7 @@ module RjbConf
+   else
+     datadir = RbConfig::CONFIG['datadir']
+   end
+-  BRIDGE_FILE = File.join(datadir, 'rjb', 'jp', 'co', 'infoseek', 'hp',
++  BRIDGE_FILE = ENV['RJB_BRIDGE_FILE'] || File.join(datadir, 'rjb', 'jp', 'co', 'infoseek', 'hp',
+                           'arton', 'rjb', 'RBridge.class')
+   unless File.exist?(BRIDGE_FILE)
+     raise 'bridge file not found'
diff --git a/debian/patches/0002-Fix-paths-to-jars-in-test-suite.patch b/debian/patches/0002-Fix-paths-to-jars-in-test-suite.patch
new file mode 100644
index 0000000..804c6dd
--- /dev/null
+++ b/debian/patches/0002-Fix-paths-to-jars-in-test-suite.patch
@@ -0,0 +1,74 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Mon, 12 Aug 2013 20:17:00 +0200
+Subject: Fix paths to jars in test suite
+
+---
+ test/jartest.rb  |    4 ++--
+ test/jartest2.rb |    2 +-
+ test/jartest3.rb |    2 +-
+ test/test.rb     |    6 +++---
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/test/jartest.rb b/test/jartest.rb
+index 9bf7a21..5bf7511 100644
+--- a/test/jartest.rb
++++ b/test/jartest.rb
+@@ -17,8 +17,8 @@ class JarTest < Test::Unit::TestCase
+   end
+   
+   def test_depends
+-    add_jar(File.expand_path('./jartest2.jar'))    
+-    add_jar(File.expand_path('./jartest.jar'))
++    add_jar(File.expand_path('../jartest2.jar', __FILE__))
++    add_jar(File.expand_path('../jartest.jar', __FILE__))
+     assert Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
+   end
+ end
+diff --git a/test/jartest2.rb b/test/jartest2.rb
+index 8fc0303..05b759d 100644
+--- a/test/jartest2.rb
++++ b/test/jartest2.rb
+@@ -17,7 +17,7 @@ class JarTest < Test::Unit::TestCase
+   end
+   
+   def test_depends
+-    add_jar([File.expand_path('./jartest2.jar'), File.expand_path('./jartest.jar')])
++    add_jar([File.expand_path('../jartest2.jar', __FILE__), File.expand_path('../jartest.jar', __FILE__)])
+     assert Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
+   end
+ end
+diff --git a/test/jartest3.rb b/test/jartest3.rb
+index cc673b9..9b301f0 100644
+--- a/test/jartest3.rb
++++ b/test/jartest3.rb
+@@ -17,7 +17,7 @@ class JarTest < Test::Unit::TestCase
+   end
+   
+   def test_depends
+-    add_jar(File.expand_path('./jartest2.jar'))    
++    add_jar(File.expand_path('../jartest2.jar', __FILE__))
+     begin
+       Rjb::import('jp.co.infoseek.hp.arton.rjb.JarTest2')
+       fail 'no exception'
+diff --git a/test/test.rb b/test/test.rb
+index b563603..cebb8db 100755
+--- a/test/test.rb
++++ b/test/test.rb
+@@ -749,14 +749,14 @@ class TestRjb < Test::Unit::TestCase
+     assert_equal 1230918239495, big.long_value
+   end
+   def test_add_jar
+-    add_jar(File.expand_path('./jartest.jar'))
++    add_jar(File.expand_path('../jartest.jar', __FILE__))
+     jt = import('jp.co.infoseek.hp.arton.rjb.JarTest')
+     assert jt
+     assert_equal 'abcd', jt.new.add('ab', 'cd')
+   end
+   def test_add_jars
+-    arg = ['./jartest.jar', './jartest.jar'].map do |e|
+-      File.expand_path(e)
++    arg = ['../jartest.jar', '../jartest.jar'].map do |e|
++      File.expand_path(e, __FILE__)
+     end
+     add_jar(arg)
+     jt = import('jp.co.infoseek.hp.arton.rjb.JarTest')
diff --git a/debian/patches/0003-Remove-broken-encoding-test.patch b/debian/patches/0003-Remove-broken-encoding-test.patch
new file mode 100644
index 0000000..0fac0e1
--- /dev/null
+++ b/debian/patches/0003-Remove-broken-encoding-test.patch
@@ -0,0 +1,91 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Mon, 12 Aug 2013 20:31:36 +0200
+Subject: Remove broken encoding test
+
+---
+ test/test.rb |   72 ----------------------------------------------------------
+ 1 file changed, 72 deletions(-)
+
+diff --git a/test/test.rb b/test/test.rb
+index cebb8db..a566e62 100755
+--- a/test/test.rb
++++ b/test/test.rb
+@@ -143,78 +143,6 @@ class TestRjb < Test::Unit::TestCase
+     assert_equal(3, oa[2].intValue)    
+   end
+ 
+-  def test_kjconv()
+-    if Object::const_defined?(:Encoding)
+-      test = import('jp.co.infoseek.hp.arton.rjb.Test').new
+-      euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8".force_encoding Encoding::EUC_JP
+-      s = @jString.new(euc_kj)
+-      assert_equal(s.toString().encoding, Encoding::UTF_8)
+-      assert(test.isSameString(s))
+-      assert(test.isSameString(euc_kj))
+-      assert_equal(s.toString().encode(Encoding::EUC_JP), euc_kj)
+-      sjis_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67".force_encoding Encoding::SHIFT_JIS
+-      s = @jString.new(sjis_kj)
+-      assert_equal(s.toString().encoding, Encoding::UTF_8)
+-      assert(test.isSameString(s))
+-      assert(test.isSameString(sjis_kj))
+-      assert_equal(s.toString().encode(Encoding::SHIFT_JIS), sjis_kj)
+-      utf8_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88".force_encoding Encoding::UTF_8
+-      s = @jString.new(utf8_kj)
+-      assert_equal(s.toString().encoding, Encoding::UTF_8)
+-      assert(test.isSameString(s))
+-      assert(test.isSameString(utf8_kj))
+-      assert_equal(s.toString().encode(Encoding::UTF_8), utf8_kj)
+-      iso2022jp_kj = "\x1b\x24\x42\x34\x41\x3b\x7a\x25\x46\x25\x2d\x25\x39\x25\x48\x1b\x28\x42".force_encoding Encoding::ISO_2022_JP
+-      s = @jString.new(iso2022jp_kj)
+-      assert_equal(s.toString().encoding, Encoding::UTF_8)
+-      assert(test.isSameString(s))
+-      assert(test.isSameString(iso2022jp_kj))
+-      assert_equal(s.toString().encode(Encoding::ISO_2022_JP), iso2022jp_kj)
+-      assert_equal(@jString.new("abcdef".force_encoding(Encoding::ASCII_8BIT)).toString(), "abcdef")
+-      assert_equal(@jString.new("abcdef".force_encoding(Encoding::find("us-ascii"))).toString(), "abcdef")
+-    else
+-      default_kcode = $KCODE
+-      begin
+-	$KCODE = 'euc'
+-	euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8"
+-	s = @jString.new(euc_kj)
+-	assert_equal(s.toString(), euc_kj)
+-	$KCODE = 'sjis'
+-	sjis_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67"
+-	s = @jString.new(sjis_kj)
+-	assert_equal(s.toString(), sjis_kj)
+-	$KCODE = 'utf8'
+-	utf8_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88"
+-	s = @jString.new(utf8_kj)
+-	assert_equal(s.toString(), utf8_kj)
+-	$KCODE = 'none'
+-	if /mswin(?!ce)|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
+-	  #expecting shift_jis on windows
+-	  none_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67"
+-	else
+-	  #expecting utf-8 unless windows
+-	  none_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88"
+-	end
+-	s = @jString.new(none_kj)
+-	assert_equal(s.toString(), none_kj)
+-	$KCODE = 'utf8'
+-	utf8_kj = "\xE6\xBC\xA2\xE5\xAD\x97\xE3\x83\x86\xE3\x82\xAD\xE3\x82\xB9\xE3\x83\x88"
+-	s = @jString.new(utf8_kj)
+-	assert_equal(s.toString(), utf8_kj)
+-	$KCODE = 'sjis'
+-	sjis_kj = "\x8a\xbf\x8e\x9a\x83\x65\x83\x4c\x83\x58\x83\x67"
+-	s = @jString.new(sjis_kj)
+-	assert_equal(s.toString(), sjis_kj)
+-	$KCODE = 'euc'
+-	euc_kj = "\xb4\xc1\xbb\xfa\xa5\xc6\xa5\xad\xa5\xb9\xa5\xc8"
+-	s = @jString.new(euc_kj)
+-	assert_equal(s.toString(), euc_kj)
+-      ensure
+-	$KCODE = default_kcode
+-      end
+-    end
+-  end
+-
+   def test_combination_charcters
+     teststr = "\xc7\x96\xc3\xbc\xcc\x84\x75\xcc\x88\xcc\x84\xed\xa1\xa9\xed\xba\xb2\xe3\x81\x8b\xe3\x82\x9a"
+     test = import('jp.co.infoseek.hp.arton.rjb.Test').new
diff --git a/debian/patches/0004-Use-an-method-that-always-returns-an-object-in-test_.patch b/debian/patches/0004-Use-an-method-that-always-returns-an-object-in-test_.patch
new file mode 100644
index 0000000..bc46b93
--- /dev/null
+++ b/debian/patches/0004-Use-an-method-that-always-returns-an-object-in-test_.patch
@@ -0,0 +1,30 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Mon, 12 Aug 2013 20:37:54 +0200
+Subject: Use an method that always returns an object in test_noarg_sinvoke
+
+test_noarg_sinvoke used to call the console() method which might return
+null if there's no console attached. This is exactly the case while
+building the Debian package unattended.
+---
+ test/test.rb |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/test/test.rb b/test/test.rb
+index a566e62..a152e0e 100755
+--- a/test/test.rb
++++ b/test/test.rb
+@@ -783,10 +783,10 @@ class TestRjb < Test::Unit::TestCase
+   end
+   def test_noarg_sinvoke()
+     sys = import('java.lang.System')
+-    cons = sys.console
+-    assert_equal(cons._classname, sys._invoke('console', '')._classname)
+-    assert_equal(cons._classname, sys._invoke('console', nil)._classname)
+-    assert_equal(cons._classname, sys._invoke('console')._classname)    
++    cons = sys.getProperties
++    assert_equal(cons._classname, sys._invoke('getProperties', '')._classname)
++    assert_equal(cons._classname, sys._invoke('getProperties', nil)._classname)
++    assert_equal(cons._classname, sys._invoke('getProperties')._classname)
+   end
+   def test_longarg
+     assert_equal(597899502607411822, @jLong.reverse(0x7654321076543210))
diff --git a/debian/patches/0005-Fill-JAVA_HOME-with-a-sensible-value-if-not-set-when.patch b/debian/patches/0005-Fill-JAVA_HOME-with-a-sensible-value-if-not-set-when.patch
new file mode 100644
index 0000000..c7fbf28
--- /dev/null
+++ b/debian/patches/0005-Fill-JAVA_HOME-with-a-sensible-value-if-not-set-when.patch
@@ -0,0 +1,46 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Tue, 13 Aug 2013 22:58:40 +0200
+Subject: Fill JAVA_HOME with a sensible value if not set when loading the JVM
+
+---
+ ext/RBridge.java |    3 +++
+ lib/rjb.rb       |   14 ++++++++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/ext/RBridge.java b/ext/RBridge.java
+index a29ab82..645c0ea 100644
+--- a/ext/RBridge.java
++++ b/ext/RBridge.java
+@@ -36,4 +36,7 @@ public class RBridge implements InvocationHandler {
+ 	return call(method.getName(), proxy, args);
+     }
+     private native Object call(String methodName, Object target, Object[] args);
++    public static void main(String[] args) {
++      System.out.println(System.getProperty("java.home"));
++    }
+ }
+diff --git a/lib/rjb.rb b/lib/rjb.rb
+index 1836f7b..9ce0cf7 100755
+--- a/lib/rjb.rb
++++ b/lib/rjb.rb
+@@ -34,6 +34,20 @@ end
+ require 'rjbcore'
+ 
+ module Rjb
++  class << self
++    alias original_load load
++    def load(*args)
++      unless ENV['JAVA_HOME']
++        ENV['JAVA_HOME'] = IO.popen(['java', '-classpath',
++            File.join(RbConfig::CONFIG['datadir'], 'rjb'),
++            'jp.co.infoseek.hp.arton.rjb.RBridge']) do |f|
++          File.dirname(f.read.strip)
++        end
++      end
++      original_load(*args)
++    end
++  end
++
+   module MODIFIER
+     def self.STATIC
+       8
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..cdcb708
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+0001-Allow-bridge-file-to-be-specified-using-the-RJB_BRID.patch
+0002-Fix-paths-to-jars-in-test-suite.patch
+0003-Remove-broken-encoding-test.patch
+0004-Use-an-method-that-always-returns-an-object-in-test_.patch
+0005-Fill-JAVA_HOME-with-a-sensible-value-if-not-set-when.patch
diff --git a/debian/ruby-rjb.docs b/debian/ruby-rjb.docs
deleted file mode 100644
index d0ab95f..0000000
--- a/debian/ruby-rjb.docs
+++ /dev/null
@@ -1 +0,0 @@
-# FIXME: READMEs found
diff --git a/debian/ruby-rjb.install b/debian/ruby-rjb.install
index a1bc6a2..203e4d6 100644
--- a/debian/ruby-rjb.install
+++ b/debian/ruby-rjb.install
@@ -1,3 +1 @@
-# FIXME: data/ dir found in source. Consider installing it somewhere.
-# Examples:
-# data/* /usr/share/ruby-rjb/
+data/* /usr/share
diff --git a/debian/ruby-test-files.yaml b/debian/ruby-test-files.yaml
deleted file mode 100644
index c6f63fa..0000000
--- a/debian/ruby-test-files.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- test/test.rb
diff --git a/debian/ruby-tests.rb b/debian/ruby-tests.rb
new file mode 100644
index 0000000..bb5f3be
--- /dev/null
+++ b/debian/ruby-tests.rb
@@ -0,0 +1,7 @@
+# The test needs to know where to find the class files
+ENV['CLASSPATH'] = File.expand_path('../../test', __FILE__)
+
+# 'data' directory is not yet installed, so use the local version
+ENV['RJB_BRIDGE_FILE'] = File.expand_path('../../data/rjb/jp/co/infoseek/hp/arton/rjb/RBridge.class', __FILE__)
+
+require 'test/test.rb'
diff --git a/debian/rules b/debian/rules
index a5e7dc8..91f866c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,15 +1,48 @@
 #!/usr/bin/make -f
-#export DH_VERBOSE=1
-#
-# Uncomment to ignore all test failures (but the tests will run anyway)
-#export DH_RUBY_IGNORE_TESTS=all
-#
-# Uncomment to ignore some test failures (but the tests will run anyway).
-# Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
-#
-# If you need to specify the .gemspec (eg there is more than one)
-#export DH_RUBY_GEMSPEC=gem.gemspec
+
+export DH_RUBY_GEMSPEC=rjb.gemspec
+
+export JAVA_HOME=/usr/lib/jvm/default-java
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+TEST_CLASSES = \
+	test/jp/co/infoseek/hp/arton/rjb/Test.class \
+	test/jp/co/infoseek/hp/arton/rjb/IBase.class \
+	test/jp/co/infoseek/hp/arton/rjb/Base.class \
+	test/jp/co/infoseek/hp/arton/rjb/ExtBase.class \
+        test/jp/co/infoseek/hp/arton/rjb/Two.class \
+        test/jp/co/infoseek/hp/arton/rjb/TwoCaller.class \
+        test/jp/co/infoseek/hp/arton/rjb/CallbackTest.class \
+
+override_dh_auto_build: $(TEST_CLASSES) test/jartest.jar test/jartest2.jar
+	dh_auto_build -O--buildsystem=ruby
+
+test/jp/co/infoseek/hp/arton/rjb/%.class: test/%.java
+	mkdir -p $$(dirname $@)
+	LC_ALL=C.UTF-8 javac -classpath test -d test $<
+
+test/jartest.jar: test/JarTest.java
+	mkdir -p test/jartest
+	LC_ALL=C.UTF-8 javac -d test/jartest $<
+	jar -cvf $@ -C test/jartest jp/co/infoseek/hp/arton/rjb/JarTest.class
+
+test/jartest2.jar: test/JarTest2.java
+	mkdir -p test/jartest2
+	LC_ALL=C.UTF-8 javac -classpath test/jartest -d test/jartest2 $<
+	jar -cvf $@ -C test/jartest2 jp/co/infoseek/hp/arton/rjb/JarTest2.class
+
+rjb-global.rake: rjb.rake
+	sed -e '$$i $$spec = spec' $< > $@
+
+rjb.gemspec: rjb-global.rake
+	ruby -e 'load "rjb-global.rake"; File.open("rjb.gemspec", "w") { |f| f.write $$spec.to_ruby };'
+
+override_dh_auto_install: rjb.gemspec
+	dh_auto_install -O--buildsystem=ruby
+
+override_dh_clean:
+	dh_clean -O--buildsystem=ruby
+	rm -rf test/jp test/jartest test/jartest2
+	rm -f rjb-global.rake rjb.gemspec
diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..4aceb10
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1 @@
+unapply-patches

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rjb.git



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