diff --git a/.gitignore b/.gitignore index 25e784f..f5e8415 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ruby-2.3.0.tar.xz +SOURCES/ruby-2.3.1.tar.xz diff --git a/.rh-ruby23-ruby.metadata b/.rh-ruby23-ruby.metadata index bc88799..4d8c3f6 100644 --- a/.rh-ruby23-ruby.metadata +++ b/.rh-ruby23-ruby.metadata @@ -1 +1 @@ -96e620e38af351c8da63e40cfe217ec79f912ba1 SOURCES/ruby-2.3.0.tar.xz +83499c14c674cf2d88e495031434a94c06330879 SOURCES/ruby-2.3.1.tar.xz diff --git a/SOURCES/operating_system.rb b/SOURCES/operating_system.rb index d7d5702..cdbc112 100644 --- a/SOURCES/operating_system.rb +++ b/SOURCES/operating_system.rb @@ -39,6 +39,18 @@ module Gem private :rpmbuild? ## + # Get enabled SCLs in order of (most) dependent SCL to base SCL + + def x_scls + @x_scls ||= if ENV['X_SCLS'].kind_of?(String) + ENV['X_SCLS'].split(' ').reverse! + else + [] + end + end + private :x_scls + + ## # Default gems locations allowed on FHS system (/usr, /usr/share). # The locations are derived from directories specified during build # configuration. @@ -54,7 +66,7 @@ module Gem if ENV['GEM_PATH'] gem_paths = ENV['GEM_PATH'].split(':') - ENV['X_SCLS'].split(' ').each do |scl| + x_scls.each do |scl| next if scl == '@SCL@' regexp = /#{scl}\/root\/usr\/share\/gems/ @@ -64,7 +76,7 @@ module Gem @default_locations["#{scl}_system".to_sym] = "#{prefix}#{scl}/root/usr" @default_locations["#{scl}_local".to_sym] = "#{prefix}#{scl}/root/usr/local" end - end if ENV['X_SCLS'] + end end @default_locations @@ -117,7 +129,7 @@ module Gem def default_dir if opt_build_root? - scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} + scl_prefix = x_scls.detect {|c| c != '@SCL@'} scl_prefix = scl_prefix ? scl_prefix + '_': nil Gem.default_dirs[:"#{scl_prefix}system"][:gem_dir] @@ -135,7 +147,7 @@ module Gem def default_bindir if opt_build_root? - scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} + scl_prefix = x_scls.detect {|c| c != '@SCL@'} scl_prefix = scl_prefix ? scl_prefix + '_': nil Gem.default_dirs[:"#{scl_prefix}system"][:bin_dir] @@ -148,7 +160,7 @@ module Gem def default_ext_dir_for base_dir dir = if rpmbuild? - scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@' && base_dir =~ /\/#{c}\//} + scl_prefix = x_scls.detect {|c| c != '@SCL@' && base_dir =~ /\/#{c}\//} scl_prefix = scl_prefix ? scl_prefix + '_': nil build_dir = base_dir.chomp Gem.default_dirs[:"#{scl_prefix}system"][:gem_dir] diff --git a/SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch b/SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch index 6f16bae..75eb363 100644 --- a/SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch +++ b/SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch @@ -39,7 +39,7 @@ diff --git a/configure.in b/configure.in index 0e371e2..d4f1dcb 100644 --- a/configure.in +++ b/configure.in -@@ -4334,6 +4334,13 @@ AC_SUBST(rubyarchhdrdir)dnl +@@ -4374,6 +4374,13 @@ AC_SUBST(rubyarchhdrdir)dnl AC_SUBST(sitearchhdrdir)dnl AC_SUBST(vendorarchhdrdir)dnl diff --git a/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch b/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch index 33bd565..43fa7f6 100644 --- a/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch @@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in index 37d9a62..553d4d0 100644 --- a/configure.in +++ b/configure.in -@@ -3592,6 +3592,11 @@ if test ${multiarch+set}; then +@@ -3632,6 +3632,11 @@ if test ${multiarch+set}; then fi archlibdir='${libdir}/${arch}' diff --git a/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch b/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch index 6661f9b..eb34107 100644 --- a/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +++ b/SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch @@ -14,7 +14,7 @@ diff --git a/configure.in b/configure.in index db37cd6..ce8d149 100644 --- a/configure.in +++ b/configure.in -@@ -4188,7 +4188,8 @@ AS_CASE(["$ruby_version_dir_name"], +@@ -4228,7 +4228,8 @@ AS_CASE(["$ruby_version_dir_name"], ruby_version_dir=/'${ruby_version_dir_name}' if test -z "${ruby_version_dir_name}"; then diff --git a/SOURCES/ruby-2.1.0-always-use-i386.patch b/SOURCES/ruby-2.1.0-always-use-i386.patch index 3c3fcd4..9d78b05 100644 --- a/SOURCES/ruby-2.1.0-always-use-i386.patch +++ b/SOURCES/ruby-2.1.0-always-use-i386.patch @@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in index 553d4d0..03a4152 100644 --- a/configure.in +++ b/configure.in -@@ -4252,6 +4252,8 @@ AC_SUBST(vendorarchdir)dnl +@@ -4292,6 +4292,8 @@ AC_SUBST(vendorarchdir)dnl AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl diff --git a/SOURCES/ruby-2.1.0-custom-rubygems-location.patch b/SOURCES/ruby-2.1.0-custom-rubygems-location.patch index 36a7711..e82f172 100644 --- a/SOURCES/ruby-2.1.0-custom-rubygems-location.patch +++ b/SOURCES/ruby-2.1.0-custom-rubygems-location.patch @@ -15,7 +15,7 @@ diff --git a/configure.in b/configure.in index 03a4152..0e371e2 100644 --- a/configure.in +++ b/configure.in -@@ -4224,6 +4224,10 @@ AC_ARG_WITH(vendorarchdir, +@@ -4264,6 +4264,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) @@ -26,7 +26,7 @@ index 03a4152..0e371e2 100644 if test "${LOAD_RELATIVE+set}"; then AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -4248,6 +4252,7 @@ AC_SUBST(sitearchdir)dnl +@@ -4288,6 +4292,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl diff --git a/SOURCES/ruby-2.3.0-Disable-colorized-configure.patch b/SOURCES/ruby-2.3.0-Disable-colorized-configure.patch new file mode 100644 index 0000000..12cfd8a --- /dev/null +++ b/SOURCES/ruby-2.3.0-Disable-colorized-configure.patch @@ -0,0 +1,26 @@ +From 9806021813c9dde4747b0bd6f0ed24bdeede0a4a Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Fri, 15 Jul 2016 13:52:31 +0200 +Subject: [PATCH] Disable colorized ./configure + +Missing macro AS_FUNCTION_DESCRIBE in Autoconf +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 76b61f5..2432884 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -309,7 +309,7 @@ reconfig config.status: $(srcdir)/$(CONFIGURE) $(srcdir)/enc/Makefile.in \ + @PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \ + set $(SHELL) $($@-args); $(reconfig-exec-$(V)) + +-$(srcdir)/$(CONFIGURE): $(srcdir)/configure.in $(srcdir)/aclocal.m4 ++$(srcdir)/$(CONFIGURE): $(srcdir)/configure.in + $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F) + + incs: id.h +-- +1.8.3.1 + diff --git a/SOURCES/ruby-2.3.0-ruby_version.patch b/SOURCES/ruby-2.3.0-ruby_version.patch index 6a13e3a..cdd016c 100644 --- a/SOURCES/ruby-2.3.0-ruby_version.patch +++ b/SOURCES/ruby-2.3.0-ruby_version.patch @@ -20,7 +20,7 @@ diff --git a/configure.in b/configure.in index db37cd6..6e73fae 100644 --- a/configure.in +++ b/configure.in -@@ -4137,9 +4137,6 @@ AS_CASE(["$target_os"], +@@ -4177,9 +4177,6 @@ AS_CASE(["$target_os"], rubyw_install_name='$(RUBYW_INSTALL_NAME)' ]) @@ -30,7 +30,7 @@ index db37cd6..6e73fae 100644 rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} AC_ARG_WITH(rubyarchprefix, AS_HELP_STRING([--with-rubyarchprefix=DIR], -@@ -4162,58 +4159,64 @@ AC_ARG_WITH(ridir, +@@ -4202,58 +4199,64 @@ AC_ARG_WITH(ridir, AC_SUBST(ridir) AC_SUBST(RI_BASE_NAME) @@ -124,7 +124,7 @@ index db37cd6..6e73fae 100644 if test "${LOAD_RELATIVE+set}"; then AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) -@@ -4230,6 +4233,7 @@ AC_SUBST(sitearchincludedir)dnl +@@ -4270,6 +4273,7 @@ AC_SUBST(sitearchincludedir)dnl AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl @@ -286,7 +286,7 @@ diff --git a/configure.in b/configure.in index 6e73fae..c842725 100644 --- a/configure.in +++ b/configure.in -@@ -274,7 +274,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` +@@ -275,7 +275,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"` AC_SUBST(RUBY_BASE_NAME) AC_SUBST(RUBYW_BASE_NAME) diff --git a/SOURCES/ruby-2.3.0-undef-BUILTIN_CHOOSE_EXPR_CONSTANT_P.patch b/SOURCES/ruby-2.3.0-undef-BUILTIN_CHOOSE_EXPR_CONSTANT_P.patch deleted file mode 100644 index da7e980..0000000 --- a/SOURCES/ruby-2.3.0-undef-BUILTIN_CHOOSE_EXPR_CONSTANT_P.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 98e565ec78cb4a07ffde8589ac4581fca31e9c17 Mon Sep 17 00:00:00 2001 -From: mrkn -Date: Thu, 7 Jan 2016 13:35:32 +0000 -Subject: [PATCH] * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P - and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++. [ruby-core:72736] - [Bug #11962] - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - ChangeLog | 6 ++++++ - include/ruby/ruby.h | 7 +++++++ - 2 files changed, 13 insertions(+) - -diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h -index 7aabf5b..82dca14 100644 ---- a/include/ruby/ruby.h -+++ b/include/ruby/ruby.h -@@ -26,6 +26,13 @@ extern "C" { - #include RUBY_EXTCONF_H - #endif - -+#if defined(__cplusplus) -+/* __builtin_choose_expr and __builtin_types_compatible aren't available -+ * on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ -+# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P -+# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P -+#endif -+ - #include "defines.h" - - #define NORETURN_STYLE_NEW 1 diff --git a/SOURCES/ruby-2.4.0-no_proxy-with-whitespaces-and-leading-dots.patch b/SOURCES/ruby-2.4.0-no_proxy-with-whitespaces-and-leading-dots.patch new file mode 100644 index 0000000..fb91f9a --- /dev/null +++ b/SOURCES/ruby-2.4.0-no_proxy-with-whitespaces-and-leading-dots.patch @@ -0,0 +1,71 @@ +From 423d042371d0402071c309dc403ea2701600a98b Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sat, 13 Feb 2016 08:12:21 +0000 +Subject: [PATCH] no_proxy with whitespaces and leading dots + +* lib/uri/generic.rb (find_proxy): exclude white-spaces and allow + for a leading dot in the domain name in no_proxy. + [ruby-core:54542] [Feature #8317] + +The previous implementation wouldn't allow for white-spaces nor a leading dot +in the domain name. The latter is described in the wget documentation as a valid case. + +By being more strict on the characters, which are counted to a domainname, +we allow for white-spaces. +Also, a possible leading dot will be handled gracefully. + +[Fix GH-285] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + ChangeLog | 6 ++++++ + lib/uri/generic.rb | 2 +- + test/uri/test_generic.rb | 4 ++++ + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 2945679..44116e0 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++Sat Feb 13 17:11:58 2016 Fabian Wiesel ++ ++ * lib/uri/generic.rb (find_proxy): exclude white-spaces and allow ++ for a leading dot in the domain name in no_proxy. ++ [ruby-core:54542] [Feature #8317] ++ + Tue Apr 26 02:58:51 2016 Marcus Stollsteimer + + * doc/extension.rdoc: Improvements to english grammers. +diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb +index aba54c1..f2a2d56 100644 +--- a/lib/uri/generic.rb ++++ b/lib/uri/generic.rb +@@ -1546,7 +1546,7 @@ def find_proxy + + name = 'no_proxy' + if no_proxy = ENV[name] || ENV[name.upcase] +- no_proxy.scan(/([^:,]*)(?::(\d+))?/) {|host, port| ++ no_proxy.scan(/(?!\.)([^:,\s]+)(?::(\d+))?/) {|host, port| + if /(\A|\.)#{Regexp.quote host}\z/i =~ self.host && + (!port || self.port == port.to_i) + return nil +diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb +index fcfe1f9..ad189fc 100644 +--- a/test/uri/test_generic.rb ++++ b/test/uri/test_generic.rb +@@ -819,6 +819,14 @@ def test_find_proxy + assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy) + assert_nil(URI("http://192.0.2.2/").find_proxy) + } ++ with_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'example.org') { ++ assert_nil(URI("http://example.org/").find_proxy) ++ assert_nil(URI("http://www.example.org/").find_proxy) ++ } ++ with_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'.example.org') { ++ assert_nil(URI("http://example.org/").find_proxy) ++ assert_nil(URI("http://www.example.org/").find_proxy) ++ } + with_env('http_proxy'=>'') { + assert_nil(URI("http://192.0.2.1/").find_proxy) + assert_nil(URI("ftp://192.0.2.1/").find_proxy) diff --git a/SOURCES/test_dependent_scls.rb b/SOURCES/test_dependent_scls.rb index 1388f94..bff74d0 100644 --- a/SOURCES/test_dependent_scls.rb +++ b/SOURCES/test_dependent_scls.rb @@ -6,25 +6,36 @@ require 'rubygems/defaults/operating_system' class TestDependentSCLS < Test::Unit::TestCase def setup - # Avoid caching - Gem.class_eval("@default_locations, @default_dirs = nil, nil") - # TODO: Different bin dir during build ("/builddir/build/BUILD/ruby-2.0.0-p247") @bin_dir = Gem::ConfigMap[:bindir].split(File::SEPARATOR).last - @scl = ENV['X_SCLS'].strip + @scl_root = '/opt/rh/@SCL@/root' + + @env_orig = ['X_SCLS', 'GEM_PATH'].inject({}) do |env_orig, key| + env_orig[key] = ENV[key].dup + env_orig + end + end + + def teardown + # Avoid caching + Gem.class_eval("@x_scls, @default_locations, @default_dirs, @get_default_dirs = nil, nil, nil, nil") + + @env_orig.each { |key, val| ENV[key] = val } end def test_default_paths - default_locations = { :system => "/opt/rh/#{@scl}/root/usr", - :local => "/opt/rh/#{@scl}/root/usr/local" } + ENV['X_SCLS'] = '@SCL@' # enabled scls + + default_locations = { :system => "#{@scl_root}/usr", + :local => "#{@scl_root}/usr/local" } assert_equal default_locations, Gem.default_locations - default_dirs = { :system => { :bin_dir => "/opt/rh/#{@scl}/root/usr/#{@bin_dir}", - :gem_dir => "/opt/rh/#{@scl}/root/usr/share/gems", - :ext_dir => "/opt/rh/#{@scl}/root/usr/lib64/gems" }, - :local => { :bin_dir => "/opt/rh/#{@scl}/root/usr/local/#{@bin_dir}", - :gem_dir => "/opt/rh/#{@scl}/root/usr/local/share/gems", - :ext_dir => "/opt/rh/#{@scl}/root/usr/local/lib64/gems" } } + default_dirs = { :system => { :bin_dir => "#{@scl_root}/usr/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/share/gems", + :ext_dir => "#{@scl_root}/usr/lib64/gems" }, + :local => { :bin_dir => "#{@scl_root}/usr/local/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/local/share/gems", + :ext_dir => "#{@scl_root}/usr/local/lib64/gems" } } assert_equal default_dirs, Gem.default_dirs end @@ -34,31 +45,46 @@ class TestDependentSCLS < Test::Unit::TestCase # # See rhbz#1034639 def test_paths_with_dependent_scl - prefix = '/some/prefix' - scl_name = 'ruby_x' + test_scl = 'ruby_x' + test_root = "/some/prefix/#{test_scl}/root" + + ENV['X_SCLS'] = "@SCL@ #{test_scl}" # enabled scls + ENV['GEM_PATH'] = "#{test_root}/usr/share/gems" + + default_locations = { :system => "#{@scl_root}/usr", + :local => "#{@scl_root}/usr/local", + :"#{test_scl}_system" => "#{test_root}/usr", + :"#{test_scl}_local" => "#{test_root}/usr/local" } + assert_equal default_locations, Gem.default_locations - ENV['X_SCLS'] = "#{@scl} #{scl_name}" # enabled scls - ENV['GEM_PATH'] = "#{prefix}/#{scl_name}/root/usr/share/gems" + default_dirs = { :system => { :bin_dir => "#{@scl_root}/usr/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/share/gems", + :ext_dir => "#{@scl_root}/usr/lib64/gems" }, + :local => { :bin_dir => "#{@scl_root}/usr/local/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/local/share/gems", + :ext_dir => "#{@scl_root}/usr/local/lib64/gems" }, + :"#{test_scl}_system" => { :bin_dir => "#{test_root}/usr/#{@bin_dir}", + :gem_dir => "#{test_root}/usr/share/gems", + :ext_dir => "#{test_root}/usr/lib64/gems" }, + :"#{test_scl}_local" => { :bin_dir => "#{test_root}/usr/local/#{@bin_dir}", + :gem_dir => "#{test_root}/usr/local/share/gems", + :ext_dir => "#{test_root}/usr/local/lib64/gems" } } + assert_equal default_dirs, Gem.default_dirs + end - default_locations = { :system => "/opt/rh/#{@scl}/root/usr", - :local => "/opt/rh/#{@scl}/root/usr/local", - :"#{scl_name}_system" => "#{prefix}/#{scl_name}/root/usr", - :"#{scl_name}_local" => "#{prefix}/#{scl_name}/root/usr/local" } + def test_empty_x_scls + ENV['X_SCLS'] = nil # no enabled scls + default_locations = { :system => "#{@scl_root}/usr", + :local => "#{@scl_root}/usr/local" } assert_equal default_locations, Gem.default_locations - default_dirs = { :system => { :bin_dir => "/opt/rh/#{@scl}/root/usr/#{@bin_dir}", - :gem_dir => "/opt/rh/#{@scl}/root/usr/share/gems", - :ext_dir => "/opt/rh/#{@scl}/root/usr/lib64/gems" }, - :local => { :bin_dir => "/opt/rh/#{@scl}/root/usr/local/#{@bin_dir}", - :gem_dir => "/opt/rh/#{@scl}/root/usr/local/share/gems", - :ext_dir => "/opt/rh/#{@scl}/root/usr/local/lib64/gems" }, - :"#{scl_name}_system" => { :bin_dir => "#{prefix}/#{scl_name}/root/usr/#{@bin_dir}", - :gem_dir => "#{prefix}/#{scl_name}/root/usr/share/gems", - :ext_dir => "#{prefix}/#{scl_name}/root/usr/lib64/gems" }, - :"#{scl_name}_local" => { :bin_dir => "#{prefix}/#{scl_name}/root/usr/local/#{@bin_dir}", - :gem_dir => "#{prefix}/#{scl_name}/root/usr/local/share/gems", - :ext_dir => "#{prefix}/#{scl_name}/root/usr/local/lib64/gems" } } + default_dirs = { :system => { :bin_dir => "#{@scl_root}/usr/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/share/gems", + :ext_dir => "#{@scl_root}/usr/lib64/gems" }, + :local => { :bin_dir => "#{@scl_root}/usr/local/#{@bin_dir}", + :gem_dir => "#{@scl_root}/usr/local/share/gems", + :ext_dir => "#{@scl_root}/usr/local/lib64/gems" } } assert_equal default_dirs, Gem.default_dirs end diff --git a/SOURCES/test_systemtap.rb b/SOURCES/test_systemtap.rb index eb518df..5784e2d 100644 --- a/SOURCES/test_systemtap.rb +++ b/SOURCES/test_systemtap.rb @@ -3,8 +3,10 @@ require 'set' LIBRUBY_SO = 'libruby.so' PROBES_D = 'probes.d' -### -# Detect SystemTap section headers presence. +# These probes are excluded by VM_COLLECT_USAGE_DETAILS ifdef. +EXCLUDE_PROBES = Set.new %w(insn insn__operand) + +## Detect SystemTap section headers presence stap_headers = [ '\.stapsdt\.base', @@ -22,43 +24,42 @@ unless detected_stap_headers.size == 2 exit false end -### -# Find if every declared probe is propagated to resulting library. +## Find if every declared probe is propagated to resulting library # Colect probes specified in probes.d file. -probes = [] +probes_declared = [] File.open(PROBES_D) do |file| file.each_line do |line| if probe = line[/probe (\S+)\(.*\);/, 1] - probes << probe + probes_declared << probe end end end -probes = Set.new probes +probes_declared = Set.new probes_declared -# These probes are excluded by VM_COLLECT_USAGE_DETAILS ifdef. -EXCLUDE_PROBES = Set.new %w(insn insn__operand) -unless EXCLUDE_PROBES.subset? probes +unless EXCLUDE_PROBES.subset? probes_declared puts 'ERROR: Change in SystemTap (DTrace) probes definition file detected.' exit false end -probes -= EXCLUDE_PROBES +probes_declared -= EXCLUDE_PROBES # Detect probes in resulting library. -probe_regexp = %r{ -^\s*stapsdt\s*0[xX][0-9a-fA-F]+\tNT_STAPSDT \(SystemTap probe descriptors\)$ -^\s*Provider: ruby$ -^\s*Name: (\S+)$ +get_probes_detected = %r{ +^\s*Provider:\s+ruby,\s+Name:\s+(\S+),\s+.*$ } -notes = `readelf -n "#{LIBRUBY_SO}"` -detected_probes = Set.new notes.scan(probe_regexp).flatten +probes_detected = `eu-readelf -n "#{LIBRUBY_SO}"` + +probes_detected = Set.new probes_detected.scan(get_probes_detected).flatten # Both sets must be equal, otherwise something is wrong. -unless probes == detected_probes +unless probes_declared == probes_detected puts 'ERROR: SystemTap (DTrace) probes were not correctly propagated into resulting library.' + puts " Undetected probes: #{(probes_declared - probes_detected).sort.join(', ')}\n", + " Additional detected probes: #{(probes_detected - probes_declared).sort.join(', ')}" + exit false end diff --git a/SPECS/ruby.spec b/SPECS/ruby.spec index 57bc909..41d011f 100644 --- a/SPECS/ruby.spec +++ b/SPECS/ruby.spec @@ -3,7 +3,7 @@ %global major_version 2 %global minor_version 3 -%global teeny_version 0 +%global teeny_version 1 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -23,7 +23,7 @@ %global ruby_archive %{ruby_archive}-%{?milestone}%{?!milestone:%{?revision:r%{revision}}} %endif -%global release 60 +%global release 64 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -58,10 +58,6 @@ %global _normalized_cpu %(echo %{_target_cpu} | sed 's/^ppc/powerpc/;s/i.86/i386/;s/sparcv./sparc/') -%if 0%{?fedora} >= 19 -%global with_rubypick 1 -%endif - Summary: An interpreter of object-oriented scripting language Name: %{?scl_prefix}ruby Version: %{ruby_version} @@ -125,10 +121,13 @@ Patch6: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch # Use miniruby to regenerate prelude.c. # https://bugs.ruby-lang.org/issues/10554 Patch7: ruby-2.2.3-Generate-preludes-using-miniruby.patch -# 98e565ec78cb4a07ffde8589ac4581fca31e9c17 -# https://bugs.ruby-lang.org/issues/11962 -# https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/53455 -Patch8: ruby-2.3.0-undef-BUILTIN_CHOOSE_EXPR_CONSTANT_P.patch +# Disable colorized ./configure due to missing macro AS_FUNCTION_DESCRIBE in Autoconf +# http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/m4sugar/m4sh.m4?id=d99fef0e1e8e7a4c04b97fc4c6e0ffb01463622c +Patch9: ruby-2.3.0-Disable-colorized-configure.patch +# Support in no_proxy for domain names with whitespaces and leading dots +# https://bugzilla.redhat.com/show_bug.cgi?id=1384810 +# https://github.com/ruby/ruby/commit/423d042371d0402071c309dc403ea2701600a98b +Patch10: ruby-2.4.0-no_proxy-with-whitespaces-and-leading-dots.patch Requires: %{?scl_prefix}%{pkg_name}-libs%{?_isa} = %{version}-%{release} Requires: %{?scl_prefix}ruby(rubygems) >= %{rubygems_version} @@ -137,6 +136,7 @@ Requires: %{?scl_prefix}ruby(rubygems) >= %{rubygems_version} # See https://bugzilla.redhat.com/show_bug.cgi?id=829209 # and http://bugs.ruby-lang.org/issues/6123 Requires: %{?scl_prefix}rubygem(bigdecimal) >= %{bigdecimal_version} +Requires: %{?scl_prefix}rubygem(did_you_mean) >= %{did_you_mean_version} %{?scl:BuildRequires: %{scl}-runtime} BuildRequires: autoconf BuildRequires: gdbm-devel @@ -156,6 +156,8 @@ BuildRequires: %{?_root_bindir}%{!?_root_bindir:%{_bindir}}/cmake # virtual provide. It can be installed as dependency of rubypick. Provides: ruby(runtime_executable) = %{ruby_release} +%global __provides_exclude_from ^(%{ruby_libarchdir}|%{gem_archdir})/.*\\.so$ + %description Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text @@ -175,6 +177,8 @@ Ruby or an application embedding Ruby. Summary: Libraries necessary to run Ruby Group: Development/Libraries License: Ruby or BSD +# This could be removed once rhbz#1054711 is resolved. +%{?scl:Requires: %{scl}-runtime} Provides: %{?scl_prefix}ruby(release) = %{ruby_release} # Virtual provides for CCAN copylibs. @@ -463,7 +467,11 @@ rm -rf ext/fiddle/libffi* %patch5 -p1 %patch6 -p1 %patch7 -p1 -%patch8 -p1 +%patch9 -p1 +%patch10 -p1 + +# Allow to use autoconf 2.63. +sed -i '/AC_PREREQ/ s/(.*)/(2.62)/' configure.in # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -473,6 +481,9 @@ cp -a %{SOURCE3} . # https://github.com/ruby/ruby/blob/trunk/tool/compile_prelude.rb#L26 cp -a %{SOURCE6} . +# Disable colorized ./configure +rm aclocal.m4 + %build autoconf @@ -621,10 +632,12 @@ sed -i 's/^/%lang(ja) /' .ruby-doc.ja %check # Ruby software collection tests %{?scl:scl enable %scl - << \EOF +set -e mkdir -p ./lib/rubygems/defaults cp %{SOURCE1} ./lib/rubygems/defaults -make test-all TESTS="%{SOURCE14}" || exit 1 -rm -rf ./lib/rubygems/defaults +sed 's/@SCL@/%{scl}/' %{SOURCE14} > ./%{basename:%{SOURCE14}} +make test-all TESTS="%{basename:%{SOURCE14}}" +rm -rf ./lib/rubygems/defaults ./%{basename:%{SOURCE14}} EOF} # Check RubyGems version correctness. @@ -651,7 +664,7 @@ DISABLE_TESTS="" # Once seen: http://koji.fedoraproject.org/koji/taskinfo?taskID=12556650 DISABLE_TESTS="$DISABLE_TESTS -x test_fork.rb" -TZ=UTC make check TESTS="-v $DISABLE_TESTS" +make check TESTS="-v $DISABLE_TESTS" %post libs -p /sbin/ldconfig @@ -864,8 +877,6 @@ TZ=UTC make check TESTS="-v $DISABLE_TESTS" %config(noreplace) %{_root_sysconfdir}/rpm/macros.rubygems%{?scl:.%{scl}} %files -n %{?scl_prefix}rubygem-rake -# TODO: file is missing -#%{ruby_libdir}/rake* %{_bindir}/rake %{gem_dir}/gems/rake-%{rake_version} %{gem_dir}/specifications/rake-%{rake_version}.gemspec @@ -954,7 +965,31 @@ TZ=UTC make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog -* Wed Apr 13 2016 Pavel Valena +* Wed Oct 26 2016 Pavel Valena - 2.3.1-64 +- Fix: do not fail in operating_system.rb when X_SCLS is empty + Resolves: rhbz#1387139 + +* Mon Oct 17 2016 Pavel Valena - 2.3.1-63 +- Support in no_proxy for domain names with whitespaces and leading dots + Resolves: rhbz#1384810 + +* Fri Aug 12 2016 Pavel Valena - 2.3.1-62 +- Fix support for dependent^2 SCLs +- Update to Ruby 2.3.1 + * Remove Patch8: + ruby-2.3.0-undef-BUILTIN_CHOOSE_EXPR_CONSTANT_P.patch; subsumed + * Remove Patch10: + ruby-2.3.1-remove-tests-depending-on-europe-moscow.patch; subsumed + also removed "UTC=TZ " tests prefix + +* Mon Jul 25 2016 Pavel Valena - 2.3.0-61 +- Add %%{scl}-runtime to Requires in libs subpackage + +* Tue Jul 19 2016 Pavel Valena - 2.3.0-60 +- Fix and enhance systemtap tests +- Remove tests depending on Europe/Moscow to avoid failures due to tzdata change + +* Wed Apr 13 2016 Pavel Valena - 2.3.0-60 - Fix ruby lib path in macros.ruby.rh-ruby23 - Resolves: rhbz#1255753 - Manually set UTC timezone for tests