[DRE-maint] Bug#857650: ruby-json: Please build java extension

Miguel Landaeta nomadium at debian.org
Mon Mar 13 18:43:05 UTC 2017


Package: src:ruby-json
Version: 2.0.1+dfsg-3
Severity: normal
Tags: patch

Hi,

I noticed ruby-json Java extension was not being built from this
package.

So, since I need that to get JRuby unit tests passing and it should be
useful for real-world users, I added that missing component to this
package.

If there are no objections to my approach (please see the debdiff
below), I was planning to merge this and do an upload to experimental
very soon.

This builds OK in sbuild and I'm using it locally to build and test
recent JRuby releases.

I'm also attaching the build log if anyone is curious about this.


diff -Nru ruby-json-2.0.1+dfsg/debian/changelog ruby-json-2.0.1+dfsg/debian/changelog
--- ruby-json-2.0.1+dfsg/debian/changelog	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/changelog	2017-03-13 18:31:15.000000000 +0000
@@ -1,3 +1,10 @@
+ruby-json (2.0.1+dfsg-4) experimental; urgency=medium
+
+  * Team upload.
+  * Build java extension and add new binary package jruby-json for it.
+
+ -- Miguel Landaeta <nomadium at debian.org>  Mon, 13 Mar 2017 18:31:15 +0000
+
 ruby-json (2.0.1+dfsg-3) unstable; urgency=medium
 
   * Add Conflicts: ruby-json-pure (Closes: #847141)
diff -Nru ruby-json-2.0.1+dfsg/debian/control ruby-json-2.0.1+dfsg/debian/control
--- ruby-json-2.0.1+dfsg/debian/control	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/control	2017-03-13 11:54:41.000000000 +0000
@@ -6,7 +6,11 @@
            Antonio Terceiro <terceiro at softwarelivre.org>,
            Cédric Boutillier <boutil at debian.org>
 Build-Depends: debhelper (>= 9~),
+               default-jdk,
                gem2deb,
+               git,
+               jruby,
+               locales-all,
                ruby-test-unit
 Standards-Version: 3.9.8
 Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-json.git
@@ -26,3 +30,19 @@
  Ruby, allowing the developer to easily convert data between Ruby and JSON. You
  can think of it as a low fat alternative to XML, if you want to store data to
  disk or transmit it over a network rather than use a verbose markup language.
+
+Package: jruby-json
+Architecture: all
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Enhances: jruby
+Description: JSON library for Ruby - java extension
+ This library implements the JSON (JavaScript Object Notation) specification in
+ Ruby, allowing the developer to easily convert data between Ruby and JSON. You
+ can think of it as a low fat alternative to XML, if you want to store data to
+ disk or transmit it over a network rather than use a verbose markup language.
+ .
+ This package contains an implementation of JSON Ruby specification written in
+ Java and is suitable for use with JRuby interpreter since provides a better
+ performance than the "pure" JSON gem written in Ruby and available in ruby-json
+ package.
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.docs ruby-json-2.0.1+dfsg/debian/jruby-json.docs
--- ruby-json-2.0.1+dfsg/debian/jruby-json.docs	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.docs	2017-03-13 12:11:36.000000000 +0000
@@ -0,0 +1,2 @@
+README-json-jruby.md
+README.md
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.examples ruby-json-2.0.1+dfsg/debian/jruby-json.examples
--- ruby-json-2.0.1+dfsg/debian/jruby-json.examples	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.examples	2017-03-13 12:12:42.000000000 +0000
@@ -0,0 +1 @@
+tools/*
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.install ruby-json-2.0.1+dfsg/debian/jruby-json.install
--- ruby-json-2.0.1+dfsg/debian/jruby-json.install	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.install	2017-03-12 23:24:37.000000000 +0000
@@ -0,0 +1 @@
+lib/json  usr/share/jruby/lib/ruby/stdlib
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch
--- ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch	2017-03-13 12:21:51.000000000 +0000
@@ -4,56 +4,10 @@
 
 This is required so that autopkgtest finds the correct gemspec.
 ---
- json-java.gemspec | 38 --------------------------------------
  json_pure.gemspec | 37 -------------------------------------
- 2 files changed, 75 deletions(-)
- delete mode 100644 json-java.gemspec
+ 1 files changed, 37 deletions(-)
  delete mode 100644 json_pure.gemspec
 
-diff --git a/json-java.gemspec b/json-java.gemspec
-deleted file mode 100644
-index 1524b1f..0000000
---- a/json-java.gemspec
-+++ /dev/null
-@@ -1,38 +0,0 @@
--#!/usr/bin/env jruby
--require "rubygems"
--
--spec = Gem::Specification.new do |s|
--  s.name = "json"
--  s.version = File.read("VERSION").chomp
--  s.summary = "JSON implementation for JRuby"
--  s.description = "A JSON implementation as a JRuby extension."
--  s.author = "Daniel Luz"
--  s.email = "dev+ruby at mernen.com"
--  s.homepage = "http://json-jruby.rubyforge.org/"
--  s.platform = 'java'
--  s.rubyforge_project = "json-jruby"
--  s.licenses = ["Ruby"]
--
--  s.files = Dir["{docs,lib,tests}/**/*"]
--
--  if s.respond_to? :specification_version then
--    s.specification_version = 4
--
--    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
--      s.add_development_dependency(%q<rake>, [">= 0"])
--      s.add_development_dependency(%q<test-unit>, ["~> 2.0"])
--    else
--      s.add_dependency(%q<rake>, [">= 0"])
--      s.add_dependency(%q<test-unit>, ["~> 2.0"])
--    end
--  else
--    s.add_dependency(%q<rake>, [">= 0"])
--    s.add_dependency(%q<test-unit>, ["~> 2.0"])
--  end
--end
--
--if $0 == __FILE__
--  Gem::Builder.new(spec).build
--else
--  spec
--end
 diff --git a/json_pure.gemspec b/json_pure.gemspec
 deleted file mode 100644
 index bf7dc79..0000000
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch
--- ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch	2017-03-13 12:18:06.000000000 +0000
@@ -0,0 +1,13 @@
+Description: Disable rubygems usage for dependencies management
+Author: Miguel Landaeta <nomadium at debian.org>
+Forwarded: no
+Last-Update: 2017-03-12
+
+--- ruby-json-2.0.1+dfsg.orig/tests/test_helper.rb
++++ ruby-json-2.0.1+dfsg/tests/test_helper.rb
+@@ -1,4 +1,4 @@
+-gem 'json', File.read('VERSION').chomp
++# gem 'json', File.read('VERSION').chomp
+ 
+ case ENV['JSON']
+ when 'pure'
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/series ruby-json-2.0.1+dfsg/debian/patches/series
--- ruby-json-2.0.1+dfsg/debian/patches/series	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/series	2017-03-13 11:05:59.000000000 +0000
@@ -1,3 +1,4 @@
 02-fix-fuzz.rb-shebang.patch
 04-fix-tests-path.patch
 0003-Remove-additional-gemspec-files.patch
+0005-Disable-rubygems-usage-in-tests-helper.patch
diff -Nru ruby-json-2.0.1+dfsg/debian/ruby-tests.rb ruby-json-2.0.1+dfsg/debian/ruby-tests.rb
--- ruby-json-2.0.1+dfsg/debian/ruby-tests.rb	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/ruby-tests.rb	2017-03-12 23:23:21.000000000 +0000
@@ -7,3 +7,6 @@
 ENV['json'] = 'ext'
 puts "Ext version of the tests"
 system("#{ENV['RUBY_TEST_BIN']} #{inc} tests/*_test.rb") or raise
+ENV['JSON'] = 'ext'
+puts "Java ext version of the tests"
+system("jruby -S rake test_ext") or raise
diff -Nru ruby-json-2.0.1+dfsg/debian/rules ruby-json-2.0.1+dfsg/debian/rules
--- ruby-json-2.0.1+dfsg/debian/rules	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/rules	2017-03-13 12:06:58.000000000 +0000
@@ -2,6 +2,21 @@
 
 export DH_RUBY_GEMSPEC=json.gemspec
 export GEM2DEB_TEST_RUNNER = --check-dependencies
+export JAVA_HOME = /usr/lib/jvm/default-java
+export LC_ALL = en_US.UTF-8
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_build:
+	jruby -S rake build
+
+override_dh_install:
+	dh_install
+	find ./debian/ruby-json/ -type f -name '*.jar' -delete
+	find ./debian/jruby-json/ -type f -name '.keep' -size 0 -delete
+
+override_dh_auto_clean:
+	dh_auto_clean
+	jruby -S rake clean
+	-rm -r ./pkg/


Cheers,
Miguel.


-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Miguel Landaeta, nomadium at debian.org
secure email with PGP 0x6E608B637D8967E9 available at http://miguel.cc/key.
"Faith means not wanting to know what is true." -- Nietzsche
-------------- next part --------------
diff -Nru ruby-json-2.0.1+dfsg/debian/changelog ruby-json-2.0.1+dfsg/debian/changelog
--- ruby-json-2.0.1+dfsg/debian/changelog	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/changelog	2017-03-13 18:31:15.000000000 +0000
@@ -1,3 +1,10 @@
+ruby-json (2.0.1+dfsg-4) experimental; urgency=medium
+
+  * Team upload.
+  * Build java extension and add new binary package jruby-json for it.
+
+ -- Miguel Landaeta <nomadium at debian.org>  Mon, 13 Mar 2017 18:31:15 +0000
+
 ruby-json (2.0.1+dfsg-3) unstable; urgency=medium
 
   * Add Conflicts: ruby-json-pure (Closes: #847141)
diff -Nru ruby-json-2.0.1+dfsg/debian/control ruby-json-2.0.1+dfsg/debian/control
--- ruby-json-2.0.1+dfsg/debian/control	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/control	2017-03-13 11:54:41.000000000 +0000
@@ -6,7 +6,11 @@
            Antonio Terceiro <terceiro at softwarelivre.org>,
            Cédric Boutillier <boutil at debian.org>
 Build-Depends: debhelper (>= 9~),
+               default-jdk,
                gem2deb,
+               git,
+               jruby,
+               locales-all,
                ruby-test-unit
 Standards-Version: 3.9.8
 Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-json.git
@@ -26,3 +30,19 @@
  Ruby, allowing the developer to easily convert data between Ruby and JSON. You
  can think of it as a low fat alternative to XML, if you want to store data to
  disk or transmit it over a network rather than use a verbose markup language.
+
+Package: jruby-json
+Architecture: all
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Enhances: jruby
+Description: JSON library for Ruby - java extension
+ This library implements the JSON (JavaScript Object Notation) specification in
+ Ruby, allowing the developer to easily convert data between Ruby and JSON. You
+ can think of it as a low fat alternative to XML, if you want to store data to
+ disk or transmit it over a network rather than use a verbose markup language.
+ .
+ This package contains an implementation of JSON Ruby specification written in
+ Java and is suitable for use with JRuby interpreter since provides a better
+ performance than the "pure" JSON gem written in Ruby and available in ruby-json
+ package.
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.docs ruby-json-2.0.1+dfsg/debian/jruby-json.docs
--- ruby-json-2.0.1+dfsg/debian/jruby-json.docs	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.docs	2017-03-13 12:11:36.000000000 +0000
@@ -0,0 +1,2 @@
+README-json-jruby.md
+README.md
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.examples ruby-json-2.0.1+dfsg/debian/jruby-json.examples
--- ruby-json-2.0.1+dfsg/debian/jruby-json.examples	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.examples	2017-03-13 12:12:42.000000000 +0000
@@ -0,0 +1 @@
+tools/*
diff -Nru ruby-json-2.0.1+dfsg/debian/jruby-json.install ruby-json-2.0.1+dfsg/debian/jruby-json.install
--- ruby-json-2.0.1+dfsg/debian/jruby-json.install	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/jruby-json.install	2017-03-12 23:24:37.000000000 +0000
@@ -0,0 +1 @@
+lib/json  usr/share/jruby/lib/ruby/stdlib
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch
--- ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/0003-Remove-additional-gemspec-files.patch	2017-03-13 12:21:51.000000000 +0000
@@ -4,56 +4,10 @@
 
 This is required so that autopkgtest finds the correct gemspec.
 ---
- json-java.gemspec | 38 --------------------------------------
  json_pure.gemspec | 37 -------------------------------------
- 2 files changed, 75 deletions(-)
- delete mode 100644 json-java.gemspec
+ 1 files changed, 37 deletions(-)
  delete mode 100644 json_pure.gemspec
 
-diff --git a/json-java.gemspec b/json-java.gemspec
-deleted file mode 100644
-index 1524b1f..0000000
---- a/json-java.gemspec
-+++ /dev/null
-@@ -1,38 +0,0 @@
--#!/usr/bin/env jruby
--require "rubygems"
--
--spec = Gem::Specification.new do |s|
--  s.name = "json"
--  s.version = File.read("VERSION").chomp
--  s.summary = "JSON implementation for JRuby"
--  s.description = "A JSON implementation as a JRuby extension."
--  s.author = "Daniel Luz"
--  s.email = "dev+ruby at mernen.com"
--  s.homepage = "http://json-jruby.rubyforge.org/"
--  s.platform = 'java'
--  s.rubyforge_project = "json-jruby"
--  s.licenses = ["Ruby"]
--
--  s.files = Dir["{docs,lib,tests}/**/*"]
--
--  if s.respond_to? :specification_version then
--    s.specification_version = 4
--
--    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
--      s.add_development_dependency(%q<rake>, [">= 0"])
--      s.add_development_dependency(%q<test-unit>, ["~> 2.0"])
--    else
--      s.add_dependency(%q<rake>, [">= 0"])
--      s.add_dependency(%q<test-unit>, ["~> 2.0"])
--    end
--  else
--    s.add_dependency(%q<rake>, [">= 0"])
--    s.add_dependency(%q<test-unit>, ["~> 2.0"])
--  end
--end
--
--if $0 == __FILE__
--  Gem::Builder.new(spec).build
--else
--  spec
--end
 diff --git a/json_pure.gemspec b/json_pure.gemspec
 deleted file mode 100644
 index bf7dc79..0000000
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch
--- ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch	1970-01-01 00:00:00.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/0005-Disable-rubygems-usage-in-tests-helper.patch	2017-03-13 12:18:06.000000000 +0000
@@ -0,0 +1,13 @@
+Description: Disable rubygems usage for dependencies management
+Author: Miguel Landaeta <nomadium at debian.org>
+Forwarded: no
+Last-Update: 2017-03-12
+
+--- ruby-json-2.0.1+dfsg.orig/tests/test_helper.rb
++++ ruby-json-2.0.1+dfsg/tests/test_helper.rb
+@@ -1,4 +1,4 @@
+-gem 'json', File.read('VERSION').chomp
++# gem 'json', File.read('VERSION').chomp
+ 
+ case ENV['JSON']
+ when 'pure'
diff -Nru ruby-json-2.0.1+dfsg/debian/patches/series ruby-json-2.0.1+dfsg/debian/patches/series
--- ruby-json-2.0.1+dfsg/debian/patches/series	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/patches/series	2017-03-13 11:05:59.000000000 +0000
@@ -1,3 +1,4 @@
 02-fix-fuzz.rb-shebang.patch
 04-fix-tests-path.patch
 0003-Remove-additional-gemspec-files.patch
+0005-Disable-rubygems-usage-in-tests-helper.patch
diff -Nru ruby-json-2.0.1+dfsg/debian/ruby-tests.rb ruby-json-2.0.1+dfsg/debian/ruby-tests.rb
--- ruby-json-2.0.1+dfsg/debian/ruby-tests.rb	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/ruby-tests.rb	2017-03-12 23:23:21.000000000 +0000
@@ -7,3 +7,6 @@
 ENV['json'] = 'ext'
 puts "Ext version of the tests"
 system("#{ENV['RUBY_TEST_BIN']} #{inc} tests/*_test.rb") or raise
+ENV['JSON'] = 'ext'
+puts "Java ext version of the tests"
+system("jruby -S rake test_ext") or raise
diff -Nru ruby-json-2.0.1+dfsg/debian/rules ruby-json-2.0.1+dfsg/debian/rules
--- ruby-json-2.0.1+dfsg/debian/rules	2016-12-05 23:33:24.000000000 +0000
+++ ruby-json-2.0.1+dfsg/debian/rules	2017-03-13 12:06:58.000000000 +0000
@@ -2,6 +2,21 @@
 
 export DH_RUBY_GEMSPEC=json.gemspec
 export GEM2DEB_TEST_RUNNER = --check-dependencies
+export JAVA_HOME = /usr/lib/jvm/default-java
+export LC_ALL = en_US.UTF-8
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_build:
+	jruby -S rake build
+
+override_dh_install:
+	dh_install
+	find ./debian/ruby-json/ -type f -name '*.jar' -delete
+	find ./debian/jruby-json/ -type f -name '.keep' -size 0 -delete
+
+override_dh_auto_clean:
+	dh_auto_clean
+	jruby -S rake clean
+	-rm -r ./pkg/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ruby-json_2.0.1+dfsg-4_amd64.build.gz
Type: application/gzip
Size: 32712 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20170313/14a8dd78/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20170313/14a8dd78/attachment-0001.sig>


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