diff --git a/.gitignore b/.gitignore index d634c70..3523d77 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/ruby-2.4.2.tar.xz +/*/ +/ruby-2.*.tar.bz2 +/ruby-2.*.tar.xz +/*.rpm diff --git a/config.h b/config.h deleted file mode 100644 index b44f715..0000000 --- a/config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This config.h is a wrapper include file for the original ruby/config.h, - * which has been renamed to ruby/config-.h. There are conflicts for the - * original ruby/config.h on multilib systems, which result from arch-specific - * configuration options. Please do not use the arch-specific file directly. - */ - -/* - * This wrapped is addpated from SDL's one: - * http://pkgs.fedoraproject.org/cgit/SDL.git/tree/SDL_config.h - */ - -#ifdef ruby_config_wrapper_h -#error "ruby_config_wrapper_h should not be defined!" -#endif -#define ruby_config_wrapper_h - -#if defined(__i386__) -#include "ruby/config-i386.h" -#elif defined(__ia64__) -#include "ruby/config-ia64.h" -#elif defined(__powerpc64__) -#include -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#include "ruby/config-ppc64.h" -#else -#include "ruby/config-ppc64le.h" -#endif -#elif defined(__powerpc__) -#include "ruby/config-ppc.h" -#elif defined(__s390x__) -#include "ruby/config-s390x.h" -#elif defined(__s390__) -#include "ruby/config-s390.h" -#elif defined(__x86_64__) -#include "ruby/config-x86_64.h" -#elif defined(__arm__) -#include "ruby/config-arm.h" -#elif defined(__alpha__) -#include "ruby/config-alpha.h" -#elif defined(__sparc__) && defined (__arch64__) -#include "ruby/config-sparc64.h" -#elif defined(__sparc__) -#include "ruby/config-sparc.h" -#elif defined(__aarch64__) -#include "ruby/config-aarch64.h" -#elif defined(__mips64) && defined(__MIPSEL__) -#include "ruby/config-mips64el.h" -#elif defined(__mips64) -#include "ruby/config-mips64.h" -#elif defined(__mips) && defined(__MIPSEL__) -#include "ruby/config-mipsel.h" -#elif defined(__mips) -#include "ruby/config-mips.h" -#elif defined(__riscv64) -#include "ruby/config-riscv64.h" -#else -#error "The ruby-devel package is not usable with the architecture." -#endif - -#undef ruby_config_wrapper_h diff --git a/operating_system.rb b/operating_system.rb index 4b2903d..0d4b1f0 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -87,22 +87,33 @@ module Gem # Remove methods we are going to override. This avoids "method redefined;" # warnings otherwise issued by Ruby. + remove_method :operating_system_defaults if method_defined? :operating_system_defaults remove_method :default_dir if method_defined? :default_dir remove_method :default_path if method_defined? :default_path - remove_method :default_bindir if method_defined? :default_bindir remove_method :default_ext_dir_for if method_defined? :default_ext_dir_for + ## + # Regular user installs into user directory, root manages /usr/local. + + def operating_system_defaults + unless opt_build_root? + options = if Process.uid == 0 + "--install-dir=#{Gem.default_dirs[:local][:gem_dir]} --bindir #{Gem.default_dirs[:local][:bin_dir]}" + else + "--user-install --bindir #{File.join [Dir.home, 'bin']}" + end + + {"gem" => options} + else + {} + end + end + ## # RubyGems default overrides. def default_dir - if opt_build_root? - Gem.default_dirs[:system][:gem_dir] - elsif Process.uid == 0 - Gem.default_dirs[:local][:gem_dir] - else - Gem.user_dir - end + Gem.default_dirs[:system][:gem_dir] end def default_path @@ -110,16 +121,6 @@ module Gem path.unshift Gem.user_dir if File.exist? Gem.user_home end - def default_bindir - 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'] - end - end - def default_ext_dir_for base_dir dir = if rpmbuild? build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir] diff --git a/ruby-1.9.3-mkmf-verbose.patch b/ruby-1.9.3-mkmf-verbose.patch index d94ef7f..f2a1408 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 -@@ -1897,7 +1897,7 @@ def configuration(srcdir) +@@ -1899,7 +1899,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 3e29d1b..47bf9bc 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 @@ -6,14 +6,14 @@ Subject: [PATCH] Allow to specify addition preludes by configuration option. --- Makefile.in | 2 ++ common.mk | 2 +- - configure.in | 7 +++++++ + configure.ac | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 7e8ed82..7916993 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -116,6 +116,8 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ +@@ -119,6 +119,8 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ @@ -26,20 +26,20 @@ diff --git a/common.mk b/common.mk index 5cfbc3d..3f0a82e 100644 --- a/common.mk +++ b/common.mk -@@ -144,7 +144,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) +@@ -147,7 +147,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT) DEFAULT_PRELUDES = $(GEM_PRELUDE) --PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES) -+PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES) $(OPTIONAL_PRELUDES) +-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES) ++PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES) $(OPTIONAL_PRELUDES) GEM_PRELUDE = $(srcdir)/gem_prelude.rb PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c GOLFPRELUDES = {$(srcdir)}golf_prelude.c -diff --git a/configure.in b/configure.in -index 0e371e2..d4f1dcb 100644 ---- a/configure.in -+++ b/configure.in -@@ -4563,6 +4563,13 @@ AC_SUBST(rubyarchhdrdir)dnl +diff --git a/configure.ac b/configure.ac +index 028ef7ca3e..cdeff87871 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4396,6 +4396,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 bc75f5e..36ec460 100644 --- a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch @@ -4,15 +4,15 @@ Date: Tue, 1 Oct 2013 12:22:40 +0200 Subject: [PATCH] Allow to configure libruby.so placement. --- - configure.in | 5 +++++ + configure.ac | 5 +++++ 1 file changed, 5 insertions(+) -diff --git a/configure.in b/configure.in -index 37d9a62..553d4d0 100644 ---- a/configure.in -+++ b/configure.in -@@ -3823,6 +3823,11 @@ if test ${multiarch+set}; then - fi +diff --git a/configure.ac b/configure.ac +index 11fc237552..b77e88fc37 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3641,6 +3641,11 @@ AS_IF([test ${multiarch+set}], [ + ]) archlibdir='${libdir}/${arch}' +AC_ARG_WITH(archlibdir, 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 489a1b8..d0cffab 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,16 +5,16 @@ Subject: [PATCH] Prevent duplicated paths when empty version string is configured. --- - configure.in | 3 ++- + configure.ac | 3 ++- loadpath.c | 12 ++++++++++++ tool/mkconfig.rb | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) -diff --git a/configure.in b/configure.in -index db37cd6..ce8d149 100644 ---- a/configure.in -+++ b/configure.in -@@ -4417,7 +4417,8 @@ AS_CASE(["$ruby_version_dir_name"], +diff --git a/configure.ac b/configure.ac +index 999e2d6d5d..11fc237552 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4251,7 +4251,8 @@ AS_CASE(["$ruby_version_dir_name"], ruby_version_dir=/'${ruby_version_dir_name}' if test -z "${ruby_version_dir_name}"; then @@ -28,7 +28,7 @@ diff --git a/loadpath.c b/loadpath.c index 9160031..0d4d953 100644 --- a/loadpath.c +++ b/loadpath.c -@@ -65,22 +65,34 @@ const char ruby_initial_load_paths[] = +@@ -65,21 +65,33 @@ const char ruby_initial_load_paths[] = RUBY_SEARCH_PATH "\0" #endif #ifndef NO_RUBY_SITE_LIB @@ -58,16 +58,15 @@ index 9160031..0d4d953 100644 RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0" +#ifndef RUBY_LIB_VERSION_BLANK RUBY_VENDOR_LIB "\0" - #endif +#endif + #endif RUBY_LIB "\0" - #ifdef RUBY_THINARCH diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index 07076d4..35e6c3c 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb -@@ -113,7 +113,7 @@ +@@ -111,7 +111,7 @@ 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 238cd66..555ad45 100644 --- a/ruby-2.1.0-always-use-i386.patch +++ b/ruby-2.1.0-always-use-i386.patch @@ -4,22 +4,22 @@ Date: Mon, 19 Nov 2012 14:37:28 +0100 Subject: [PATCH] Always use i386. --- - configure.in | 2 ++ + configure.ac | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/configure.in b/configure.in -index 553d4d0..03a4152 100644 ---- a/configure.in -+++ b/configure.in -@@ -4481,6 +4481,8 @@ AC_SUBST(vendorarchdir)dnl +diff --git a/configure.ac b/configure.ac +index b77e88fc37..6bba453e3c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4315,6 +4315,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/` + - if test "${universal_binary-no}" = yes ; then + AS_IF([test "${universal_binary-no}" = yes ], [ arch="universal-${target_os}" - if test "${rb_cv_architecture_available}" = yes; then + AS_IF([test "${rb_cv_architecture_available}" = yes], [ -- 1.8.3.1 diff --git a/ruby-2.1.0-custom-rubygems-location.patch b/ruby-2.1.0-custom-rubygems-location.patch index 1905381..cc45741 100644 --- a/ruby-2.1.0-custom-rubygems-location.patch +++ b/ruby-2.1.0-custom-rubygems-location.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Allow to install RubyGems into custom location, outside of Ruby tree. --- - configure.in | 5 +++++ + configure.ac | 5 +++++ loadpath.c | 4 ++++ template/verconf.h.tmpl | 3 +++ - tool/rbinstall.rb | 9 +++++++++ - 4 files changed, 21 insertions(+) + tool/rbinstall.rb | 7 +++++++ + 4 files changed, 19 insertions(+) -diff --git a/configure.in b/configure.in -index 03a4152..0e371e2 100644 ---- a/configure.in -+++ b/configure.in -@@ -4453,6 +4453,10 @@ AC_ARG_WITH(vendorarchdir, +diff --git a/configure.ac b/configure.ac +index 6bba453e3c..028ef7ca3e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4287,6 +4287,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) @@ -23,10 +23,10 @@ index 03a4152..0e371e2 100644 + AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]), + [rubygemsdir=$withval]) + - if test "${LOAD_RELATIVE+set}"; then + AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -4477,6 +4481,7 @@ AC_SUBST(sitearchdir)dnl +@@ -4311,6 +4315,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl @@ -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 -@@ -330,6 +330,7 @@ def CONFIG.[](name, mandatory = false) +@@ -331,6 +331,7 @@ def CONFIG.[](name, mandatory = false) sitearchlibdir = CONFIG["sitearchdir"] vendorlibdir = CONFIG["vendorlibdir"] vendorarchlibdir = CONFIG["vendorarchdir"] @@ -75,17 +75,15 @@ index b47b6e1..0b99408 100755 mandir = CONFIG["mandir", true] docdir = CONFIG["docdir", true] configure_args = Shellwords.shellwords(CONFIG["configure_args"]) -@@ -517,7 +518,15 @@ def CONFIG.[](name, mandatory = false) +@@ -537,7 +538,13 @@ def install(src, cmd) install?(:local, :comm, :lib) do prepare "library scripts", rubylibdir - noinst = %w[README* *.txt *.rdoc *.gemspec] -+ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir + noinst = %w[*.txt *.rdoc *.gemspec] ++ noinst += %w[rubygems.rb rubygems/ datadir.rb] if rubygemsdir install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode) + if rubygemsdir + noinst = %w[obsolete.rb] + install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode) -+ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode) -+ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode) + install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode) + end end diff --git a/ruby-2.2.3-Generate-preludes-using-miniruby.patch b/ruby-2.2.3-Generate-preludes-using-miniruby.patch index 6e8adc4..ca66d28 100644 --- a/ruby-2.2.3-Generate-preludes-using-miniruby.patch +++ b/ruby-2.2.3-Generate-preludes-using-miniruby.patch @@ -11,7 +11,7 @@ diff --git a/common.mk b/common.mk index 168dc52..20c218a 100644 --- a/common.mk +++ b/common.mk -@@ -873,9 +873,9 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE) +@@ -962,9 +962,9 @@ $(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(srcdir)/template/prelude.c.tmpl $(PRELUDE_C): $(COMPILE_PRELUDE) \ diff --git a/ruby-2.3.0-ruby_version.patch b/ruby-2.3.0-ruby_version.patch index 80be728..8f57319 100644 --- a/ruby-2.3.0-ruby_version.patch +++ b/ruby-2.3.0-ruby_version.patch @@ -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 string. --- - configure.in | 64 ++++++++++++++++++++++++++++------------------------- + configure.ac | 64 ++++++++++++++++++++++++++++------------------------- template/ruby.pc.in | 1 + 2 files changed, 35 insertions(+), 30 deletions(-) -diff --git a/configure.in b/configure.in -index db37cd6..6e73fae 100644 ---- a/configure.in -+++ b/configure.in -@@ -4368,9 +4368,6 @@ AS_CASE(["$target_os"], +diff --git a/configure.ac b/configure.ac +index 8ea969412f..a00f2b6776 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4202,9 +4202,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], -@@ -4393,56 +4390,62 @@ AC_ARG_WITH(ridir, +@@ -4227,56 +4224,62 @@ AC_ARG_WITH(ridir, AC_SUBST(ridir) AC_SUBST(RI_BASE_NAME) @@ -43,7 +43,7 @@ index db37cd6..6e73fae 100644 -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 +-AS_IF([test ${RUBY_LIB_VERSION_STYLE+set}], [ - { - echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" - echo '#define STRINGIZE(x) x' @@ -53,11 +53,11 @@ index db37cd6..6e73fae 100644 - } > conftest.c - 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 +-], [test -z "${ruby_version}"], [ - 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" @@ -118,9 +118,9 @@ index db37cd6..6e73fae 100644 - [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 + AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) -@@ -4459,6 +4462,7 @@ AC_SUBST(sitearchincludedir)dnl +@@ -4293,6 +4296,7 @@ AC_SUBST(sitearchincludedir)dnl AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl @@ -137,9 +137,9 @@ index 8a2c066..c81b211 100644 TEENY=@TEENY@ ruby_version=@ruby_version@ +ruby_version_dir_name=@ruby_version_dir_name@ + RUBY_API_VERSION=@RUBY_API_VERSION@ RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@ RUBY_BASE_NAME=@RUBY_BASE_NAME@ - RUBY_VERSION_NAME=@RUBY_VERSION_NAME@ -- 2.1.0 @@ -245,7 +245,7 @@ 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 -@@ -1124,7 +1124,8 @@ def test_self_use_paths +@@ -1156,7 +1156,8 @@ def test_self_use_paths def test_self_user_dir parts = [@userhome, '.gem', Gem.ruby_engine] @@ -255,7 +255,7 @@ index 0428bea..b6e090e 100644 assert_equal File.join(parts), Gem.user_dir end -@@ -1251,7 +1252,7 @@ def test_self_user_home_user_drive_and_path +@@ -1283,7 +1284,7 @@ def test_self_user_home_user_drive_and_path def test_self_vendor_dir expected = File.join RbConfig::CONFIG['vendordir'], 'gems', @@ -275,14 +275,14 @@ Subject: [PATCH 4/4] Let headers directories follow the configured version name. --- - configure.in | 2 +- + configure.ac | 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 -@@ -271,7 +271,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` +diff --git a/configure.ac b/configure.ac +index a00f2b6776..999e2d6d5d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -164,7 +164,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/ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch b/ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch index 8765d2a..2dc17e3 100644 --- a/ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch +++ b/ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch @@ -15,7 +15,7 @@ diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 1da3d93..65148a1 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb -@@ -6,98 +6,6 @@ +@@ -6,95 +6,6 @@ libc_so = libm_so = nil @@ -23,9 +23,6 @@ index 1da3d93..65148a1 100644 -when /cygwin/ - libc_so = "cygwin1.dll" - libm_so = "cygwin1.dll" --when /x86_64-linux/ -- libc_so = "/lib64/libc.so.6" -- libm_so = "/lib64/libm.so.6" -when /linux/ - libdir = '/lib' - case [0].pack('L!').size diff --git a/ruby-2.5.0-Add-Gem.operating_system_defaults.patch b/ruby-2.5.0-Add-Gem.operating_system_defaults.patch new file mode 100644 index 0000000..6838701 --- /dev/null +++ b/ruby-2.5.0-Add-Gem.operating_system_defaults.patch @@ -0,0 +1,80 @@ +From 60eb961c25f801ee43ca1be9393ab2f0a0546677 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 19 Dec 2017 14:00:20 +0100 +Subject: [PATCH] Add Gem.operating_system_defaults to allow packagers to + override defaults. + +This change allows Ruby packagers to override defaults and lazily query +them. + +This is very much the same change as #1644 to treat the +operating_system defaults the same way as platform defaults. +--- + lib/rubygems/config_file.rb | 2 +- + lib/rubygems/defaults.rb | 21 ++++++++++++++++++++- + test/rubygems/test_gem.rb | 7 +++++++ + 3 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb +index a4efed0f5a..deee38e6d9 100644 +--- a/lib/rubygems/config_file.rb ++++ b/lib/rubygems/config_file.rb +@@ -48,7 +48,7 @@ class Gem::ConfigFile + # For Ruby packagers to set configuration defaults. Set in + # rubygems/defaults/operating_system.rb + +- OPERATING_SYSTEM_DEFAULTS = {} ++ OPERATING_SYSTEM_DEFAULTS = Gem.operating_system_defaults + + ## + # For Ruby implementers to set configuration defaults. Set in +diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb +index 43d57fc808..b8222877ae 100644 +--- a/lib/rubygems/defaults.rb ++++ b/lib/rubygems/defaults.rb +@@ -177,7 +177,26 @@ def self.vendor_dir # :nodoc: + end + + ## +- # Default options for gem commands. ++ # Default options for gem commands for Ruby packagers. ++ # ++ # The options here should be structured as an array of string "gem" ++ # command names as keys and a string of the default options as values. ++ # ++ # Example: ++ # ++ # def self.operating_system_defaults ++ # { ++ # 'install' => '--no-rdoc --no-ri --env-shebang', ++ # 'update' => '--no-rdoc --no-ri --env-shebang' ++ # } ++ # end ++ ++ def self.operating_system_defaults ++ {} ++ end ++ ++ ## ++ # Default options for gem commands for Ruby implementers. + # + # The options here should be structured as an array of string "gem" + # command names as keys and a string of the default options as values. +diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb +index 3225a05c6b..62b80c4945 100644 +--- a/test/rubygems/test_gem.rb ++++ b/test/rubygems/test_gem.rb +@@ -1802,6 +1802,13 @@ def test_use_gemdeps_specific + ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps + end + ++ def test_operating_system_defaults ++ operating_system_defaults = Gem.operating_system_defaults ++ ++ assert operating_system_defaults != nil ++ assert operating_system_defaults.is_a? Hash ++ end ++ + def test_platform_defaults + platform_defaults = Gem.platform_defaults + diff --git a/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch b/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch new file mode 100644 index 0000000..fa5ad3e --- /dev/null +++ b/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch @@ -0,0 +1,115 @@ +From 584b5929f9b769c4d0b03e322a9fddf2b2dd3454 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 13:02:11 +0000 +Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix + +* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected + data at the Kiritimati's skip of New Year's Eve 1994. + [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index dfe139033ed3..ac5f81892878 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -364,9 +364,18 @@ def self.gen_zdump_test(data) + Europe/London Sun Aug 10 01:00:00 1947 UTC = Sun Aug 10 02:00:00 1947 BST isdst=1 gmtoff=3600 + Europe/London Sun Nov 2 01:59:59 1947 UTC = Sun Nov 2 02:59:59 1947 BST isdst=1 gmtoff=3600 + Europe/London Sun Nov 2 02:00:00 1947 UTC = Sun Nov 2 02:00:00 1947 GMT isdst=0 gmtoff=0 ++End ++ if CORRECT_KIRITIMATI_SKIP_1994 ++ gen_zdump_test <<'End' ++Pacific/Kiritimati Sat Dec 31 09:59:59 1994 UTC = Fri Dec 30 23:59:59 1994 LINT isdst=0 gmtoff=-36000 ++Pacific/Kiritimati Sat Dec 31 10:00:00 1994 UTC = Sun Jan 1 00:00:00 1995 LINT isdst=0 gmtoff=50400 ++End ++ else ++ gen_zdump_test <<'End' + Pacific/Kiritimati Sun Jan 1 09:59:59 1995 UTC = Sat Dec 31 23:59:59 1994 LINT isdst=0 gmtoff=-36000 + Pacific/Kiritimati Sun Jan 1 10:00:00 1995 UTC = Mon Jan 2 00:00:00 1995 LINT isdst=0 gmtoff=50400 + End ++ end + gen_zdump_test <<'End' if has_right_tz + right/America/Los_Angeles Fri Jun 30 23:59:60 1972 UTC = Fri Jun 30 16:59:60 1972 PDT isdst=1 gmtoff=-25200 + right/America/Los_Angeles Wed Dec 31 23:59:60 2008 UTC = Wed Dec 31 15:59:60 2008 PST isdst=0 gmtoff=-28800 +-- + +From 2965c2d4df78e6f5acf8759f84c88ce14a4e70f1 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 02:00:36 +0000 +Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix + +* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati): + fix the expected data at the skip of New Year's Eve 1994. + [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index 39b830d28a3d..dfe139033ed3 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -89,6 +89,9 @@ def group_by(e, &block) + Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata + end + } ++ CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") { ++ Time.local(1994, 12, 31, 0, 0, 0).year == 1995 ++ } + + def time_to_s(t) + t.to_s +@@ -178,9 +181,17 @@ def test_europe_lisbon + + def test_pacific_kiritimati + with_tz(tz="Pacific/Kiritimati") { +- assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) +- assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) +- assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) ++ assert_time_constructor(tz, "1994-12-30 00:00:00 -1000", :local, [1994,12,30,0,0,0]) ++ assert_time_constructor(tz, "1994-12-30 23:59:59 -1000", :local, [1994,12,30,23,59,59]) ++ if CORRECT_KIRITIMATI_SKIP_1994 ++ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1994,12,31,0,0,0]) ++ assert_time_constructor(tz, "1995-01-01 23:59:59 +1400", :local, [1994,12,31,23,59,59]) ++ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1995,1,1,0,0,0]) ++ else ++ assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) ++ assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) ++ assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) ++ end + assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,2,0,0,0]) + } + end +-- + +From a0e6607a8172f9eaf9a15f03065736deb2035771 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 13:16:14 +0000 +Subject: [PATCH] test_time_tz.rb: Lisbon tzdata fix + +* test/ruby/test_time_tz.rb (gen_variational_zdump_test): Update + Lisbon zdump data, which fixed the 1912-01-01 transition for + Portugual and its colonies. [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index ac5f81892878..b32caff9c539 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -434,5 +434,6 @@ def self.gen_variational_zdump_test(hint, data) + gen_variational_zdump_test "lisbon", <<'End' if has_lisbon_tz + Europe/Lisbon Mon Jan 1 00:36:31 1912 UTC = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2192 + Europe/Lisbon Mon Jan 1 00:36:44 1912 UT = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2205 ++Europe/Lisbon Sun Dec 31 23:59:59 1911 UT = Sun Dec 31 23:23:14 1911 LMT isdst=0 gmtoff=-2205 + End + end diff --git a/ruby.spec b/ruby.spec index 60f56f5..57e522c 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %global major_version 2 -%global minor_version 4 -%global teeny_version 2 +%global minor_version 5 +%global teeny_version 1 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -10,7 +10,7 @@ #%%global milestone rc1 # Keep the revision enabled for pre-releases from SVN. -#%%global revision 57159 +#%%global revision 61414 %global ruby_archive %{name}-%{ruby_version} @@ -21,7 +21,7 @@ %endif -%global release 84 +%global release 92 %{!?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 @@ -29,26 +29,26 @@ %global rubygems_dir %{_datadir}/rubygems # Bundled libraries versions -%global rubygems_version 2.6.13 +%global rubygems_version 2.7.6 %global molinillo_version 0.5.7 # 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.3.0 -%global did_you_mean_version 1.1.0 +%global bigdecimal_version 1.3.4 +%global did_you_mean_version 1.2.0 %global io_console_version 0.4.6 -%global json_version 2.0.4 -%global minitest_version 5.10.1 +%global json_version 2.1.0 +%global minitest_version 5.10.3 %global net_telnet_version 0.1.1 -%global openssl_version 2.0.5 -%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 +%global openssl_version 2.1.0 +%global power_assert_version 1.1.1 +%global psych_version 3.0.2 +%global rake_version 12.3.0 +%global rdoc_version 6.0.1 +%global test_unit_version 3.2.7 +%global xmlrpc_version 0.3.0 # Might not be needed in the future, if we are lucky enough. # https://bugzilla.redhat.com/show_bug.cgi?id=888262 @@ -59,13 +59,21 @@ %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 +%bcond_without rubypick +%endif + +%bcond_without systemtap +%bcond_without git +%bcond_without cmake + +%if 0%{?fedora} +%bcond_without hardening_test %endif Summary: An interpreter of object-oriented scripting language Name: ruby Version: %{ruby_version} -Release: %{release_string}.2 +Release: %{release_string} Group: Development/Languages # Public Domain for example for: include/ruby/st.h, strftime.c, missing/*, ... # MIT and CCO: ccan/* @@ -81,19 +89,15 @@ Source3: ruby-exercise.stp Source4: macros.ruby Source5: macros.rubygems Source6: abrt_prelude.rb -# This wrapper fixes https://bugzilla.redhat.com/show_bug.cgi?id=977941 -# Hopefully, it will get removed soon: -# https://fedorahosted.org/fpc/ticket/312 -# https://bugzilla.redhat.com/show_bug.cgi?id=977941 -Source7: config.h # RPM dependency generators. Source8: rubygems.attr Source9: rubygems.req Source10: rubygems.prov +Source11: rubygems.con # ABRT hoook test case. -Source12: test_abrt.rb +Source13: test_abrt.rb # SystemTap tests. -Source13: test_systemtap.rb +Source14: test_systemtap.rb # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -128,10 +132,15 @@ Patch7: ruby-2.2.3-Generate-preludes-using-miniruby.patch # hardening features of glibc (rhbz#1361037). # https://bugs.ruby-lang.org/issues/12666 Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch +# Add Gem.operating_system_defaults to allow packagers to override defaults. +# https://github.com/rubygems/rubygems/pull/2116 +Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch +# TestTimeTZ test failures Kiritimati and Lisbon +# https://bugs.ruby-lang.org/issues/14655 +Patch11: ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} -# No rubypick in RHEL8 -# Suggests: rubypick +Suggests: rubypick Recommends: ruby(rubygems) >= %{rubygems_version} Recommends: rubygem(bigdecimal) >= %{bigdecimal_version} Recommends: rubygem(did_you_mean) >= %{did_you_mean_version} @@ -145,13 +154,14 @@ BuildRequires: libyaml-devel BuildRequires: readline-devel # Needed to pass test_set_program_name(TestRubyOptions) BuildRequires: procps -BuildRequires: %{_bindir}/dtrace +%{?with_systemtap:BuildRequires: %{_bindir}/dtrace} # RubyGems test suite optional dependencies. -BuildRequires: git -BuildRequires: %{_bindir}/cmake +%{?with_git:BuildRequires: git} +%{?with_cmake:BuildRequires: %{_bindir}/cmake} # Required to test hardening. -BuildRequires: %{_bindir}/checksec +%{?with_hardening_test:BuildRequires: %{_bindir}/checksec} BuildRequires: multilib-rpm-config +BuildRequires: gcc # This package provides %%{_bindir}/ruby-mri therefore it is marked by this # virtual provide. It can be installed as dependency of rubypick. @@ -214,7 +224,6 @@ 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 @@ -273,7 +282,7 @@ Summary: A tool to generate HTML and command-line documentation for Ruby proj Version: %{rdoc_version} Group: Development/Libraries # SIL: lib/rdoc/generator/template/darkfish/css/fonts.css -License: GPLv2 and Ruby and MIT and SIL +License: GPLv2 and Ruby and MIT and OFL Requires: ruby(release) Requires: ruby(rubygems) >= %{rubygems_version} Requires: ruby(irb) = %{irb_version} @@ -306,7 +315,7 @@ This package contains documentation for %{name}. Summary: BigDecimal provides arbitrary-precision floating point decimal arithmetic Version: %{bigdecimal_version} Group: Development/Libraries -License: GPL+ or Artistic +License: Ruby or BSD Requires: ruby(release) Requires: ruby(rubygems) >= %{rubygems_version} Provides: rubygem(bigdecimal) = %{version}-%{release} @@ -332,6 +341,7 @@ License: MIT Requires: ruby(release) Requires: ruby(rubygems) >= %{rubygems_version} Provides: rubygem(did_you_mean) = %{version}-%{release} +BuildArch: noarch %description -n rubygem-did_you_mean "did you mean?" experience in Ruby: the error message will tell you the right @@ -446,6 +456,7 @@ Group: Development/Libraries Requires: ruby(release) Requires: ruby(rubygems) >= %{rubygems_version} Provides: rubygem(net-telnet) = %{version}-%{release} +BuildArch: noarch %description -n rubygem-net-telnet Provides telnet client functionality. @@ -509,6 +520,8 @@ rm -rf ext/fiddle/libffi* %patch6 -p1 %patch7 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -586,6 +599,7 @@ mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs install -m 644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/fileattrs install -m 755 %{SOURCE9} %{buildroot}%{_rpmconfigdir} install -m 755 %{SOURCE10} %{buildroot}%{_rpmconfigdir} +install -m 755 %{SOURCE11} %{buildroot}%{_rpmconfigdir} # Install custom operating_system.rb. mkdir -p %{buildroot}%{rubygems_dir}/rubygems/defaults @@ -687,16 +701,25 @@ sed -i 's/^/%doc /' .ruby-doc.* sed -i 's/^/%lang(ja) /' .ruby-doc.ja %check +%if 0%{?with_hardening_test} # 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}" +%endif -# Check RubyGems version correctness. +# Check RubyGems version. [ "`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`" \ + +# Check Rubygems bundled dependencies versions. + +# Molinillo. +[ "`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). @@ -704,23 +727,26 @@ touch abrt.rb # Check if abrt hook is required (RubyGems are disabled by default when using # runruby, so re-enable them). -make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE12}" +make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE13}" # Check if systemtap is supported. -make runruby TESTRUN_SCRIPT=%{SOURCE13} +%{?with_systemtap:make runruby TESTRUN_SCRIPT=%{SOURCE14}} DISABLE_TESTS="" -# https://bugs.ruby-lang.org/issues/11480 -# Once seen: http://koji.fedoraproject.org/koji/taskinfo?taskID=12556650 -DISABLE_TESTS="$DISABLE_TESTS -x test_fork.rb" +# SIGSEV handler does not provide correct output on AArch64. +# https://bugs.ruby-lang.org/issues/13758 +%ifarch aarch64 +DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\|loaded_features\)/" +%endif + +# Disable failing TestResolvMDNS#test_mdns_each_address test, +# which fails on Koji. +# https://bugs.ruby-lang.org/issues/14175 +sed -i '/def test_mdns_each_address$/,/^ end$/ s/^/#/' test/resolv/test_mdns.rb make check TESTS="-v $DISABLE_TESTS" -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig - %files %license BSDL %license COPYING @@ -777,7 +803,6 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/net %{ruby_libdir}/optparse %{ruby_libdir}/racc -%{ruby_libdir}/rbconfig %{ruby_libdir}/rexml %{ruby_libdir}/rinda %{ruby_libdir}/ripper @@ -874,9 +899,6 @@ make check TESTS="-v $DISABLE_TESTS" %dir %{ruby_libarchdir}/io %{ruby_libarchdir}/io/nonblock.so %{ruby_libarchdir}/io/wait.so -%dir %{ruby_libarchdir}/mathn -%{ruby_libarchdir}/mathn/complex.so -%{ruby_libarchdir}/mathn/rational.so %{ruby_libarchdir}/nkf.so %{ruby_libarchdir}/objspace.so %{ruby_libarchdir}/pathname.so @@ -900,10 +922,8 @@ make check TESTS="-v $DISABLE_TESTS" %files -n rubygems %{_bindir}/gem %dir %{rubygems_dir} -%{rubygems_dir}/rbconfig %{rubygems_dir}/rubygems %{rubygems_dir}/rubygems.rb -%{rubygems_dir}/ubygems.rb # Explicitly include only RubyGems directory strucure to avoid accidentally # packaged content. @@ -920,11 +940,30 @@ make check TESTS="-v $DISABLE_TESTS" %exclude %{gem_dir}/cache/* +# TODO: Gemify these libraries +%{gem_dir}/specifications/default/cmath-1.0.0.gemspec +%{gem_dir}/specifications/default/csv-1.0.0.gemspec +%{gem_dir}/specifications/default/date-1.0.0.gemspec +%{gem_dir}/specifications/default/dbm-1.0.0.gemspec +%{gem_dir}/specifications/default/etc-1.0.0.gemspec +%{gem_dir}/specifications/default/fcntl-1.0.0.gemspec +%{gem_dir}/specifications/default/fiddle-1.0.0.gemspec +%{gem_dir}/specifications/default/fileutils-1.0.2.gemspec +%{gem_dir}/specifications/default/gdbm-2.0.0.gemspec +%{gem_dir}/specifications/default/ipaddr-1.2.0.gemspec +%{gem_dir}/specifications/default/scanf-1.0.0.gemspec +%{gem_dir}/specifications/default/sdbm-1.0.0.gemspec +%{gem_dir}/specifications/default/stringio-0.0.1.gemspec +%{gem_dir}/specifications/default/strscan-1.0.0.gemspec +%{gem_dir}/specifications/default/webrick-1.4.2.gemspec +%{gem_dir}/specifications/default/zlib-1.0.0.gemspec + %files -n rubygems-devel %{_rpmconfigdir}/macros.d/macros.rubygems %{_rpmconfigdir}/fileattrs/rubygems.attr %{_rpmconfigdir}/rubygems.req %{_rpmconfigdir}/rubygems.prov +%{_rpmconfigdir}/rubygems.con %files -n rubygem-rake %{_bindir}/rake @@ -1015,19 +1054,60 @@ make check TESTS="-v $DISABLE_TESTS" %files -n rubygem-xmlrpc %license %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/LICENSE.txt %dir %{gem_dir}/gems/xmlrpc-%{xmlrpc_version} +%exclude %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/.* %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/Gemfile %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/Rakefile %doc %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/README.md %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/bin %{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/lib +%{gem_dir}/gems/xmlrpc-%{xmlrpc_version}/xmlrpc.gemspec %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog -* Wed Mar 21 2018 Troy Dawson - 2.4.2-84.2 -- No rubypick in RHEL +* Tue Apr 10 2018 Vít Ondruch - 2.5.1-92 +- Conflict requirement needs to generate dependency. +- Stop using --with-setjmp-type=setjmp on aarch64 (rhbz#1545239). -* Tue Oct 24 2017 Troy Dawson - 2.4.2-84.1 -- Cleanup spec file conditionals +* Thu Mar 29 2018 Pavel Valena - 2.5.1-92 +- Update to Ruby 2.5.1. + +* Thu Mar 01 2018 Vít Ondruch - 2.5.0-90 +- Drop GMP dependency. + +* Sat Feb 24 2018 Florian Weimer - 2.5.0-89 +- Use --with-setjmp-type=setjmp on aarch64 to work around gcc issue (#1545239) + +* Wed Feb 21 2018 Pavel Valena - 2.5.0-89 +- Fix: Multiple vulnerabilities in RubyGems + https://bugzilla.redhat.com/show_bug.cgi?id=1547431 + https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ + +* Tue Feb 13 2018 Vít Ondruch - 2.5.0-89 +- Drop obsolete ldconfig scriptlets. +- Add GMP dependency. +- Use 'with' operator in RPM dependency generator. +- Add conflicts RPM generator. +- Fix thread_safe test suite segfaults. +- Fix invalid licenses. + +* Fri Feb 09 2018 Fedora Release Engineering - 2.5.0-89 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Jan 20 2018 Björn Esser - 2.5.0-88 +- Rebuilt for switch to libxcrypt + +* Tue Jan 09 2018 Vít Ondruch - 2.5.0-87 +- Fix segfaults during generating of documentation. + +* Tue Jan 02 2018 Vít Ondruch - 2.5.0-86 +- Upgrade to Ruby 2.5.0. + +* Fri Oct 27 2017 Jun Aruga - 2.4.2-86 +- Add macro to remove rubypick dependency. +- Improve "with" conditional statement as inline. + +* Thu Oct 19 2017 Jun Aruga - 2.4.2-85 +- Add macros to remove systemtap, git and cmake dependencies. * Mon Sep 18 2017 Pavel Valena - 2.4.2-84 - Update to Ruby 2.4.2. diff --git a/rubygems.attr b/rubygems.attr index f033d43..5793bf7 100644 --- a/rubygems.attr +++ b/rubygems.attr @@ -1,5 +1,6 @@ %__rubygems_requires %{_rpmconfigdir}/rubygems.req %__rubygems_provides %{_rpmconfigdir}/rubygems.prov +%__rubygems_conflicts %{_rpmconfigdir}/rubygems.con # In non-gem packages, the %%{gem_name} macro is not available and the macro # stays unexpanded which leads to "invalid regex" error (rhbz#1154067). %__rubygems_path ^%{?gem_name:%{gem_spec}}%{!?gem_name:this_should_never_match_anything}$ diff --git a/rubygems.con b/rubygems.con new file mode 100644 index 0000000..1a99ed0 --- /dev/null +++ b/rubygems.con @@ -0,0 +1,52 @@ +#!/usr/bin/ruby + +require 'rubygems/package' + +module RubyGemsReq + module Helpers + # Keep only '!=' requirements. + def self.conflicts(requirements) + conflicts = requirements.select {|r| r.first == '!='} + end + + # Converts Gem::Requirement into array of requirements strings compatible + # with RPM .spec file. + def self.requirement_versions_to_rpm(requirement) + self.conflicts(requirement.requirements).map do |op, version| + version == Gem::Version.new(0) ? "" : "= #{version}" + end + end + end + + # Report conflicting gem dependencies including their version. + def self.gem_depenencies(specification) + specification.runtime_dependencies.each do |dependency| + conflict_strings = Helpers::requirement_versions_to_rpm(dependency.requirement).map do |requirement| + requirement_string = "rubygem(#{dependency.name}) #{requirement}" + end + if conflict_strings.length > 0 + conflict_string = conflict_strings.join(' with ') + conflict_string.prepend('(').concat(')') if conflict_strings.length > 1 + puts conflict_string + end + end + end + + # Reports all conflicts specified by all provided .gemspec files. + def self.conflicts + while filename = gets + filename.strip! + begin + specification = Gem::Specification.load filename + + gem_depenencies(specification) + rescue => e + # Ignore all errors. + end + end + end +end + +if __FILE__ == $0 + RubyGemsReq::conflicts +end diff --git a/rubygems.req b/rubygems.req index 4f7a583..d75247d 100644 --- a/rubygems.req +++ b/rubygems.req @@ -11,11 +11,17 @@ module RubyGemsReq when '~>' expand_pessimistic_requirement(r) when '!=' - expand_not_equal_requirement(r) + # If there is only the conflict requirement, we still need to depend + # on the specified gem. + if requirements.size == 1 + Gem::Requirement.default.requirements + else + [] + end else [r] end - end + end.reject {|r| r.empty? } end # Expands the pessimistic version operator '~>' into equivalent '>=' and @@ -25,12 +31,6 @@ module RubyGemsReq return ['>=', requirement.last], ['<', next_version] end - # Expands the not equal version operator '!=' into equivalent '<' and - # '>' pair. - def self.expand_not_equal_requirement(requirement) - return ['<', requirement.last], ['>', requirement.last] - end - # Converts Gem::Requirement into array of requirements strings compatible # with RPM .spec file. def self.requirement_versions_to_rpm(requirement) @@ -44,7 +44,7 @@ module RubyGemsReq def self.rubygems_dependency(specification) Helpers::requirement_versions_to_rpm(specification.required_rubygems_version).each do |requirement| dependency_string = "ruby(rubygems)" - dependency_string += " #{specification.required_rubygems_version}" if requirement && requirement.length > 0 + dependency_string += " #{specification.required_rubygems_version}" if requirement&.length > 0 puts dependency_string end end @@ -52,11 +52,14 @@ module RubyGemsReq # Report all gem dependencies including their version. def self.gem_depenencies(specification) specification.runtime_dependencies.each do |dependency| - Helpers::requirement_versions_to_rpm(dependency.requirement).each do |requirement| - dependency_string = "rubygem(#{dependency.name})" - dependency_string += " #{requirement}" if requirement && requirement.length > 0 - puts dependency_string + dependency_strings = Helpers::requirement_versions_to_rpm(dependency.requirement).map do |requirement| + requirement_string = "rubygem(#{dependency.name})" + requirement_string += " #{requirement}" if requirement&.length > 0 + requirement_string end + dependency_string = dependency_strings.join(' with ') + dependency_string.prepend('(').concat(')') if dependency_strings.length > 1 + puts dependency_string end end diff --git a/sources b/sources index 573c343..7ef486c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a991f06ea1a1d421f7888c75f80f12d6 ruby-2.4.2.tar.xz +SHA512 (ruby-2.5.1.tar.xz) = 31bacf58469953282cd5d8b51862dcf4b84dedb927c1871bc3fca32fc157fe49187631575a70838705fe246f4555647577a7ecc26894445a7d64de5503dc11b4