Upgrade to Ruby 2.4.0.

Move gemified xmlrpc into subpackage.
Move gemified openssl into subpackage.
Tk is removed from stdlib.
Extend 'gem_' macros for pre-release version support.
This commit is contained in:
Vít Ondruch 2017-01-09 15:58:21 +01:00
parent d14e3f780f
commit 3130f89edd
12 changed files with 183 additions and 135 deletions

View File

@ -3,12 +3,12 @@
%gem_archdir %{_libdir}/gems %gem_archdir %{_libdir}/gems
# Common gem locations and files. # Common gem locations and files.
%gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}%{?prerelease}
%gem_extdir_mri %{gem_archdir}/%{name}/%{gem_name}-%{version} %gem_extdir_mri %{gem_archdir}/%{name}/%{gem_name}-%{version}%{?prerelease}
%gem_libdir %{gem_instdir}/lib %gem_libdir %{gem_instdir}/lib
%gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %gem_cache %{gem_dir}/cache/%{gem_name}-%{version}%{?prerelease}.gem
%gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}%{?prerelease}.gemspec
%gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}%{?prerelease}
# %gem_install - Install gem into appropriate directory. # %gem_install - Install gem into appropriate directory.
@ -28,7 +28,7 @@ gem install \\\
--build-root %{-d*}%{!?-d:.} \\\ --build-root %{-d*}%{!?-d:.} \\\
--force \\\ --force \\\
--document=ri,rdoc \\\ --document=ri,rdoc \\\
%{-n*}%{!?-n:%{gem_name}-%{version}.gem} \ %{-n*}%{!?-n:%{gem_name}-%{version}%{?prerelease}.gem} \
%{nil} %{nil}

View File

@ -11,7 +11,7 @@ diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 682eb46..e6b1445 100644 index 682eb46..e6b1445 100644
--- a/lib/mkmf.rb --- a/lib/mkmf.rb
+++ b/lib/mkmf.rb +++ b/lib/mkmf.rb
@@ -1892,7 +1892,7 @@ def configuration(srcdir) @@ -1897,7 +1897,7 @@ def configuration(srcdir)
SHELL = /bin/sh SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work. # V=0 quiet, V=1 verbose. other values don't work.
@ -19,7 +19,7 @@ index 682eb46..e6b1445 100644
+V = 1 +V = 1
Q1 = $(V:1=) Q1 = $(V:1=)
Q = $(Q1:0=@) Q = $(Q1:0=@)
ECHO1 = $(V:1=@#{CONFIG['NULLCMD']}) ECHO1 = $(V:1=@ #{CONFIG['NULLCMD']})
-- --
1.8.3.1 1.8.3.1

View File

@ -26,7 +26,7 @@ diff --git a/common.mk b/common.mk
index 5cfbc3d..3f0a82e 100644 index 5cfbc3d..3f0a82e 100644
--- a/common.mk --- a/common.mk
+++ b/common.mk +++ b/common.mk
@@ -127,7 +127,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) @@ -144,7 +144,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT) GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
DEFAULT_PRELUDES = $(GEM_PRELUDE) DEFAULT_PRELUDES = $(GEM_PRELUDE)
@ -39,7 +39,7 @@ diff --git a/configure.in b/configure.in
index 0e371e2..d4f1dcb 100644 index 0e371e2..d4f1dcb 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -4374,6 +4374,13 @@ AC_SUBST(rubyarchhdrdir)dnl @@ -4536,6 +4536,13 @@ AC_SUBST(rubyarchhdrdir)dnl
AC_SUBST(sitearchhdrdir)dnl AC_SUBST(sitearchhdrdir)dnl
AC_SUBST(vendorarchhdrdir)dnl AC_SUBST(vendorarchhdrdir)dnl

View File

@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in
index 37d9a62..553d4d0 100644 index 37d9a62..553d4d0 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -3632,6 +3632,11 @@ if test ${multiarch+set}; then @@ -3790,6 +3790,11 @@ if test ${multiarch+set}; then
fi fi
archlibdir='${libdir}/${arch}' archlibdir='${libdir}/${arch}'

View File

