From 4c12d4e704a383f79d42d06832477b79224d2181 Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Jan 05 2016 10:00:48 +0000 Subject: Upgrade to Ruby 2.3.0. --- diff --git a/.gitignore b/.gitignore index 81f7fc1..3523d77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ +/*/ /ruby-2.*.tar.bz2 -/ruby-2.2.0.tar.xz -/ruby-2.2.1.tar.xz -/ruby-2.2.2.tar.xz -/ruby-2.2.3.tar.xz -/ruby-2.2.4.tar.xz +/ruby-2.*.tar.xz +/*.rpm diff --git a/macros.rubygems b/macros.rubygems index 1043c02..6d99ac3 100644 --- a/macros.rubygems +++ b/macros.rubygems @@ -20,8 +20,7 @@ CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\ gem install \\\ -V \\\ --local \\\ - --install-dir %{-d*}%{!?-d:.%{gem_dir}} \\\ - --bindir .%{_bindir} \\\ + --build-root %{-d*}%{!?-d:.} \\\ --force \\\ --document=ri,rdoc \\\ %{-n*}%{!?-n:%{gem_name}-%{version}.gem} \ diff --git a/operating_system.rb b/operating_system.rb index ed653fd..4b2903d 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -14,11 +14,27 @@ module Gem private :previous_but_one_dir_to ## + # Detects --install-dir option specified on command line. + + def opt_install_dir? + @opt_install_dir ||= ARGV.include?('--install-dir') || ARGV.include?('-i') + end + private :opt_install_dir? + + ## + # Detects --build-root option specified on command line. + + def opt_build_root? + @opt_build_root ||= ARGV.include?('--build-root') + end + private :opt_build_root? + + ## # Tries to detect, if arguments and environment variables suggest that # 'gem install' is executed from rpmbuild. def rpmbuild? - (ARGV.include?('--install-dir') || ARGV.include?('-i')) && ENV['RPM_PACKAGE_NAME'] + @rpmbuild ||= ENV['RPM_PACKAGE_NAME'] && (opt_install_dir? || opt_build_root?) end private :rpmbuild? @@ -80,7 +96,9 @@ module Gem # RubyGems default overrides. def default_dir - if Process.uid == 0 + if opt_build_root? + Gem.default_dirs[:system][:gem_dir] + elsif Process.uid == 0 Gem.default_dirs[:local][:gem_dir] else Gem.user_dir @@ -93,7 +111,9 @@ module Gem end def default_bindir - if Process.uid == 0 + if opt_build_root? + Gem.default_dirs[:system][:bin_dir] + elsif Process.uid == 0 Gem.default_dirs[:local][:bin_dir] else File.join [Dir.home, 'bin'] diff --git a/ruby-1.9.3-mkmf-verbose.patch b/ruby-1.9.3-mkmf-verbose.patch index 0f2a742..ccbd972 100644 --- a/ruby-1.9.3-mkmf-verbose.patch +++ b/ruby-1.9.3-mkmf-verbose.patch @@ -11,7 +11,7 @@ diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 682eb46..e6b1445 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb -@@ -1859,7 +1859,7 @@ SRC +@@ -1892,7 +1892,7 @@ def configuration(srcdir) SHELL = /bin/sh # V=0 quiet, V=1 verbose. other values don't work. diff --git a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch index 6eb6122..6f16bae 100644 --- a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch +++ b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch @@ -13,9 +13,9 @@ diff --git a/Makefile.in b/Makefile.in index 7e8ed82..7916993 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -114,6 +114,8 @@ XRUBY_LIBDIR = @XRUBY_LIBDIR@ - XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ +@@ -116,6 +116,8 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ + BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ +OPTIONAL_PRELUDES = @OPTIONAL_PRELUDES@ + @@ -26,7 +26,7 @@ diff --git a/common.mk b/common.mk index 5cfbc3d..3f0a82e 100644 --- a/common.mk +++ b/common.mk -@@ -117,7 +117,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) +@@ -127,7 +127,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT) DEFAULT_PRELUDES = $(GEM_PRELUDE) @@ -39,7 +39,7 @@ diff --git a/configure.in b/configure.in index 0e371e2..d4f1dcb 100644 --- a/configure.in +++ b/configure.in -@@ -4169,6 +4169,13 @@ AC_SUBST(rubyarchhdrdir)dnl +@@ -4334,6 +4334,13 @@ AC_SUBST(rubyarchhdrdir)dnl AC_SUBST(sitearchhdrdir)dnl AC_SUBST(vendorarchhdrdir)dnl diff --git a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch index b54f8e0..33bd565 100644 --- a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/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 -@@ -3385,6 +3385,11 @@ if test ${multiarch+set}; then +@@ -3592,6 +3592,11 @@ if test ${multiarch+set}; then fi archlibdir='${libdir}/${arch}' diff --git a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch index b401158..6661f9b 100644 --- a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +++ b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch @@ -5,71 +5,25 @@ Subject: [PATCH] Prevent duplicated paths when empty version string is configured. --- - configure.in | 15 +++++++++------ + configure.in | 3 ++- loadpath.c | 12 ++++++++++++ tool/mkconfig.rb | 2 +- - 3 files changed, 22 insertions(+), 7 deletions(-) + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in -index 17ed3ed..5843651 100644 +index db37cd6..ce8d149 100644 --- a/configure.in +++ b/configure.in -@@ -3975,8 +3975,6 @@ AS_CASE(["$target_os"], - rubyw_install_name='$(RUBYW_INSTALL_NAME)' - ]) +@@ -4188,7 +4188,8 @@ AS_CASE(["$ruby_version_dir_name"], + ruby_version_dir=/'${ruby_version_dir_name}' --rubylibdir='${rubylibprefix}/${ruby_version}' --rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'} - - rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} - AC_ARG_WITH(rubyarchprefix, -@@ -4006,6 +4004,7 @@ AC_ARG_WITH(ruby-version, - [ruby_version=full]) - unset RUBY_LIB_VERSION - unset RUBY_LIB_VERSION_STYLE -+ruby_version_suffix=/'${ruby_version}' - AS_CASE(["$ruby_version"], - [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'], - [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */']) -@@ -4022,30 +4021,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then - ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`" - eval $ruby_version - elif test -z "${ruby_version}"; then + if test -z "${ruby_version_dir_name}"; then - AC_MSG_ERROR([No ruby version, No place for bundled libraries]) -+ unset ruby_version_suffix ++ unset ruby_version_dir + AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1) - else - RUBY_LIB_VERSION="${ruby_version}" fi - AC_SUBST(RUBY_LIB_VERSION_STYLE) - AC_SUBST(RUBY_LIB_VERSION) - -+rubylibdir='${rubylibprefix}'${ruby_version_suffix} -+rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_suffix}}${multiarch-'${rubylibdir}/${arch}'} -+ - AC_ARG_WITH(sitedir, - AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]), - [sitedir=$withval], - [sitedir='${rubylibprefix}/site_ruby']) --sitelibdir='${sitedir}/${ruby_version}' -+sitelibdir='${sitedir}'${ruby_version_suffix} - - AC_ARG_WITH(sitearchdir, - AS_HELP_STRING([--with-sitearchdir=DIR], - [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]), - [sitearchdir=$withval], -- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}]) -+ [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_suffix}}${multiarch-'${sitelibdir}/${sitearch}'}]) - - AC_ARG_WITH(vendordir, - AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]), - [vendordir=$withval], - [vendordir='${rubylibprefix}/vendor_ruby']) --vendorlibdir='${vendordir}/${ruby_version}' -+vendorlibdir='${vendordir}'${ruby_version_suffix} - AC_ARG_WITH(vendorarchdir, - AS_HELP_STRING([--with-vendorarchdir=DIR], + rubylibdir='${rubylibprefix}'${ruby_version_dir} diff --git a/loadpath.c b/loadpath.c index 9160031..0d4d953 100644 --- a/loadpath.c @@ -113,7 +67,7 @@ diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index 07076d4..35e6c3c 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb -@@ -123,7 +123,7 @@ File.foreach "config.status" do |line| +@@ -122,7 +122,7 @@ def config.write(arg) val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump case name when /^prefix$/ diff --git a/ruby-2.1.0-always-use-i386.patch b/ruby-2.1.0-always-use-i386.patch index f8e61f5..3c3fcd4 100644 --- a/ruby-2.1.0-always-use-i386.patch +++ b/ruby-2.1.0-always-use-i386.patch @@ -11,8 +11,8 @@ diff --git a/configure.in b/configure.in index 553d4d0..03a4152 100644 --- a/configure.in +++ b/configure.in -@@ -4087,6 +4087,8 @@ AC_SUBST(vendorarchdir)dnl - +@@ -4252,6 +4252,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 +target_cpu=`echo $target_cpu | sed s/i.86/i386/` diff --git a/ruby-2.1.0-custom-rubygems-location.patch b/ruby-2.1.0-custom-rubygems-location.patch index c21c858..36a7711 100644 --- a/ruby-2.1.0-custom-rubygems-location.patch +++ b/ruby-2.1.0-custom-rubygems-location.patch @@ -15,9 +15,9 @@ diff --git a/configure.in b/configure.in index 03a4152..0e371e2 100644 --- a/configure.in +++ b/configure.in -@@ -4061,6 +4061,10 @@ AC_ARG_WITH(vendorarchdir, +@@ -4224,6 +4224,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], - [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}]) + [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) +AC_ARG_WITH(rubygemsdir, + AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]), @@ -26,14 +26,14 @@ index 03a4152..0e371e2 100644 if test "${LOAD_RELATIVE+set}"; then AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -4084,6 +4088,7 @@ AC_SUBST(sitearchdir)dnl +@@ -4248,6 +4252,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl +AC_SUBST(rubygemsdir)dnl + AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl - diff --git a/loadpath.c b/loadpath.c index 623dc9d..74c5d9e 100644 --- a/loadpath.c @@ -53,7 +53,7 @@ diff --git a/template/verconf.h.tmpl b/template/verconf.h.tmpl index 79c003e..34f2382 100644 --- a/template/verconf.h.tmpl +++ b/template/verconf.h.tmpl -@@ -34,6 +34,9 @@ +@@ -36,6 +36,9 @@ % if C["RUBY_SEARCH_PATH"] #define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}" % end @@ -67,7 +67,7 @@ diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index b47b6e1..0b99408 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb -@@ -317,6 +317,7 @@ sitelibdir = CONFIG["sitelibdir"] +@@ -328,6 +328,7 @@ def CONFIG.[](name, mandatory = false) sitearchlibdir = CONFIG["sitearchdir"] vendorlibdir = CONFIG["vendorlibdir"] vendorarchlibdir = CONFIG["vendorarchdir"] @@ -75,7 +75,7 @@ index b47b6e1..0b99408 100755 mandir = CONFIG["mandir", true] docdir = CONFIG["docdir", true] configure_args = Shellwords.shellwords(CONFIG["configure_args"]) -@@ -505,7 +506,15 @@ end +@@ -506,7 +507,15 @@ def CONFIG.[](name, mandatory = false) install?(:local, :comm, :lib) do prepare "library scripts", rubylibdir noinst = %w[README* *.txt *.rdoc *.gemspec] diff --git a/ruby-2.2.3-Generate-preludes-using-miniruby.patch b/ruby-2.2.3-Generate-preludes-using-miniruby.patch index 81b7c5b..aa17411 100644 --- a/ruby-2.2.3-Generate-preludes-using-miniruby.patch +++ b/ruby-2.2.3-Generate-preludes-using-miniruby.patch @@ -1,4 +1,4 @@ -From 9fedac991e717f0103d092275ac301e58c5cf010 Mon Sep 17 00:00:00 2001 +From 07eb5f5e775dec01a92a8b13910eaced9e8ee0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 2 Dec 2014 10:56:58 +0100 Subject: [PATCH] Generate preludes using miniruby. @@ -8,10 +8,10 @@ Subject: [PATCH] Generate preludes using miniruby. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.mk b/common.mk -index 76f1621..b0f6e28 100644 +index 168dc52..20c218a 100644 --- a/common.mk +++ b/common.mk -@@ -782,9 +782,9 @@ $(PRELUDE_C): $(COMPILE_PRELUDE) \ +@@ -839,9 +839,9 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(PRELUDE_C): $(COMPILE_PRELUDE) \ {$(srcdir)}lib/rubygems/defaults.rb \ {$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \ @@ -24,5 +24,5 @@ index 76f1621..b0f6e28 100644 {$(VPATH)}golf_prelude.c: $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb -- -2.1.0 +2.6.3 diff --git a/ruby-2.3.0-ruby_version.patch b/ruby-2.3.0-ruby_version.patch new file mode 100644 index 0000000..6a13e3a --- /dev/null +++ b/ruby-2.3.0-ruby_version.patch @@ -0,0 +1,300 @@ +From 4fc1be3af3f58621bb751c9e63c208b15c0e8d16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 31 Mar 2015 16:21:04 +0200 +Subject: [PATCH 1/4] Use ruby_version_dir_name for versioned directories. + +This disallows changing the ruby_version constant by --with-ruby-version +configuration options. The two places version numbers are disallowed as +well, since there are a lot of places which cannot handle this format +properly. + +ruby_version_dir_name now specifies custom version string for versioned +directories, e.g. instead of default X.Y.Z, you can specify whatever +string. +--- + configure.in | 68 ++++++++++++++++++++++++++++------------------------- + template/ruby.pc.in | 1 + + 2 files changed, 37 insertions(+), 32 deletions(-) + +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"], + rubyw_install_name='$(RUBYW_INSTALL_NAME)' + ]) + +-rubylibdir='${rubylibprefix}/${ruby_version}' +-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'} +- + 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, + AC_SUBST(ridir) + AC_SUBST(RI_BASE_NAME) + +-AC_ARG_WITH(ruby-version, +- AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]), +- [ruby_version=$withval], +- [ruby_version=full]) + unset RUBY_LIB_VERSION +-unset RUBY_LIB_VERSION_STYLE +-AS_CASE(["$ruby_version"], +- [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'], +- [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */']) +-if test ${RUBY_LIB_VERSION_STYLE+set}; then +- { +- echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" +- echo '#define STRINGIZE(x) x' +- test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0' +- echo '#include "verconf.h"' +- echo '#include "version.h"' +- echo 'ruby_version=RUBY_LIB_VERSION' +- } > conftest.c +- test -f verconf.h || > verconf.h +- ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`" +- eval $ruby_version +-elif test -z "${ruby_version}"; then +- AC_MSG_ERROR([No ruby version, No place for bundled libraries]) +-else +- RUBY_LIB_VERSION="${ruby_version}" +-fi ++RUBY_LIB_VERSION_STYLE='3 /* full */' ++{ ++echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" ++echo '#define STRINGIZE(x) x' ++test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0' ++echo '#include "verconf.h"' ++echo '#include "version.h"' ++echo 'ruby_version=RUBY_LIB_VERSION' ++} > conftest.c ++test -f verconf.h || > verconf.h ++ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`" ++eval $ruby_version ++ ++RUBY_LIB_VERSION="${ruby_version}" ++ + AC_SUBST(RUBY_LIB_VERSION_STYLE) + AC_SUBST(RUBY_LIB_VERSION) + ++AC_ARG_WITH(ruby-version, ++ AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|STR)]), ++ [ruby_version_dir_name=$withval], ++ [ruby_version_dir_name=full]) ++AS_CASE(["$ruby_version_dir_name"], ++ [full], [ruby_version_dir_name='${ruby_version}']) ++ ++ruby_version_dir=/'${ruby_version_dir_name}' ++ ++if test -z "${ruby_version_dir_name}"; then ++ AC_MSG_ERROR([No ruby version, No place for bundled libraries]) ++fi ++ ++rubylibdir='${rubylibprefix}'${ruby_version_dir} ++rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_dir}}${multiarch-'${rubylibdir}/${arch}'} ++ + AC_ARG_WITH(sitedir, + AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]), + [sitedir=$withval], + [sitedir='${rubylibprefix}/site_ruby']) +-sitelibdir='${sitedir}/${ruby_version}' ++sitelibdir='${sitedir}'${ruby_version_dir} + + AC_ARG_WITH(sitearchdir, + AS_HELP_STRING([--with-sitearchdir=DIR], + [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]), + [sitearchdir=$withval], +- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}]) ++ [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_dir}}${multiarch-'${sitelibdir}/${sitearch}'}]) + + AC_ARG_WITH(vendordir, + AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]), + [vendordir=$withval], + [vendordir='${rubylibprefix}/vendor_ruby']) +-vendorlibdir='${vendordir}/${ruby_version}' ++vendorlibdir='${vendordir}'${ruby_version_dir} + + AC_ARG_WITH(vendorarchdir, + AS_HELP_STRING([--with-vendorarchdir=DIR], + [architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]), + [vendorarchdir=$withval], +- [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}]) ++ [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) + + if test "${LOAD_RELATIVE+set}"; then + AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) +@@ -4230,6 +4233,7 @@ AC_SUBST(sitearchincludedir)dnl + AC_SUBST(arch)dnl + AC_SUBST(sitearch)dnl + AC_SUBST(ruby_version)dnl ++AC_SUBST(ruby_version_dir_name)dnl + AC_SUBST(rubylibdir)dnl + AC_SUBST(rubyarchdir)dnl + AC_SUBST(sitedir)dnl +diff --git a/template/ruby.pc.in b/template/ruby.pc.in +index 8a2c066..c81b211 100644 +--- a/template/ruby.pc.in ++++ b/template/ruby.pc.in +@@ -9,6 +9,7 @@ MAJOR=@MAJOR@ + MINOR=@MINOR@ + TEENY=@TEENY@ + ruby_version=@ruby_version@ ++ruby_version_dir_name=@ruby_version_dir_name@ + RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@ + RUBY_BASE_NAME=@RUBY_BASE_NAME@ + RUBY_VERSION_NAME=@RUBY_VERSION_NAME@ +-- +2.1.0 + + +From 518850aba6eee76de7715aae8d37330e34b01983 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 31 Mar 2015 16:37:26 +0200 +Subject: [PATCH 2/4] Add ruby_version_dir_name support for RDoc. + +--- + lib/rdoc/ri/paths.rb | 2 +- + tool/rbinstall.rb | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb +index 970cb91..5bf8230 100644 +--- a/lib/rdoc/ri/paths.rb ++++ b/lib/rdoc/ri/paths.rb +@@ -10,7 +10,7 @@ module RDoc::RI::Paths + #:stopdoc: + require 'rbconfig' + +- version = RbConfig::CONFIG['ruby_version'] ++ version = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + + BASE = if RbConfig::CONFIG.key? 'ridir' then + File.join RbConfig::CONFIG['ridir'], version +diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb +index d4c110e..d39c9a6 100755 +--- a/tool/rbinstall.rb ++++ b/tool/rbinstall.rb +@@ -406,7 +406,7 @@ def CONFIG.[](name, mandatory = false) + + install?(:doc, :rdoc) do + if $rdocdir +- ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version'], "system") ++ ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version_dir_name'] || CONFIG['ruby_version'], "system") + prepare "rdoc", ridatadir + install_recursive($rdocdir, ridatadir, :mode => $data_mode) + end +-- +2.1.0 + + +From f8d136f9a46d1fe87eba622ab9665935d05e981b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 31 Mar 2015 16:37:44 +0200 +Subject: [PATCH 3/4] Add ruby_version_dir_name support for RubyGems. + +--- + lib/rubygems/defaults.rb | 11 ++++++----- + test/rubygems/test_gem.rb | 5 +++-- + 2 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb +index 55ca080..75eea2b 100644 +--- a/lib/rubygems/defaults.rb ++++ b/lib/rubygems/defaults.rb +@@ -32,20 +32,20 @@ def self.default_dir + [ + File.dirname(RbConfig::CONFIG['sitedir']), + 'Gems', +- RbConfig::CONFIG['ruby_version'] ++ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + ] + elsif RbConfig::CONFIG['rubylibprefix'] then + [ + RbConfig::CONFIG['rubylibprefix'], + 'gems', +- RbConfig::CONFIG['ruby_version'] ++ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + ] + else + [ + RbConfig::CONFIG['libdir'], + ruby_engine, + 'gems', +- RbConfig::CONFIG['ruby_version'] ++ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + ] + end + +@@ -75,7 +75,8 @@ def self.default_rubygems_dirs + + def self.user_dir + parts = [Gem.user_home, '.gem', ruby_engine] +- parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? ++ ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] ++ parts << ruby_version_dir_name unless ruby_version_dir_name.empty? + File.join parts + end + +@@ -172,7 +173,7 @@ def self.vendor_dir # :nodoc: + return nil unless RbConfig::CONFIG.key? 'vendordir' + + File.join RbConfig::CONFIG['vendordir'], 'gems', +- RbConfig::CONFIG['ruby_version'] ++ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + end + + end +diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb +index 0428bea..b6e090e 100644 +--- a/test/rubygems/test_gem.rb ++++ b/test/rubygems/test_gem.rb +@@ -963,7 +963,8 @@ def test_self_use_paths + + def test_self_user_dir + parts = [@userhome, '.gem', Gem.ruby_engine] +- parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? ++ ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] ++ parts << ruby_version_dir_name unless ruby_version_dir_name.empty? + + assert_equal File.join(parts), Gem.user_dir + end +@@ -1090,7 +1091,7 @@ def test_self_user_home_user_drive_and_path + def test_self_vendor_dir + expected = + File.join RbConfig::CONFIG['vendordir'], 'gems', +- RbConfig::CONFIG['ruby_version'] ++ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + + assert_equal expected, Gem.vendor_dir + end +-- +2.1.0 + + +From 88c38a030c22dbf9422ece847bdfbf87d6659313 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Wed, 1 Apr 2015 14:55:37 +0200 +Subject: [PATCH 4/4] Let headers directories follow the configured version + name. + +--- + configure.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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"` + RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"` + AC_SUBST(RUBY_BASE_NAME) + AC_SUBST(RUBYW_BASE_NAME) +-AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}') ++AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version_dir_name}') + + AC_CANONICAL_TARGET + test x"$target_alias" = x && +-- +2.1.0 + diff --git a/ruby.spec b/ruby.spec index 3e4f698..999130a 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,16 +1,16 @@ %global major_version 2 -%global minor_version 2 -%global teeny_version 4 +%global minor_version 3 +%global teeny_version 0 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} %global ruby_release %{ruby_version} # Specify the named version. It has precedense to revision. -#%%global milestone rc1 +#%%global milestone preview2 # Keep the revision enabled for pre-releases from SVN. -#%%global revision 48936 +#%%global revision 53264 %global ruby_archive %{name}-%{ruby_version} @@ -21,28 +21,32 @@ %endif -%global release 47 +%global release 50 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} -%global rubygems_version 2.4.5.1 - # The RubyGems library has to stay out of Ruby directory three, since the # RubyGems should be share by all Ruby implementations. %global rubygems_dir %{_datadir}/rubygems +# Bundled libraries versions +%global rubygems_version 2.5.1 +%global molinillo_version 0.4.0 + # TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM. # http://redmine.ruby-lang.org/issues/5313 %global irb_version %{ruby_version} -%global bigdecimal_version 1.2.6 -%global io_console_version 0.4.3 -%global json_version 1.8.1 -%global minitest_version 5.4.3 -%global power_assert_version 0.2.2 -%global psych_version 2.0.8 +%global bigdecimal_version 1.2.8 +%global did_you_mean_version 1.0.0 +%global io_console_version 0.4.5 +%global json_version 1.8.3 +%global minitest_version 5.8.3 +%global power_assert_version 0.2.6 +%global psych_version 2.0.17 %global rake_version 10.4.2 -%global rdoc_version 4.2.0 -%global test_unit_version 3.0.8 +%global rdoc_version 4.2.1 +%global net_telnet_version 0.1.1 +%global test_unit_version 3.1.5 # Might not be needed in the future, if we are lucky enough. # https://bugzilla.redhat.com/show_bug.cgi?id=888262 @@ -84,25 +88,28 @@ Source7: config.h Source8: rubygems.attr Source9: rubygems.req Source10: rubygems.prov -# SystemTap sanity test case. -Source11: test_systemtap.rb # ABRT hoook test case. Source12: test_abrt.rb +# SystemTap tests. +Source13: test_systemtap.rb # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. %{?load:%{SOURCE4}} %{?load:%{SOURCE5}} +# Fix ruby_version abuse. +# https://bugs.ruby-lang.org/issues/11002 +Patch0: ruby-2.3.0-ruby_version.patch # http://bugs.ruby-lang.org/issues/7807 -Patch0: ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +Patch1: ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch # Allows to override libruby.so placement. Hopefully we will be able to return # to plain --with-rubyarchprefix. # http://bugs.ruby-lang.org/issues/8973 -Patch1: ruby-2.1.0-Enable-configuration-of-archlibdir.patch +Patch2: ruby-2.1.0-Enable-configuration-of-archlibdir.patch # Force multiarch directories for i.86 to be always named i386. This solves # some differencies in build between Fedora and RHEL. -Patch2: ruby-2.1.0-always-use-i386.patch +Patch3: ruby-2.1.0-always-use-i386.patch # Allows to install RubyGems into custom directory, outside of Ruby's tree. # http://bugs.ruby-lang.org/issues/5617 Patch4: ruby-2.1.0-custom-rubygems-location.patch @@ -117,12 +124,10 @@ Patch6: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch Patch7: ruby-2.2.3-Generate-preludes-using-miniruby.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Requires: ruby(rubygems) >= %{rubygems_version} -# Make the bigdecimal gem a runtime dependency of Ruby to avoid problems -# with user-installed gems, that don't require it in gemspec/Gemfile -# See https://bugzilla.redhat.com/show_bug.cgi?id=829209 -# and http://bugs.ruby-lang.org/issues/6123 -Requires: rubygem(bigdecimal) >= %{bigdecimal_version} +Suggests: rubypick +Recommends: ruby(rubygems) >= %{rubygems_version} +Recommends: rubygem(bigdecimal) >= %{bigdecimal_version} +Recommends: rubygem(did_you_mean) >= %{did_you_mean_version} BuildRequires: autoconf BuildRequires: gdbm-devel @@ -142,8 +147,6 @@ BuildRequires: %{_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 @@ -166,9 +169,17 @@ Group: Development/Libraries License: Ruby or BSD Provides: ruby(release) = %{ruby_release} +# Virtual provides for CCAN copylibs. +# https://fedorahosted.org/fpc/ticket/364 +Provides: bundled(ccan-build_assert) +Provides: bundled(ccan-check_type) +Provides: bundled(ccan-container_of) +Provides: bundled(ccan-list) + %description libs This package includes the libruby, necessary to run Ruby. + # TODO: Rename or not rename to ruby-rubygems? %package -n rubygems Summary: The Ruby standard for packaging ruby libraries @@ -176,13 +187,14 @@ Version: %{rubygems_version} Group: Development/Libraries License: Ruby or MIT Requires: ruby(release) -Requires: rubygem(rdoc) >= %{rdoc_version} -# TODO: This seems to be optional now. -# https://github.com/rubygems/rubygems/commit/68da16dd7508c5c4010bfe32f99422568d3d582f -Requires: rubygem(io-console) >= %{io_console_version} +Recommends: rubygem(rdoc) >= %{rdoc_version} +Recommends: rubygem(io-console) >= %{io_console_version} Requires: rubygem(psych) >= %{psych_version} Provides: gem = %{version}-%{release} Provides: ruby(rubygems) = %{version}-%{release} +# https://github.com/rubygems/rubygems/pull/1189#issuecomment-121600910 +Provides: bundled(rubygem(molinillo)) = %{molinillo_version} +Provides: bundled(rubygem-molinillo) = %{molinillo_version} BuildArch: noarch %description -n rubygems @@ -196,6 +208,8 @@ Version: %{rubygems_version} Group: Development/Libraries License: Ruby or MIT Requires: ruby(rubygems) = %{version}-%{release} +# Needed for RDoc documentation format generation. +Requires: rubygem(json) >= %{json_version} BuildArch: noarch %description -n rubygems-devel @@ -241,7 +255,7 @@ License: GPLv2 and Ruby and MIT and SIL Requires: ruby(release) Requires: ruby(rubygems) >= %{rubygems_version} Requires: ruby(irb) = %{irb_version} -Requires: rubygem(json) >= %{json_version} +Recommends: rubygem(json) >= %{json_version} Provides: rdoc = %{version}-%{release} Provides: ri = %{version}-%{release} Provides: rubygem(rdoc) = %{version}-%{release} @@ -285,6 +299,20 @@ floating point arithmetic often introduces subtle errors because of the conversion between base 10 and base 2. +%package -n rubygem-did_you_mean +Summary: "Did you mean?" experience in Ruby +Version: %{did_you_mean_version} +Group: Development/Libraries +License: MIT +Requires: ruby(release) +Requires: ruby(rubygems) >= %{rubygems_version} +Provides: rubygem(did_you_mean) = %{version}-%{release} + +%description -n rubygem-did_you_mean +"did you mean?" experience in Ruby: the error message will tell you the right +one when you misspelled something. + + %package -n rubygem-io-console Summary: IO/Console is a simple console utilizing library Version: %{io_console_version} @@ -340,8 +368,6 @@ minitest/pride shows pride in testing and adds coloring to your test output. -# The Summary/Description fields are rather poor. -# https://github.com/k-tsj/power_assert/issues/3 %package -n rubygem-power_assert Summary: Power Assert for Ruby Version: %{power_assert_version} @@ -353,7 +379,9 @@ Provides: rubygem(power_assert) = %{version}-%{release} BuildArch: noarch %description -n rubygem-power_assert -Power Assert for Ruby. +Power Assert shows each value of variables and method calls in the expression. +It is useful for testing, providing which value wasn't correct when the +condition is not satisfied. %package -n rubygem-psych @@ -372,6 +400,25 @@ capabilities. In addition to wrapping libyaml, Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format. +%package -n rubygem-net-telnet +Summary: Provides telnet client functionality +Version: %{net_telnet_version} +Group: Development/Libraries +Requires: ruby(release) +Requires: ruby(rubygems) >= %{rubygems_version} +Provides: rubygem(net-telnet) = %{version}-%{release} + +%description -n rubygem-net-telnet +Provides telnet client functionality. + +This class also has, through delegation, all the methods of a socket object +(by default, a TCPSocket, but can be set by the Proxy option to new()). This +provides methods such as close() to end the session and sysread() to read data +directly from the host, instead of via the waitfor() mechanism. Note that if +you do use sysread() directly when in telnet mode, you should probably pass +the output through preprocess() to extract telnet command sequences. + + # The Summary/Description fields are rather poor. # https://github.com/test-unit/test-unit/issues/73 %package -n rubygem-test-unit @@ -412,6 +459,7 @@ rm -rf ext/fiddle/libffi* %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 @@ -509,10 +557,6 @@ mkdir -p %{buildroot}%{_exec_prefix}/lib{,64}/gems/%{name} # Move bundled rubygems to %%gem_dir and %%gem_extdir_mri # make symlinks for io-console and bigdecimal, which are considered to be part of stdlib by other Gems -mkdir -p %{buildroot}%{gem_dir}/gems/rake-%{rake_version}/lib -mv %{buildroot}%{ruby_libdir}/rake* %{buildroot}%{gem_dir}/gems/rake-%{rake_version}/lib -mv %{buildroot}%{gem_dir}/specifications/default/rake-%{rake_version}.gemspec %{buildroot}%{gem_dir}/specifications - mkdir -p %{buildroot}%{gem_dir}/gems/rdoc-%{rdoc_version}/lib mv %{buildroot}%{ruby_libdir}/rdoc* %{buildroot}%{gem_dir}/gems/rdoc-%{rdoc_version}/lib mv %{buildroot}%{gem_dir}/specifications/default/rdoc-%{rdoc_version}.gemspec %{buildroot}%{gem_dir}/specifications @@ -550,32 +594,10 @@ ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby # Adjust the gemspec files so that the gems will load properly sed -i '/^end$/ i\ - s.require_paths = ["lib"]' %{buildroot}%{gem_dir}/specifications/rake-%{rake_version}.gemspec - -sed -i '/^end$/ i\ - s.require_paths = ["lib"]' %{buildroot}%{gem_dir}/specifications/rdoc-%{rdoc_version}.gemspec - -sed -i '/^end$/ i\ - s.require_paths = ["lib"]\ - s.extensions = ["bigdecimal.so"]' %{buildroot}%{gem_dir}/specifications/bigdecimal-%{bigdecimal_version}.gemspec - -sed -i '/^end$/ i\ - s.require_paths = ["lib"]\ - s.extensions = ["io/console.so"]' %{buildroot}%{gem_dir}/specifications/io-console-%{io_console_version}.gemspec - -sed -i '/^end$/ i\ - s.require_paths = ["lib"]\ s.extensions = ["json/ext/parser.so", "json/ext/generator.so"]' %{buildroot}%{gem_dir}/specifications/json-%{json_version}.gemspec -# Push the .gemspecs through the RubyGems to let them write the stub headers. -# This speeds up loading of libraries and avoids warnings in Spring: -# https://github.com/rubygems/rubygems/pull/694 -for s in rake-%{rake_version}.gemspec rdoc-%{rdoc_version}.gemspec json-%{json_version}.gemspec; do - s="%{buildroot}%{gem_dir}/specifications/$s" - make runruby TESTRUN_SCRIPT="-rubygems \ - -e \"spec = Gem::Specification.load(%{$s})\" \ - -e \"File.write %{$s}, spec.to_ruby\"" -done +# Move man pages into proper location +mv %{buildroot}%{gem_dir}/gems/rake-%{rake_version}/doc/rake.1 %{buildroot}%{_mandir}/man1 # Install a tapset and fix up the path to the library. mkdir -p %{buildroot}%{tapset_dir} @@ -584,18 +606,36 @@ sed -e "s|@LIBRARY_PATH@|%{tapset_libdir}/libruby.so.%{major_minor_version}|" \ # Escape '*/' in comment. sed -i -r "s|( \*.*\*)\/(.*)|\1\\\/\2|" %{buildroot}%{tapset_dir}/libruby.so.%{major_minor_version}.stp +# Prepare -doc subpackage file lists. +find doc -maxdepth 1 -type f ! -name '.*' ! -name '*.ja*' > .ruby-doc.en +echo 'doc/images' >> .ruby-doc.en +echo 'doc/syntax' >> .ruby-doc.en + +find doc -maxdepth 1 -type f -name '*.ja*' > .ruby-doc.ja +echo 'doc/irb' >> .ruby-doc.ja +echo 'doc/pty' >> .ruby-doc.ja + +sed -i 's/^/%doc /' .ruby-doc.* +sed -i 's/^/%lang(ja) /' .ruby-doc.ja + %check +# Check RubyGems version correctness. +[ "`make runruby TESTRUN_SCRIPT='bin/gem -v' | tail -1`" == '%{rubygems_version}' ] +# Check Molinillo version correctness. +[ "`make runruby TESTRUN_SCRIPT=\"-e \\\"module Gem; module Resolver; end; end; require 'rubygems/resolver/molinillo/lib/molinillo/gem_metadata'; puts Gem::Resolver::Molinillo::VERSION\\\"\" | tail -1`" \ + == '%{molinillo_version}' ] + # test_debug(TestRubyOptions) fails due to LoadError reported in debug mode, # when abrt.rb cannot be required (seems to be easier way then customizing # the test suite). touch abrt.rb -# Sanity check that SystemTap (dtrace) was detected. -make runruby TESTRUN_SCRIPT=%{SOURCE11} - # Check if abrt hook is required. make runruby TESTRUN_SCRIPT=%{SOURCE12} +# Check if systemtap is supported. +make runruby TESTRUN_SCRIPT=%{SOURCE13} + DISABLE_TESTS="" make check TESTS="-v $DISABLE_TESTS" @@ -624,8 +664,6 @@ make check TESTS="-v $DISABLE_TESTS" %lang(ja) %doc COPYING.ja %doc GPL %doc LEGAL -%doc README.EXT -%lang(ja) %doc README.EXT.ja %{_rpmconfigdir}/macros.d/macros.ruby @@ -639,9 +677,7 @@ make check TESTS="-v $DISABLE_TESTS" %doc GPL %doc LEGAL %doc README.md -%lang(ja) %doc README.ja.md %doc NEWS -%doc doc/NEWS-* # Exclude /usr/local directory since it is supposed to be managed by # local system administrator. %exclude %{ruby_sitelibdir} @@ -686,6 +722,8 @@ make check TESTS="-v $DISABLE_TESTS" # Platform specific libraries. %{_libdir}/libruby.so.* %dir %{ruby_libarchdir} +%dir %{ruby_libarchdir}/cgi +%{ruby_libarchdir}/cgi/escape.so %{ruby_libarchdir}/continuation.so %{ruby_libarchdir}/coverage.so %{ruby_libarchdir}/date_core.so @@ -729,6 +767,7 @@ make check TESTS="-v $DISABLE_TESTS" %dir %{ruby_libarchdir}/enc/trans %{ruby_libarchdir}/enc/trans/big5.so %{ruby_libarchdir}/enc/trans/chinese.so +%{ruby_libarchdir}/enc/trans/ebcdic.so %{ruby_libarchdir}/enc/trans/emoji.so %{ruby_libarchdir}/enc/trans/emoji_iso2022_kddi.so %{ruby_libarchdir}/enc/trans/emoji_sjis_docomo.so @@ -750,7 +789,9 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libarchdir}/enc/utf_16le.so %{ruby_libarchdir}/enc/utf_32be.so %{ruby_libarchdir}/enc/utf_32le.so +%{ruby_libarchdir}/enc/windows_1250.so %{ruby_libarchdir}/enc/windows_1251.so +%{ruby_libarchdir}/enc/windows_1252.so %{ruby_libarchdir}/enc/windows_31j.so %{ruby_libarchdir}/etc.so %{ruby_libarchdir}/fcntl.so @@ -831,11 +872,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/rdoc-%{rdoc_version}.gemspec %{_mandir}/man1/ri* -%files doc +%files doc -f .ruby-doc.en -f .ruby-doc.ja %doc README.md -%lang(ja) %doc README.ja.md %doc ChangeLog -%doc doc/ChangeLog-* %doc ruby-exercise.stp %{_datadir}/ri @@ -846,6 +885,11 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/gems/bigdecimal-%{bigdecimal_version} %{gem_dir}/specifications/bigdecimal-%{bigdecimal_version}.gemspec +%files -n rubygem-did_you_mean +%{gem_dir}/gems/did_you_mean-%{did_you_mean_version} +%exclude %{gem_dir}/gems/did_you_mean-%{did_you_mean_version}/.* +%{gem_dir}/specifications/did_you_mean-%{did_you_mean_version}.gemspec + %files -n rubygem-io-console %{ruby_libdir}/io %{ruby_libarchdir}/io/console.so @@ -876,6 +920,11 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/gems/psych-%{psych_version} %{gem_dir}/specifications/psych-%{psych_version}.gemspec +%files -n rubygem-net-telnet +%{gem_dir}/gems/net-telnet-%{net_telnet_version} +%exclude %{gem_dir}/gems/net-telnet-%{net_telnet_version}/.* +%{gem_dir}/specifications/net-telnet-%{net_telnet_version}.gemspec + %files -n rubygem-test-unit %{gem_dir}/gems/test-unit-%{test_unit_version} %{gem_dir}/specifications/test-unit-%{test_unit_version}.gemspec @@ -890,6 +939,16 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog +* Mon Jan 04 2016 Vít Ondruch - 2.3.0-50 +- Upgrade to Ruby 2.3.0. +- Move gemified net-telnet into subpackage. +- Add did_you_mean subpackage. +- Add virtual provides for CCAN copylibs. +- Use weak dependencies. + +* Tue Dec 22 2015 Pavel Valena - 2.3.0-0.7.preview2 +- Add systemtap tests. + * Mon Dec 21 2015 Vít Ondruch - 2.2.4-47 - Update to Ruby 2.2.4. diff --git a/sources b/sources index 94b8135..f935fb7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -350bfd495e1974cf752de9f4566c7911 ruby-2.2.4.tar.xz +92ef54e033fb95ec9bdf7023666e5f1f ruby-2.3.0.tar.xz diff --git a/test_systemtap.rb b/test_systemtap.rb index aa8df4e..eb518df 100644 --- a/test_systemtap.rb +++ b/test_systemtap.rb @@ -1,9 +1,64 @@ -require 'rbconfig' +require 'set' -if RbConfig::CONFIG.select {|k, v| v =~ /dtrace/}.size == 1 - exit true -else - puts 'ERROR: SystemTap (dtrace) support was not detected.' +LIBRUBY_SO = 'libruby.so' +PROBES_D = 'probes.d' +### +# Detect SystemTap section headers presence. + +stap_headers = [ + '\.stapsdt\.base', + '\.note\.stapsdt' +] + +header_regexp = %r{ (#{stap_headers.join('|')}) } + +section_headers = `readelf -S "#{LIBRUBY_SO}"` +detected_stap_headers = section_headers.scan(header_regexp).flatten + +# Assume there are both headers until this is proven wrong ;) +unless detected_stap_headers.size == 2 + puts 'ERROR: SystemTap (DTrace) headers were not detected in resulting library.' + exit false +end + +### +# Find if every declared probe is propagated to resulting library. + +# Colect probes specified in probes.d file. +probes = [] + +File.open(PROBES_D) do |file| + file.each_line do |line| + if probe = line[/probe (\S+)\(.*\);/, 1] + probes << probe + end + end +end + +probes = Set.new probes + +# These probes are excluded by VM_COLLECT_USAGE_DETAILS ifdef. +EXCLUDE_PROBES = Set.new %w(insn insn__operand) +unless EXCLUDE_PROBES.subset? probes + puts 'ERROR: Change in SystemTap (DTrace) probes definition file detected.' + exit false +end + +probes -= 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+)$ +} + +notes = `readelf -n "#{LIBRUBY_SO}"` +detected_probes = Set.new notes.scan(probe_regexp).flatten + +# Both sets must be equal, otherwise something is wrong. +unless probes == detected_probes + puts 'ERROR: SystemTap (DTrace) probes were not correctly propagated into resulting library.' exit false end