@ -14,7 +14,7 @@ diff --git a/configure.in b/configure.in
index db37cd6..ce8d149 100644 index db37cd6..ce8d149 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -4228,7 +4228,8 @@ AS_CASE(["$ruby_version_dir_name"], @@ -4390,7 +4390,8 @@ AS_CASE(["$ruby_version_dir_name"],
ruby_version_dir=/'${ruby_version_dir_name}' ruby_version_dir=/'${ruby_version_dir_name}'
if test -z "${ruby_version_dir_name}"; then if test -z "${ruby_version_dir_name}"; then
@ -67,7 +67,7 @@ diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 07076d4..35e6c3c 100755 index 07076d4..35e6c3c 100755
--- a/tool/mkconfig.rb --- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb +++ b/tool/mkconfig.rb
@@ -122,7 +122,7 @@ def config.write(arg) @@ -113,7 +113,7 @@
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
case name case name
when /^prefix$/ when /^prefix$/

View File

@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in
index 553d4d0..03a4152 100644 index 553d4d0..03a4152 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -4292,6 +4292,8 @@ AC_SUBST(vendorarchdir)dnl @@ -4454,6 +4454,8 @@ AC_SUBST(vendorarchdir)dnl
AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl

View File

@ -15,7 +15,7 @@ diff --git a/configure.in b/configure.in
index 03a4152..0e371e2 100644 index 03a4152..0e371e2 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -4264,6 +4264,10 @@ AC_ARG_WITH(vendorarchdir, @@ -4426,6 +4426,10 @@ AC_ARG_WITH(vendorarchdir,
[vendorarchdir=$withval], [vendorarchdir=$withval],
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) [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 if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX='' RUBY_EXEC_PREFIX=''
@@ -4288,6 +4292,7 @@ AC_SUBST(sitearchdir)dnl @@ -4450,6 +4454,7 @@ AC_SUBST(sitearchdir)dnl
AC_SUBST(vendordir)dnl AC_SUBST(vendordir)dnl
AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorlibdir)dnl
AC_SUBST(vendorarchdir)dnl AC_SUBST(vendorarchdir)dnl
@ -67,7 +67,7 @@ diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index b47b6e1..0b99408 100755 index b47b6e1..0b99408 100755
--- a/tool/rbinstall.rb --- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb +++ b/tool/rbinstall.rb
@@ -328,6 +328,7 @@ def CONFIG.[](name, mandatory = false) @@ -330,6 +330,7 @@ def CONFIG.[](name, mandatory = false)
sitearchlibdir = CONFIG["sitearchdir"] sitearchlibdir = CONFIG["sitearchdir"]
vendorlibdir = CONFIG["vendorlibdir"] vendorlibdir = CONFIG["vendorlibdir"]
vendorarchlibdir = CONFIG["vendorarchdir"] vendorarchlibdir = CONFIG["vendorarchdir"]
@ -75,7 +75,7 @@ index b47b6e1..0b99408 100755
mandir = CONFIG["mandir", true] mandir = CONFIG["mandir", true]
docdir = CONFIG["docdir", true] docdir = CONFIG["docdir", true]
configure_args = Shellwords.shellwords(CONFIG["configure_args"]) configure_args = Shellwords.shellwords(CONFIG["configure_args"])
@@ -506,7 +507,15 @@ def CONFIG.[](name, mandatory = false) @@ -517,7 +518,15 @@ def CONFIG.[](name, mandatory = false)
install?(:local, :comm, :lib) do install?(:local, :comm, :lib) do
prepare "library scripts", rubylibdir prepare "library scripts", rubylibdir
noinst = %w[README* *.txt *.rdoc *.gemspec] noinst = %w[README* *.txt *.rdoc *.gemspec]

View File

@ -11,12 +11,12 @@ diff --git a/common.mk b/common.mk
index 168dc52..20c218a 100644 index 168dc52..20c218a 100644
--- a/common.mk --- a/common.mk
+++ b/common.mk +++ b/common.mk
@@ -839,9 +839,9 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE) @@ -873,9 +873,9 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE)
$(srcdir)/template/prelude.c.tmpl
$(PRELUDE_C): $(COMPILE_PRELUDE) \ $(PRELUDE_C): $(COMPILE_PRELUDE) \
{$(srcdir)}lib/rubygems/defaults.rb \ - $(PRELUDE_SCRIPTS)
{$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \ + $(PRELUDE_SCRIPTS) $(PREP)
- $(PRELUDE_SCRIPTS) $(LIB_SRCS)
+ $(PRELUDE_SCRIPTS) $(PREP) $(LIB_SRCS)
$(ECHO) generating $@ $(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \ - $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \ + $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \

View File

@ -12,15 +12,15 @@ ruby_version_dir_name now specifies custom version string for versioned
directories, e.g. instead of default X.Y.Z, you can specify whatever directories, e.g. instead of default X.Y.Z, you can specify whatever
string. string.
--- ---
configure.in | 68 ++++++++++++++++++++++++++++------------------------- configure.in | 64 ++++++++++++++++++++++++++++-------------------------
template/ruby.pc.in | 1 + template/ruby.pc.in | 1 +
2 files changed, 37 insertions(+), 32 deletions(-) 2 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/configure.in b/configure.in diff --git a/configure.in b/configure.in
index db37cd6..6e73fae 100644 index db37cd6..6e73fae 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -4177,9 +4177,6 @@ AS_CASE(["$target_os"], @@ -4341,9 +4341,6 @@ AS_CASE(["$target_os"],
rubyw_install_name='$(RUBYW_INSTALL_NAME)' rubyw_install_name='$(RUBYW_INSTALL_NAME)'
]) ])
@ -30,7 +30,7 @@ index db37cd6..6e73fae 100644
rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
AC_ARG_WITH(rubyarchprefix, AC_ARG_WITH(rubyarchprefix,
AS_HELP_STRING([--with-rubyarchprefix=DIR], AS_HELP_STRING([--with-rubyarchprefix=DIR],
@@ -4202,58 +4199,64 @@ AC_ARG_WITH(ridir, @@ -4366,56 +4363,62 @@ AC_ARG_WITH(ridir,
AC_SUBST(ridir) AC_SUBST(ridir)
AC_SUBST(RI_BASE_NAME) AC_SUBST(RI_BASE_NAME)
@ -48,11 +48,9 @@ index db37cd6..6e73fae 100644
- echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" - echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
- echo '#define STRINGIZE(x) x' - echo '#define STRINGIZE(x) x'
- test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0' - test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
- echo '#include "verconf.h"'
- echo '#include "version.h"' - echo '#include "version.h"'
- echo 'ruby_version=RUBY_LIB_VERSION' - echo 'ruby_version=RUBY_LIB_VERSION'
- } > conftest.c - } > 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'`" - ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
- eval $ruby_version - eval $ruby_version
-elif test -z "${ruby_version}"; then -elif test -z "${ruby_version}"; then
@ -65,11 +63,9 @@ index db37cd6..6e73fae 100644
+echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" +echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
+echo '#define STRINGIZE(x) x' +echo '#define STRINGIZE(x) x'
+test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0' +test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
+echo '#include "verconf.h"'
+echo '#include "version.h"' +echo '#include "version.h"'
+echo 'ruby_version=RUBY_LIB_VERSION' +echo 'ruby_version=RUBY_LIB_VERSION'
+} > conftest.c +} > 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'`" +ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+eval $ruby_version +eval $ruby_version
+ +
@ -124,7 +120,7 @@ index db37cd6..6e73fae 100644
if test "${LOAD_RELATIVE+set}"; then if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
@@ -4270,6 +4273,7 @@ AC_SUBST(sitearchincludedir)dnl @@ -4432,6 +4435,7 @@ AC_SUBST(sitearchincludedir)dnl
AC_SUBST(arch)dnl AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)dnl AC_SUBST(ruby_version)dnl
@ -175,7 +171,7 @@ diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index d4c110e..d39c9a6 100755 index d4c110e..d39c9a6 100755
--- a/tool/rbinstall.rb --- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb +++ b/tool/rbinstall.rb
@@ -406,7 +406,7 @@ def CONFIG.[](name, mandatory = false) @@ -417,7 +417,7 @@ def CONFIG.[](name, mandatory = false)
install?(:doc, :rdoc) do install?(:doc, :rdoc) do
if $rdocdir if $rdocdir
@ -244,12 +240,12 @@ index 55ca080..75eea2b 100644
+ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version'] + RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
end end
end ##
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 0428bea..b6e090e 100644 index 0428bea..b6e090e 100644
--- a/test/rubygems/test_gem.rb --- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb
@@ -962,7 +962,8 @@ def test_self_use_paths @@ -1101,7 +1101,8 @@ def test_self_use_paths
def test_self_user_dir def test_self_user_dir
parts = [@userhome, '.gem', Gem.ruby_engine] parts = [@userhome, '.gem', Gem.ruby_engine]
@ -259,7 +255,7 @@ index 0428bea..b6e090e 100644
assert_equal File.join(parts), Gem.user_dir assert_equal File.join(parts), Gem.user_dir
end end
@@ -1089,7 +1090,7 @@ def test_self_user_home_user_drive_and_path @@ -1228,7 +1229,7 @@ def test_self_user_home_user_drive_and_path
def test_self_vendor_dir def test_self_vendor_dir
expected = expected =
File.join RbConfig::CONFIG['vendordir'], 'gems', File.join RbConfig::CONFIG['vendordir'], 'gems',
@ -286,7 +282,7 @@ diff --git a/configure.in b/configure.in
index 6e73fae..c842725 100644 index 6e73fae..c842725 100644
--- a/configure.in --- a/configure.in
+++ b/configure.in +++ b/configure.in
@@ -275,7 +275,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` @@ -271,7 +271,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"` RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME) AC_SUBST(RUBY_BASE_NAME)
AC_SUBST(RUBYW_BASE_NAME) AC_SUBST(RUBYW_BASE_NAME)

209
ruby.spec
View File

@ -1,16 +1,16 @@
%global major_version 2 %global major_version 2
%global minor_version 3 %global minor_version 4
%global teeny_version 3 %global teeny_version 0
%global major_minor_version %{major_version}.%{minor_version} %global major_minor_version %{major_version}.%{minor_version}
%global ruby_version %{major_minor_version}.%{teeny_version} %global ruby_version %{major_minor_version}.%{teeny_version}
%global ruby_release %{ruby_version} %global ruby_release %{ruby_version}
# Specify the named version. It has precedense to revision. # Specify the named version. It has precedense to revision.
#%%global milestone preview2 #%%global milestone rc1
# Keep the revision enabled for pre-releases from SVN. # Keep the revision enabled for pre-releases from SVN.
#%%global revision 53264 #%%global revision 57159
%global ruby_archive %{name}-%{ruby_version} %global ruby_archive %{name}-%{ruby_version}
@ -21,7 +21,7 @@
%endif %endif
%global release 61 %global release 70
%{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} %{!?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 # The RubyGems library has to stay out of Ruby directory three, since the
@ -29,24 +29,26 @@
%global rubygems_dir %{_datadir}/rubygems %global rubygems_dir %{_datadir}/rubygems
# Bundled libraries versions # Bundled libraries versions
%global rubygems_version 2.5.2 %global rubygems_version 2.6.8
%global molinillo_version 0.4.1 %global molinillo_version 0.5.3
# TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM. # TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM.
# http://redmine.ruby-lang.org/issues/5313 # http://redmine.ruby-lang.org/issues/5313
%global irb_version %{ruby_version} %global irb_version %{ruby_version}
%global bigdecimal_version 1.2.8 %global bigdecimal_version 1.3.0
%global did_you_mean_version 1.0.0 %global did_you_mean_version 1.1.0
%global io_console_version 0.4.5 %global io_console_version 0.4.6
%global json_version 1.8.3 %global json_version 2.0.2
%global minitest_version 5.8.5 %global minitest_version 5.10.1
%global power_assert_version 0.2.6
%global psych_version 2.1.0
%global rake_version 10.4.2
%global rdoc_version 4.2.1
%global net_telnet_version 0.1.1 %global net_telnet_version 0.1.1
%global test_unit_version 3.1.5 %global openssl_version 2.0.2
%global power_assert_version 0.4.1
%global psych_version 2.2.2
%global rake_version 12.0.0
%global rdoc_version 5.0.0
%global test_unit_version 3.2.3
%global xmlrpc_version 0.2.1
# Might not be needed in the future, if we are lucky enough. # Might not be needed in the future, if we are lucky enough.
# https://bugzilla.redhat.com/show_bug.cgi?id=888262 # https://bugzilla.redhat.com/show_bug.cgi?id=888262
@ -132,20 +134,22 @@ Suggests: rubypick
Recommends: ruby(rubygems) >= %{rubygems_version} Recommends: ruby(rubygems) >= %{rubygems_version}
Recommends: rubygem(bigdecimal) >= %{bigdecimal_version} Recommends: rubygem(bigdecimal) >= %{bigdecimal_version}
Recommends: rubygem(did_you_mean) >= %{did_you_mean_version} Recommends: rubygem(did_you_mean) >= %{did_you_mean_version}
Recommends: rubygem(openssl) >= %{openssl_version}
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: gdbm-devel BuildRequires: gdbm-devel
BuildRequires: libffi-devel BuildRequires: libffi-devel
BuildRequires: compat-openssl10-devel BuildRequires: openssl-devel
BuildRequires: libyaml-devel BuildRequires: libyaml-devel
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: tk-devel
# Needed to pass test_set_program_name(TestRubyOptions) # Needed to pass test_set_program_name(TestRubyOptions)
BuildRequires: procps BuildRequires: procps
BuildRequires: %{_bindir}/dtrace BuildRequires: %{_bindir}/dtrace
# RubyGems test suite optional dependencies. # RubyGems test suite optional dependencies.
BuildRequires: git BuildRequires: git
BuildRequires: %{_bindir}/cmake BuildRequires: %{_bindir}/cmake
# Required to test hardening.
BuildRequires: %{_bindir}/checksec
# This package provides %%{_bindir}/ruby-mri therefore it is marked by this # This package provides %%{_bindir}/ruby-mri therefore it is marked by this
# virtual provide. It can be installed as dependency of rubypick. # virtual provide. It can be installed as dependency of rubypick.
@ -182,6 +186,13 @@ Provides: bundled(ccan-check_type)
Provides: bundled(ccan-container_of) Provides: bundled(ccan-container_of)
Provides: bundled(ccan-list) Provides: bundled(ccan-list)
# Tcl/Tk support was removed from stdlib in Ruby 2.4, i.e. F27 timeframe
# so lets obsolete it. This is not the best place, but we don't have
# better, unless https://fedorahosted.org/fpc/ticket/645 provides some
# generic solution.
Obsoletes: ruby-tcltk < 2.4.0
%description libs %description libs
This package includes the libruby, necessary to run Ruby. This package includes the libruby, necessary to run Ruby.
@ -195,6 +206,7 @@ License: Ruby or MIT
Requires: ruby(release) Requires: ruby(release)
Recommends: rubygem(rdoc) >= %{rdoc_version} Recommends: rubygem(rdoc) >= %{rdoc_version}
Recommends: rubygem(io-console) >= %{io_console_version} Recommends: rubygem(io-console) >= %{io_console_version}
Requires: rubygem(openssl) >= %{openssl_version}
Requires: rubygem(psych) >= %{psych_version} Requires: rubygem(psych) >= %{psych_version}
Provides: gem = %{version}-%{release} Provides: gem = %{version}-%{release}
Provides: ruby(rubygems) = %{version}-%{release} Provides: ruby(rubygems) = %{version}-%{release}
@ -377,6 +389,20 @@ minitest/pride shows pride in testing and adds coloring to your test
output. output.
%package -n rubygem-openssl
Summary: OpenSSL provides SSL, TLS and general purpose cryptography
Version: %{openssl_version}
Group: Development/Libraries
License: Ruby or BSD
Requires: ruby(release)
Requires: ruby(rubygems) >= %{rubygems_version}
Provides: rubygem(openssl) = %{version}-%{release}
%description -n rubygem-openssl
OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
OpenSSL library.
%package -n rubygem-power_assert %package -n rubygem-power_assert
Summary: Power Assert for Ruby Summary: Power Assert for Ruby
Version: %{power_assert_version} Version: %{power_assert_version}
@ -428,10 +454,8 @@ you do use sysread() directly when in telnet mode, you should probably pass
the output through preprocess() to extract telnet command sequences. 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 %package -n rubygem-test-unit
Summary: Improved version of Test::Unit bundled in Ruby 1.8.x Summary: An xUnit family unit testing framework for Ruby
Version: %{test_unit_version} Version: %{test_unit_version}
Group: Development/Libraries Group: Development/Libraries
# lib/test/unit/diff.rb is a double license of the Ruby license and PSF license. # lib/test/unit/diff.rb is a double license of the Ruby license and PSF license.
@ -444,19 +468,26 @@ Provides: rubygem(test-unit) = %{version}-%{release}
BuildArch: noarch BuildArch: noarch
%description -n rubygem-test-unit %description -n rubygem-test-unit
Ruby 1.9.x bundles minitest not Test::Unit. Test::Unit Test::Unit (test-unit) is unit testing framework for Ruby, based on xUnit
bundled in Ruby 1.8.x had not been improved but unbundled principles. These were originally designed by Kent Beck, creator of extreme
Test::Unit (test-unit) is improved actively. programming software development methodology, for Smalltalk's SUnit. It allows
writing tests, checking results and automated testing in Ruby.
%package tcltk %package -n rubygem-xmlrpc
Summary: Tcl/Tk interface for scripting language Ruby Summary: XMLRPC is a lightweight protocol that enables remote procedure calls over HTTP
Group: Development/Languages Version: %{xmlrpc_version}
Requires: %{name}-libs%{?_isa} = %{ruby_version} Group: Development/Libraries
Provides: ruby(tcltk) = %{ruby_version}-%{release} License: Ruby or BSD
Requires: ruby(release)
Requires: ruby(rubygems) >= %{rubygems_version}
Provides: rubygem(xmlrpc) = %{version}-%{release}
BuildArch: noarch
%description -n rubygem-xmlrpc
XMLRPC is a lightweight protocol that enables remote procedure calls over
HTTP.
%description tcltk
Tcl/Tk interface for the object-oriented scripting language Ruby.
%prep %prep
%setup -q -n %{ruby_archive} %setup -q -n %{ruby_archive}
@ -486,10 +517,6 @@ cp -a %{SOURCE6} .
%build %build
autoconf autoconf
# Ruby does not respec LDFLAGS :(
# https://bugs.ruby-lang.org/issues/11863
export EXTLDFLAGS="%{__global_ldflags}"
%configure \ %configure \
--with-rubylibprefix='%{ruby_libdir}' \ --with-rubylibprefix='%{ruby_libdir}' \
--with-archlibdir='%{_libdir}' \ --with-archlibdir='%{_libdir}' \
@ -504,6 +531,7 @@ export EXTLDFLAGS="%{__global_ldflags}"
--with-vendorarchhdrdir='$(vendorhdrdir)/$(arch)' \ --with-vendorarchhdrdir='$(vendorhdrdir)/$(arch)' \
--with-rubygemsdir='%{rubygems_dir}' \ --with-rubygemsdir='%{rubygems_dir}' \
--with-ruby-pc='%{name}.pc' \ --with-ruby-pc='%{name}.pc' \
--with-compress-debug-sections=no \
--disable-rpath \ --disable-rpath \
--enable-shared \ --enable-shared \
--with-ruby-version='' \ --with-ruby-version='' \
@ -532,15 +560,12 @@ sed -i 's/Version: \${ruby_version}/Version: %{ruby_version}/' %{buildroot}%{_li
# Kill bundled certificates, as they should be part of ca-certificates. # Kill bundled certificates, as they should be part of ca-certificates.
for cert in \ for cert in \
Class3PublicPrimaryCertificationAuthority.pem \ rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem \
DigiCertHighAssuranceEVRootCA.pem \ rubygems.org/AddTrustExternalCARoot.pem \
EntrustnetSecureServerCertificationAuthority.pem \ index.rubygems.org/GlobalSignRootCA.pem
GeoTrustGlobalCA.pem \
AddTrustExternalCARoot.pem \
AddTrustExternalCARoot-2048.pem \
GlobalSignRootCA.pem
do do
rm %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/$cert rm %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/$cert
rm -r $(dirname %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/$cert)
done done
# Ensure there is not forgotten any certificate. # Ensure there is not forgotten any certificate.
test ! "$(ls -A %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/ 2>/dev/null)" test ! "$(ls -A %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/ 2>/dev/null)"
@ -603,6 +628,15 @@ ln -s %{gem_dir}/gems/json-%{json_version}/lib/json.rb %{buildroot}%{ruby_libdir
ln -s %{gem_dir}/gems/json-%{json_version}/lib/json %{buildroot}%{ruby_libdir}/json ln -s %{gem_dir}/gems/json-%{json_version}/lib/json %{buildroot}%{ruby_libdir}/json
ln -s %{_libdir}/gems/%{name}/json-%{json_version}/json/ %{buildroot}%{ruby_libarchdir}/json ln -s %{_libdir}/gems/%{name}/json-%{json_version}/json/ %{buildroot}%{ruby_libarchdir}/json
mkdir -p %{buildroot}%{gem_dir}/gems/openssl-%{openssl_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/openssl-%{openssl_version}
mv %{buildroot}%{ruby_libdir}/openssl* %{buildroot}%{gem_dir}/gems/openssl-%{openssl_version}/lib
mv %{buildroot}%{ruby_libarchdir}/openssl.so %{buildroot}%{_libdir}/gems/%{name}/openssl-%{openssl_version}/
mv %{buildroot}%{gem_dir}/specifications/default/openssl-%{openssl_version}.gemspec %{buildroot}%{gem_dir}/specifications
ln -s %{gem_dir}/gems/openssl-%{openssl_version}/lib/openssl %{buildroot}%{ruby_libdir}/openssl
ln -s %{gem_dir}/gems/openssl-%{openssl_version}/lib/openssl.rb %{buildroot}%{ruby_libdir}/openssl.rb
ln -s %{_libdir}/gems/%{name}/openssl-%{openssl_version}/openssl.so %{buildroot}%{ruby_libarchdir}/openssl.so
mkdir -p %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib mkdir -p %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version} mkdir -p %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}
mv %{buildroot}%{ruby_libdir}/psych* %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib mv %{buildroot}%{ruby_libdir}/psych* %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
@ -612,6 +646,12 @@ ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych %{buildroot}%{ruby_libdir
ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych.rb %{buildroot}%{ruby_libdir}/psych.rb ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych.rb %{buildroot}%{ruby_libdir}/psych.rb
ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby_libarchdir}/psych.so ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby_libarchdir}/psych.so
# Move the binary extensions into proper place (if no gem has binary extension,
# the extensions directory might be empty).
find %{buildroot}%{gem_dir}/extensions/*-%{_target_os}/%{ruby_version}/* -maxdepth 0 \
-exec mv '{}' %{buildroot}%{_libdir}/gems/%{name}/ \; \
|| echo "No gem binary extensions to move."
# Adjust the gemspec files so that the gems will load properly # Adjust the gemspec files so that the gems will load properly
sed -i '/^end$/ i\ sed -i '/^end$/ i\
s.extensions = ["json/ext/parser.so", "json/ext/generator.so"]' %{buildroot}%{gem_dir}/specifications/json-%{json_version}.gemspec s.extensions = ["json/ext/parser.so", "json/ext/generator.so"]' %{buildroot}%{gem_dir}/specifications/json-%{json_version}.gemspec
@ -639,6 +679,10 @@ sed -i 's/^/%doc /' .ruby-doc.*
sed -i 's/^/%lang(ja) /' .ruby-doc.ja sed -i 's/^/%lang(ja) /' .ruby-doc.ja
%check %check
# Check Ruby hardening.
checksec -f libruby.so.%{ruby_version} | \
grep "Full RELRO.*Canary found.*NX enabled.*DSO.*No RPATH.*No RUNPATH.*Yes.*\d*.*\d*.*libruby.so.%{ruby_version}"
# Check RubyGems version correctness. # Check RubyGems version correctness.
[ "`make runruby TESTRUN_SCRIPT='bin/gem -v' | tail -1`" == '%{rubygems_version}' ] [ "`make runruby TESTRUN_SCRIPT='bin/gem -v' | tail -1`" == '%{rubygems_version}' ]
# Check Molinillo version correctness. # Check Molinillo version correctness.
@ -670,25 +714,22 @@ make check TESTS="-v $DISABLE_TESTS"
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%files %files
%doc BSDL %license BSDL
%doc COPYING %license COPYING
%lang(ja) %doc COPYING.ja %lang(ja) %license COPYING.ja
%doc GPL %license GPL
%doc LEGAL %license LEGAL
%{_bindir}/erb %{_bindir}/erb
%{_bindir}/%{name}%{?with_rubypick:-mri} %{_bindir}/%{name}%{?with_rubypick:-mri}
%{_mandir}/man1/erb* %{_mandir}/man1/erb*
%{_mandir}/man1/ruby* %{_mandir}/man1/ruby*
# http://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Static_Libraries
%exclude %{_libdir}/libruby-static.a
%files devel %files devel
%doc BSDL %license BSDL
%doc COPYING %license COPYING
%lang(ja) %doc COPYING.ja %lang(ja) %license COPYING.ja
%doc GPL %license GPL
%doc LEGAL %license LEGAL
%{_rpmconfigdir}/macros.d/macros.ruby %{_rpmconfigdir}/macros.d/macros.ruby
@ -697,10 +738,10 @@ make check TESTS="-v $DISABLE_TESTS"
%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/%{name}.pc
%files libs %files libs
%doc COPYING %license COPYING
%lang(ja) %doc COPYING.ja %lang(ja) %license COPYING.ja
%doc GPL %license GPL
%doc LEGAL %license LEGAL
%doc README.md %doc README.md
%doc NEWS %doc NEWS
# Exclude /usr/local directory since it is supposed to be managed by # Exclude /usr/local directory since it is supposed to be managed by
@ -714,20 +755,18 @@ make check TESTS="-v $DISABLE_TESTS"
# Platform independent libraries. # Platform independent libraries.
%dir %{ruby_libdir} %dir %{ruby_libdir}
%{ruby_libdir}/*.rb %{ruby_libdir}/*.rb
%exclude %{ruby_libdir}/*-tk.rb
%exclude %{ruby_libdir}/irb.rb %exclude %{ruby_libdir}/irb.rb
%exclude %{ruby_libdir}/json.rb %exclude %{ruby_libdir}/json.rb
%exclude %{ruby_libdir}/tcltk.rb %exclude %{ruby_libdir}/openssl.rb
%exclude %{ruby_libdir}/tk*.rb
%exclude %{ruby_libdir}/psych.rb %exclude %{ruby_libdir}/psych.rb
%{ruby_libdir}/cgi %{ruby_libdir}/cgi
%{ruby_libdir}/digest %{ruby_libdir}/digest
%{ruby_libdir}/drb %{ruby_libdir}/drb
%{ruby_libdir}/fiddle %{ruby_libdir}/fiddle
%{ruby_libdir}/forwardable
%exclude %{ruby_libdir}/irb %exclude %{ruby_libdir}/irb
%{ruby_libdir}/matrix %{ruby_libdir}/matrix
%{ruby_libdir}/net %{ruby_libdir}/net
%{ruby_libdir}/openssl
%{ruby_libdir}/optparse %{ruby_libdir}/optparse
%{ruby_libdir}/racc %{ruby_libdir}/racc
%{ruby_libdir}/rbconfig %{ruby_libdir}/rbconfig
@ -737,12 +776,9 @@ make check TESTS="-v $DISABLE_TESTS"
%{ruby_libdir}/rss %{ruby_libdir}/rss
%{ruby_libdir}/shell %{ruby_libdir}/shell
%{ruby_libdir}/syslog %{ruby_libdir}/syslog
%exclude %{ruby_libdir}/tk
%exclude %{ruby_libdir}/tkextlib
%{ruby_libdir}/unicode_normalize %{ruby_libdir}/unicode_normalize
%{ruby_libdir}/uri %{ruby_libdir}/uri
%{ruby_libdir}/webrick %{ruby_libdir}/webrick
%{ruby_libdir}/xmlrpc
%{ruby_libdir}/yaml %{ruby_libdir}/yaml
# Platform specific libraries. # Platform specific libraries.
@ -818,6 +854,9 @@ make check TESTS="-v $DISABLE_TESTS"
%{ruby_libarchdir}/enc/windows_1250.so %{ruby_libarchdir}/enc/windows_1250.so
%{ruby_libarchdir}/enc/windows_1251.so %{ruby_libarchdir}/enc/windows_1251.so
%{ruby_libarchdir}/enc/windows_1252.so %{ruby_libarchdir}/enc/windows_1252.so
%{ruby_libarchdir}/enc/windows_1253.so
%{ruby_libarchdir}/enc/windows_1254.so
%{ruby_libarchdir}/enc/windows_1257.so
%{ruby_libarchdir}/enc/windows_31j.so %{ruby_libarchdir}/enc/windows_31j.so
%{ruby_libarchdir}/etc.so %{ruby_libarchdir}/etc.so
%{ruby_libarchdir}/fcntl.so %{ruby_libarchdir}/fcntl.so
@ -832,7 +871,6 @@ make check TESTS="-v $DISABLE_TESTS"
%{ruby_libarchdir}/mathn/rational.so %{ruby_libarchdir}/mathn/rational.so
%{ruby_libarchdir}/nkf.so %{ruby_libarchdir}/nkf.so
%{ruby_libarchdir}/objspace.so %{ruby_libarchdir}/objspace.so
%{ruby_libarchdir}/openssl.so
%{ruby_libarchdir}/pathname.so %{ruby_libarchdir}/pathname.so
%{ruby_libarchdir}/pty.so %{ruby_libarchdir}/pty.so
%dir %{ruby_libarchdir}/racc %dir %{ruby_libarchdir}/racc
@ -847,9 +885,6 @@ make check TESTS="-v $DISABLE_TESTS"
%{ruby_libarchdir}/stringio.so %{ruby_libarchdir}/stringio.so
%{ruby_libarchdir}/strscan.so %{ruby_libarchdir}/strscan.so
%{ruby_libarchdir}/syslog.so %{ruby_libarchdir}/syslog.so
%exclude %{ruby_libarchdir}/tcltklib.so
%{ruby_libarchdir}/thread.so
%exclude %{ruby_libarchdir}/tkutil.so
%{ruby_libarchdir}/zlib.so %{ruby_libarchdir}/zlib.so
%{tapset_root} %{tapset_root}
@ -935,6 +970,14 @@ make check TESTS="-v $DISABLE_TESTS"
%exclude %{gem_dir}/gems/minitest-%{minitest_version}/.* %exclude %{gem_dir}/gems/minitest-%{minitest_version}/.*
%{gem_dir}/specifications/minitest-%{minitest_version}.gemspec %{gem_dir}/specifications/minitest-%{minitest_version}.gemspec
%files -n rubygem-openssl
%{ruby_libdir}/openssl
%{ruby_libdir}/openssl.rb
%{ruby_libarchdir}/openssl.so
%{_libdir}/gems/%{name}/openssl-%{openssl_version}
%{gem_dir}/gems/openssl-%{openssl_version}
%{gem_dir}/specifications/openssl-%{openssl_version}.gemspec
%files -n rubygem-power_assert %files -n rubygem-power_assert
%{gem_dir}/gems/power_assert-%{power_assert_version} %{gem_dir}/gems/power_assert-%{power_assert_version}
%exclude %{gem_dir}/gems/power_assert-%{power_assert_version}/.* %exclude %{gem_dir}/gems/power_assert-%{power_assert_version}/.*
@ -957,16 +1000,24 @@ make check TESTS="-v $DISABLE_TESTS"
%{gem_dir}/gems/test-unit-%{test_unit_version} %{gem_dir}/gems/test-unit-%{test_unit_version}
%{gem_dir}/specifications/test-unit-%{test_unit_version}.gemspec %{gem_dir}/specifications/test-unit-%{test_unit_version}.gemspec
%files tcltk %files -n rubygem-xmlrpc
%{ruby_libdir}/*-tk.rb %license %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/LICENSE.txt
%{ruby_libdir}/tcltk.rb %dir %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}
%{ruby_libdir}/tk*.rb %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/Gemfile
%{ruby_libarchdir}/tcltklib.so %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/Rakefile
%{ruby_libarchdir}/tkutil.so %doc %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/README.md
%{ruby_libdir}/tk %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/bin
%{ruby_libdir}/tkextlib %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/lib
%{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec
%changelog %changelog
* Mon Jan 02 2017 Vít Ondruch <vondruch@redhat.com> - 2.4.0-70
- Upgrade to Ruby 2.4.0.
- Move gemified xmlrpc into subpackage.
- Move gemified openssl into subpackage.
- Tk is removed from stdlib.
- Extend 'gem_' macros for pre-release version support.
* Tue Nov 22 2016 Vít Ondruch <vondruch@redhat.com> - 2.3.3-61 * Tue Nov 22 2016 Vít Ondruch <vondruch@redhat.com> - 2.3.3-61
- Update to Ruby 2.3.3. - Update to Ruby 2.3.3.
- Exclude json.rb from ruby-libs (rhbz#1397370). - Exclude json.rb from ruby-libs (rhbz#1397370).

View File

@ -1 +1 @@
0cba3d1b677d2695236ace62ca6d2255 ruby-2.3.3.tar.xz SHA512 (ruby-2.4.0.tar.xz) = 975a5388592adc038461e0acebb6c0efee242891b2ea8621476401458efe2bc0fdd317d3bf99beb745b0b3808410efdff33862da29c95c027f457943721e3ab6

View File

@ -3,8 +3,10 @@ require 'set'
LIBRUBY_SO = 'libruby.so' LIBRUBY_SO = 'libruby.so'
PROBES_D = 'probes.d' PROBES_D = 'probes.d'
### # These probes are excluded by VM_COLLECT_USAGE_DETAILS ifdef.
# Detect SystemTap section headers presence. EXCLUDE_PROBES = Set.new %w(insn insn__operand)
## Detect SystemTap section headers presence
stap_headers = [ stap_headers = [
'\.stapsdt\.base', '\.stapsdt\.base',
@ -22,43 +24,42 @@ unless detected_stap_headers.size == 2
exit false exit false
end 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. # Colect probes specified in probes.d file.
probes = [] probes_declared = []
File.open(PROBES_D) do |file| File.open(PROBES_D) do |file|
file.each_line do |line| file.each_line do |line|
if probe = line[/probe (\S+)\(.*\);/, 1] if probe = line[/probe (\S+)\(.*\);/, 1]
probes << probe probes_declared << probe
end end
end end
end end
probes = Set.new probes probes_declared = Set.new probes_declared
# These probes are excluded by VM_COLLECT_USAGE_DETAILS ifdef. unless EXCLUDE_PROBES.subset? probes_declared
EXCLUDE_PROBES = Set.new %w(insn insn__operand)
unless EXCLUDE_PROBES.subset? probes
puts 'ERROR: Change in SystemTap (DTrace) probes definition file detected.' puts 'ERROR: Change in SystemTap (DTrace) probes definition file detected.'
exit false exit false
end end
probes -= EXCLUDE_PROBES probes_declared -= EXCLUDE_PROBES
# Detect probes in resulting library. # Detect probes in resulting library.
probe_regexp = %r{ get_probes_detected = %r{
^\s*stapsdt\s*0[xX][0-9a-fA-F]+\tNT_STAPSDT \(SystemTap probe descriptors\)$ ^\s*Provider:\s+ruby,\s+Name:\s+(\S+),\s+.*$
^\s*Provider: ruby$
^\s*Name: (\S+)$
} }
notes = `readelf -n "#{LIBRUBY_SO}"` probes_detected = `eu-readelf -n "#{LIBRUBY_SO}"`
detected_probes = Set.new notes.scan(probe_regexp).flatten
probes_detected = Set.new probes_detected.scan(get_probes_detected).flatten
# Both sets must be equal, otherwise something is wrong. # 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 '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 exit false
end end