diff --git a/.gitignore b/.gitignore index fdc04b8..dcf5c8f 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ rubygems-1.3.7.tgz /rubygems-2.1.9.tgz /rubygems-2.1.10.tgz /rubygems-2.1.11.tgz +/rubygems-2.2.2.tgz diff --git a/load.inc b/load.inc new file mode 100644 index 0000000..bf9c07e --- /dev/null +++ b/load.inc @@ -0,0 +1,30 @@ +%{lua: + +function source_macros(file) + local macro = nil + + for line in io.lines(file) do + if not macro and line:match("^%%") then + macro = line:match("^%%(.*)$") + line = nil + end + + if macro then + if line and macro:match("^.-%s*\\%s*$") then + macro = macro .. '\n' .. line + end + + if not macro:match("^.-%s*\\%s*$") then + rpm.define(macro) + macro = nil + end + end + end +end + +} + +# Include the constants defined in macros files. Could be dropped as soon as +# RPM supports the %%load macro (RPM 4.12+ probably). +# http://lists.rpm.org/pipermail/rpm-maint/2014-February/003659.html +%define load() %{lua:source_macros(rpm.expand("%1"))} diff --git a/macros.rubygems b/macros.rubygems new file mode 100644 index 0000000..1043c02 --- /dev/null +++ b/macros.rubygems @@ -0,0 +1,37 @@ +# The RubyGems root folder. +%gem_dir %{_datadir}/gems +%gem_archdir %{_libdir}/gems + +# Common gem locations and files. +%gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} +%gem_extdir_mri %{gem_archdir}/%{name}/%{gem_name}-%{version} +%gem_libdir %{gem_instdir}/lib +%gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem +%gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec +%gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} + +# Install gem into appropriate directory. +# -n Overrides gem file name for installation. +# -d Set installation directory. +%gem_install(d:n:) \ +mkdir -p %{-d*}%{!?-d:.%{gem_dir}} \ +\ +CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\ +gem install \\\ + -V \\\ + --local \\\ + --install-dir %{-d*}%{!?-d:.%{gem_dir}} \\\ + --bindir .%{_bindir} \\\ + --force \\\ + --document=ri,rdoc \\\ + %{-n*}%{!?-n:%{gem_name}-%{version}.gem} \ +%{nil} + +# For rubygems packages we want to filter out any provides caused by private +# libs in %%{gem_archdir}. +# +# Note that this must be invoked in the spec file, preferably as +# "%{?rubygems_default_filter}", before any %description block. +%rubygems_default_filter %{expand: \ +%global __provides_exclude_from %{?__provides_exclude_from:%{__provides_exclude_from}|}^%{gem_extdir_mri}/.*\\\\.so$ \ +} diff --git a/operating_system.rb b/operating_system.rb index c3b19d6..079564f 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -12,6 +12,15 @@ module Gem private :previous_but_one_dir_to ## + # 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'] + end + private :rpmbuild? + + ## # Default gems locations allowed on FHS system (/usr, /usr/share). # The locations are derived from directories specified during build # configuration. @@ -78,8 +87,26 @@ module Gem end def default_ext_dir_for base_dir - dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir} - dirs && File.join(dirs.last[:ext_dir], RbConfig::CONFIG['RUBY_INSTALL_NAME']) + dir = if rpmbuild? + build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir] + if build_dir != base_dir + File.join build_dir, Gem.default_dirs[:system][:ext_dir] + end + else + dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir} + dirs && dirs.last[:ext_dir] + end + dir && File.join(dir, RbConfig::CONFIG['RUBY_INSTALL_NAME']) + end + + # This method should be available since RubyGems 2.2 until RubyGems 3.0. + # https://github.com/rubygems/rubygems/issues/749 + if method_defined? :install_extension_in_lib + remove_method :install_extension_in_lib + + def install_extension_in_lib + false + end end end end diff --git a/rubygems-1.8.5-show-rdoc-process-verbosely.patch b/rubygems-1.8.5-show-rdoc-process-verbosely.patch deleted file mode 100644 index e8d717f..0000000 --- a/rubygems-1.8.5-show-rdoc-process-verbosely.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- rubygems-1.8.5/lib/rubygems/commands/setup_command.rb.rdoc_v 2011-05-26 13:01:53.000000000 +0900 -+++ rubygems-1.8.5/lib/rubygems/commands/setup_command.rb 2011-06-02 00:11:14.000000000 +0900 -@@ -329,7 +329,8 @@ - - require 'rdoc/rdoc' - -- args << '--main' << 'README.rdoc' << '--quiet' -+ args << '--main' << 'README.rdoc' -+ args << '--quiet' unless Gem.configuration.really_verbose - args << '.' - args << 'README.rdoc' << 'UPGRADING.rdoc' - args << 'LICENSE.txt' << 'MIT.txt' << 'History.txt' ---- rubygems-1.8.5/lib/rubygems/doc_manager.rb.rdoc_v 2011-05-19 08:36:37.000000000 +0900 -+++ rubygems-1.8.5/lib/rubygems/doc_manager.rb 2011-06-02 00:09:15.000000000 +0900 -@@ -165,7 +165,7 @@ - args << @spec.require_paths.clone - args << @spec.extra_rdoc_files - args << '--title' << "#{@spec.full_name} Documentation" -- args << '--quiet' -+ args << '--quiet' unless Gem.configuration.really_verbose - args = args.flatten.map do |arg| arg.to_s end - - if self.class.rdoc_version >= Gem::Version.new('2.4.0') then diff --git a/rubygems-1.8.6-show-extension-build-process-in-sync.patch b/rubygems-1.8.6-show-extension-build-process-in-sync.patch deleted file mode 100644 index 202ffca..0000000 --- a/rubygems-1.8.6-show-extension-build-process-in-sync.patch +++ /dev/null @@ -1,97 +0,0 @@ ---- rubygems-1.8.6/lib/rubygems/ext/builder.rb.insync 2011-07-27 01:14:52.000000000 +0900 -+++ rubygems-1.8.6/lib/rubygems/ext/builder.rb 2011-07-27 01:15:01.000000000 +0900 -@@ -11,6 +11,56 @@ - $1.downcase - end - -+ def self.get_status_of_forked_command(command, results) -+ read_size = 0 -+ -+ results << command -+ read_size += command.size -+ puts "#{command}" if Gem.configuration.really_verbose -+ -+ iopipe_r, iopipe_w = IO.pipe -+ -+ child_pid = fork{ -+ # Child -+ $stdin.close -+ iopipe_r.close -+ $stdout.reopen(iopipe_w) -+ # redirect -+ $stderr.reopen(iopipe_w) -+ -+ exec "#{command}" -+ -+ puts "Executing #{command} failed." -+ exit 127 -+ } -+ -+ iopipe_w.close -+ output = "" -+ -+ if (child_pid < 0) then -+ raise Gem::InstallError, "Forking process of #{command} failed\n" -+ end -+ -+ iopipe_r.each{|line| -+ output += line -+ if Gem.configuration.really_verbose then -+ puts "#{line}" if Gem.configuration.really_verbose -+ else -+ read_size += line.size -+ while read_size >= 128 do -+ print "." -+ $stdout.flush -+ read_size -= 128 -+ end -+ end -+ } -+ results << output -+ print "\n" if not Gem.configuration.really_verbose -+ -+ child_pid, status = Process.waitpid2(child_pid) -+ return status -+ end -+ - def self.make(dest_path, results) - unless File.exist? 'Makefile' then - raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" -@@ -31,11 +81,10 @@ - - ['', ' install'].each do |target| - cmd = "#{make_program}#{target}" -- results << cmd -- results << `#{cmd} #{redirector}` -+ status = self.get_status_of_forked_command(cmd, results) - - raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless -- $?.success? -+ status.success? - end - end - -@@ -44,10 +93,8 @@ - end - - def self.run(command, results) -- results << command -- results << `#{command} #{redirector}` -- -- unless $?.success? then -+ status = self.get_status_of_forked_command(command, results) -+ unless status.success? then - raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}" - end - end ---- rubygems-1.8.6/lib/rubygems/installer.rb.insync 2011-07-27 01:14:52.000000000 +0900 -+++ rubygems-1.8.6/lib/rubygems/installer.rb 2011-07-27 01:15:01.000000000 +0900 -@@ -530,7 +530,7 @@ - Dir.chdir extension_dir do - results = builder.build(extension, gem_dir, dest_path, results) - -- say results.join("\n") if Gem.configuration.really_verbose -+ # say results.join("\n") if Gem.configuration.really_verbose - end - rescue - results = results.join "\n" diff --git a/rubygems-2.1.x-binary-extensions.patch b/rubygems-2.1.x-binary-extensions.patch deleted file mode 100644 index 11601f3..0000000 --- a/rubygems-2.1.x-binary-extensions.patch +++ /dev/null @@ -1,179 +0,0 @@ ---- rubygems-2.1.11/lib/rubygems/basic_specification.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/basic_specification.rb 2013-12-13 14:23:26.680998682 +0900 -@@ -39,11 +39,16 @@ - - def contains_requirable_file? file - root = full_gem_path -+ ext = full_gem_ext_path - suffixes = Gem.suffixes - - require_paths.any? do |lib| -- base = "#{root}/#{lib}/#{file}" -- suffixes.any? { |suf| File.file? "#{base}#{suf}" } -+ base = ["#{root}/#{lib}/#{file}"] -+ base << "#{ext}/#{lib}/#{file}" unless !ext || ext.empty? -+ -+ base.any? do |path| -+ suffixes.any? { |suf| File.file? "#{path}#{suf}" } -+ end - end - end - -@@ -52,6 +57,14 @@ - File.dirname(loaded_from) == self.class.default_specifications_dir - end - -+ ## -+ # Returns the full path to the exts directory containing this spec's -+ # gem directory. eg: /usr/local/lib/ruby/1.8/exts -+ -+ def exts_dir -+ @exts_dir ||= Gem.default_ext_dir_for(base_dir) || gems_dir -+ end -+ - def find_full_gem_path # :nodoc: - # TODO: also, shouldn't it default to full_name if it hasn't been written? - path = File.expand_path File.join(gems_dir, full_name) -@@ -61,6 +74,15 @@ - - private :find_full_gem_path - -+ def find_full_gem_ext_path # :nodoc: -+ # TODO: skip for gems without extensions. -+ path = File.expand_path File.join(exts_dir, full_name) -+ path.untaint -+ path if File.directory? path -+ end -+ -+ private :find_full_gem_ext_path -+ - ## - # The full path to the gem (install path + full name). - -@@ -71,6 +93,13 @@ - end - - ## -+ # The full path to the gem binary extension (install path + full name). -+ -+ def full_gem_ext_path -+ @full_gem_ext_path ||= find_full_gem_ext_path -+ end -+ -+ ## - # Returns the full name (name-version) of this Gem. Platform information - # is included (name-version-platform) if it is specified and not the - # default Ruby platform. -@@ -100,7 +129,9 @@ - @loaded_from = path && path.to_s - - @full_gem_path = nil -+ @full_gem_ext_path = nil - @gems_dir = nil -+ @exts_dir = nil - @base_dir = nil - end - ---- rubygems-2.1.11/lib/rubygems/commands/which_command.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/commands/which_command.rb 2014-01-10 17:06:12.279125707 +0900 -@@ -82,7 +82,13 @@ - end - - def gem_paths(spec) -- spec.require_paths.collect { |d| File.join spec.full_gem_path, d } -+ ret = [] -+ spec.require_paths.collect { |d| -+ ret << File.join(spec.full_gem_path, d) -+ } -+ ret << File.join(spec.ext_dir, spec.require_paths.first) \ -+ unless (spec.extensions.empty? || (spec.ext_dir == spec.full_gem_path)) -+ ret - end - - def usage # :nodoc: ---- rubygems-2.1.11/lib/rubygems/defaults.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/defaults.rb 2013-12-13 14:22:17.079954405 +0900 -@@ -111,6 +111,17 @@ - end - - ## -+ # Returns binary extensions dir for specified RubyGems base dir or nil -+ # if such directory cannot be determined. -+ # -+ # By default, the binary extensions are located side by side with their -+ # Ruby counterparts, therefore nil is returned -+ -+ def self.default_ext_dir_for base_dir -+ nil -+ end -+ -+ ## - # A wrapper around RUBY_ENGINE const that may not be defined - - def self.ruby_engine ---- rubygems-2.1.11/lib/rubygems/ext/builder.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/ext/builder.rb 2013-12-13 14:22:17.079954405 +0900 -@@ -170,7 +170,7 @@ - say "This could take a while..." - end - -- dest_path = File.join @gem_dir, @spec.require_paths.first -+ dest_path = File.join(@only_install_dir ? @gem_dir : @spec.ext_dir, @spec.require_paths.first) - - @ran_rake = false # only run rake once - -@@ -181,5 +181,9 @@ - end - end - -+ def only_install_dir= only_install_dir -+ @only_install_dir = only_install_dir -+ end -+ - end - ---- rubygems-2.1.11/lib/rubygems/installer.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/installer.rb 2013-12-13 14:22:17.080954520 +0900 -@@ -663,6 +663,7 @@ - - def build_extensions - builder = Gem::Ext::Builder.new spec, @build_args -+ builder.only_install_dir = @only_install_dir - - builder.build_extensions - end ---- rubygems-2.1.11/lib/rubygems/specification.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/specification.rb 2013-12-13 14:22:17.080954520 +0900 -@@ -1328,6 +1328,8 @@ - File.join full_gem_path, path - end - -+ paths << File.join(ext_dir, require_paths.first) unless extensions.empty? || (ext_dir == full_gem_path) -+ - # gem directories must come after -I and ENV['RUBYLIB'] - insert_index = Gem.load_path_insert_index - -@@ -1617,6 +1619,13 @@ - @executables = Array(value) - end - -+ # Returns the full path to this spec's ext directory. -+ # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0 -+ -+ def ext_dir -+ @ext_dir ||= File.expand_path File.join(exts_dir, full_name) -+ end -+ - ## - # Sets extensions to +extensions+, ensuring it is an array. Don't - # use this, push onto the array instead. ---- rubygems-2.1.11/lib/rubygems/uninstaller.rb.binext 2013-11-13 08:24:55.000000000 +0900 -+++ rubygems-2.1.11/lib/rubygems/uninstaller.rb 2013-12-13 14:22:17.081954636 +0900 -@@ -247,6 +247,7 @@ - File.writable?(spec.base_dir) - - FileUtils.rm_rf spec.full_gem_path -+ FileUtils.rm_rf spec.ext_dir - - # TODO: should this be moved to spec?... I vote eww (also exists in docmgr) - old_platform_name = [spec.name, diff --git a/rubygems.attr b/rubygems.attr new file mode 100644 index 0000000..f711775 --- /dev/null +++ b/rubygems.attr @@ -0,0 +1,3 @@ +%__rubygems_requires %{_rpmconfigdir}/rubygems.req +%__rubygems_provides %{_rpmconfigdir}/rubygems.prov +%__rubygems_path ^%{gem_spec}$ diff --git a/rubygems.prov b/rubygems.prov new file mode 100644 index 0000000..b7c9777 --- /dev/null +++ b/rubygems.prov @@ -0,0 +1,36 @@ +#!/usr/bin/ruby + +require 'rubygems/package' + +module RubyGemsProv + module Helpers + # If there is some prelease version files, such as rc1 (i.e. non-numeric + # field), prepend this field by tilde instead of dot. + def self.normalize_prerelease(version) + if version.prerelease? + prerelease = version.version.sub /^#{version.release}\./, '' + "#{version.release}-0.1.#{prerelease}" + else + "#{version.release}-1" + end + end + end + + # Reports all functionality gem provides. + def self.provides + while filename = gets + filename.strip! + begin + specification = Gem::Specification.load filename + + puts "rubygem(#{specification.name}) = #{Helpers::normalize_prerelease(specification.version)}" + rescue => e + # Ignore all errors. + end + end + end +end + +if __FILE__ == $0 + RubyGemsProv::provides +end diff --git a/rubygems.req b/rubygems.req new file mode 100644 index 0000000..4f7a583 --- /dev/null +++ b/rubygems.req @@ -0,0 +1,81 @@ +#!/usr/bin/ruby + +require 'rubygems/package' + +module RubyGemsReq + module Helpers + # Expands '~>' and '!=' gem requirements. + def self.expand_requirement(requirements) + requirements.inject([]) do |output, r| + output.concat case r.first + when '~>' + expand_pessimistic_requirement(r) + when '!=' + expand_not_equal_requirement(r) + else + [r] + end + end + end + + # Expands the pessimistic version operator '~>' into equivalent '>=' and + # '<' pair. + def self.expand_pessimistic_requirement(requirement) + next_version = Gem::Version.create(requirement.last).bump + 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) + self.expand_requirement(requirement.requirements).map do |op, version| + version == Gem::Version.new(0) ? "" : "#{op} #{version}" + end + end + end + + # Report RubyGems dependency, versioned if required. + 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 + puts dependency_string + end + end + + # 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 + end + end + end + + # Reports all requirements specified by all provided .gemspec files. + def self.requires + while filename = gets + filename.strip! + begin + specification = Gem::Specification.load filename + + rubygems_dependency(specification) + gem_depenencies(specification) + rescue => e + # Ignore all errors. + end + end + end +end + +if __FILE__ == $0 + RubyGemsReq::requires +end diff --git a/rubygems.spec b/rubygems.spec index 6c83bf8..a56a656 100644 --- a/rubygems.spec +++ b/rubygems.spec @@ -4,7 +4,7 @@ # 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 +%global rubygems_dir %(ruby -e "puts RbConfig::CONFIG['rubygemsdir']") # Specify custom RubyGems root and other related macros. %global gem_dir %{_datadir}/gems @@ -24,58 +24,51 @@ Summary: The Ruby standard for packaging ruby libraries Name: rubygems -Version: 2.1.11 -Release: 115%{?dist} +Version: 2.2.2 +Release: 100%{?dist} Group: Development/Libraries License: Ruby or MIT URL: https://rubygems.org/ Source0: http://production.cf.rubygems.org/rubygems/%{name}-%{version}.tgz +# Sources from the works by Vít Ondruch +# Please keep Source{1,5,8,9,10} in sync with ruby.spec +Source1: operating_system.rb +Source5: macros.rubygems +# RPM dependency generators. +Source8: rubygems.attr +Source9: rubygems.req +Source10: rubygems.prov # http://seclists.org/oss-sec/2013/q3/att-576/check_CVE-2013-4287_rb.bin # Slightly modified for exit status -Source10: check_CVE-2013-4287.rb +Source11: check_CVE-2013-4287.rb # http://seclists.org/oss-sec/2013/q3/att-621/check_CVE-2013-XXXX_rb.bin # Slightly modified for exit status, # Also modified to match: # http://seclists.org/oss-sec/2013/q3/605 -Source11: check_CVE-2013-4363.rb - -# Sources from the works by Vít Ondruch -# Please keep Source100 and Patch{109,113,114} in sync with ruby.spec - -Source100: operating_system.rb +Source12: check_CVE-2013-4363.rb -# Will discuss upstream -# https://github.com/rubygems/rubygems/issues/120 -# rubygems-Patches-28631 -#Patch1: rubygems-1.8.6-show-extension-build-process-in-sync.patch -# rubygems-Patches-29049 -# https://github.com/rubygems/rubygems/issues/118 -#Patch3: rubygems-1.8.5-show-rdoc-process-verbosely.patch -# Fix Gem.all_load_paths (although it is deprecated and will be removed -# on 2011-10-01) +# %%load function should be supported in RPM 4.12+. +# http://lists.rpm.org/pipermail/rpm-maint/2014-February/003659.html +Source100: load.inc +%include %{SOURCE100} -# Add support for installing binary extensions according to FHS. -# https://github.com/rubygems/rubygems/issues/210 -Patch109: rubygems-2.1.x-binary-extensions.patch +%{load %{SOURCE5}} Requires: ruby(release) Requires: rubygem(rdoc) >= 4.0.0 Requires: rubygem(io-console) >= 0.4.1 Requires: rubygem(psych) >= 2.0.0 -Requires: ca-certificates -BuildRequires: ruby(release) = 2.0.0 +BuildRequires: ruby(release) %if %{enable_check} # For mkmf.rb BuildRequires: ruby-devel -BuildRequires: rubygem(minitest) +BuildRequires: rubygem(minitest) < 5 BuildRequires: rubygem(rake) BuildRequires: rubygem(rdoc) >= 4.0.0 BuildRequires: rubygem(io-console) >= 0.4.1 BuildRequires: rubygem(psych) >= 2.0.0 %endif -# Unbundle cert.pem -BuildRequires: ca-certificates # TestGemExtCmakeBuilder BuildRequires: cmake BuildArch: noarch @@ -90,7 +83,7 @@ libraries. Summary: Macros and development tools for packagin RubyGems Group: Development/Libraries License: Ruby or MIT -Requires: %{name} = %{version}-%{release} +Requires: ruby(%{name}) = %{version}-%{release} BuildArch: noarch %description devel @@ -100,7 +93,7 @@ Macros and development tools for packagin RubyGems. Summary: Documentation for %{name} Group: Development/Libraries License: Ruby or MIT -Requires: %{name} = %{version}-%{release} +Requires: ruby(%{name}) = %{version}-%{release} BuildArch: noarch %description doc @@ -108,13 +101,6 @@ Documentation for %{name} %prep %setup -q -#%%patch0 -p1 -b .noarch -%if 1 -#%%patch1 -p1 -b .insync -#%%patch3 -p1 -b .rdoc_v -#%%patch6 -p1 -b .load_path -%endif -%patch109 -p1 -b .binext # Some of the library files start with #! which rpmlint doesn't like # and doesn't make much sense @@ -146,55 +132,36 @@ mv %{buildroot}/%{rubygems_dir}/lib/* %{buildroot}/%{rubygems_dir}/. # No longer needed rmdir %{buildroot}%{rubygems_dir}/lib +# Kill bundled certificates, as they should be part of ca-certificates. +for cert in \ + Class3PublicPrimaryCertificationAuthority.pem \ + DigiCertHighAssuranceEVRootCA.pem \ + EntrustnetSecureServerCertificationAuthority.pem \ + GeoTrustGlobalCA.pem +do + rm %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/$cert +done + +# Move macros file into proper place and replace the %%{name} macro, since it +# would be wrongly evaluated during build of other packages. +mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d +install -m 644 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/macros.d/macros.rubygems +sed -i "s/%%{name}/ruby/" %{buildroot}%{_rpmconfigdir}/macros.d/macros.rubygems + +# Install dependency generators. +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 custom operating_system.rb. mkdir -p %{buildroot}%{rubygems_dir}/rubygems/defaults -install -cpm 0644 %{SOURCE100} %{buildroot}%{rubygems_dir}/rubygems/defaults/ - -%if 0 -# Kill bundled cert.pem -mkdir -p %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/ -ln -sf %{_sysconfdir}/pki/tls/cert.pem \ - %{buildroot}%{rubygems_dir}/rubygems/ssl_certs/ca-bundle.pem -%endif +install -cpm 0644 %{SOURCE1} %{buildroot}%{rubygems_dir}/rubygems/defaults/ # Create gem folders. -mkdir -p %{buildroot}%{gem_dir}/{cache,gems,specifications,doc} +mkdir -p %{buildroot}%{gem_dir}/{cache,gems,specifications,extensions,doc} mkdir -p %{buildroot}%{gem_extdir}/ruby -# Create macros.rubygems file for rubygems-devel -mkdir -p %{buildroot}%{_sysconfdir}/rpm - -cat >> %{buildroot}%{_sysconfdir}/rpm/macros.rubygems << \EOF -# The RubyGems root folder. -%%gem_dir %{gem_dir} - -# Common gem locations and files. -%%gem_instdir %%{gem_dir}/gems/%%{gem_name}-%%{version} -%%gem_extdir_mri %%{_libdir}/gems/ruby/%%{gem_name}-%%{version} -%%gem_libdir %%{gem_instdir}/lib -%%gem_cache %%{gem_dir}/cache/%%{gem_name}-%%{version}.gem -%%gem_spec %%{gem_dir}/specifications/%%{gem_name}-%%{version}.gemspec -%%gem_docdir %%{gem_dir}/doc/%%{gem_name}-%%{version} - -# Install gem into appropriate directory. -# -n Overrides gem file name for installation. -# -d Set installation directory. -%%gem_install(d:n:) \ -mkdir -p %%{-d*}%%{!?-d:.%%{gem_dir}} \ -\ -CONFIGURE_ARGS="--with-cflags='%%{optflags}' $CONFIGURE_ARGS" \\\ -gem install \\\ - -V \\\ - --local \\\ - --install-dir %%{-d*}%%{!?-d:.%%{gem_dir}} \\\ - --bindir .%%{_bindir} \\\ - --force \\\ - --document=ri,rdoc \\\ - --backtrace \\\ - %%{-n*}%%{!?-n:%%{gem_name}-%%{version}.gem} \ -%%{nil} -EOF - # Create below mkdir -p %{buildroot}%{gem_dir}/specifications/default @@ -215,22 +182,18 @@ for module in \ do for dir in \ %{gem_dir}/gems/$module-*/lib \ - %{buildtime_libdir}/gems/ruby/$module-*/lib + %{buildtime_libdir}/gems/ruby/$module-* do RUBYOPT="$RUBYOPT -I$dir" done done export RUBYOPT -# 1) Failure: -#TestGemExtBuilder#test_build_extensions_extconf_bad [/home/mtasaka/rpmbuild/fedora-SCM/rubygems/master/rubygems-2.1.9/test/rubygems/test_gem_ext_builder.rb:94]: -#Expected /\/usr\/bin\/ruby: No such file/ to match "/usr/bin/ruby extconf.rb \n/usr/bin/ruby-mri: No such file or directory -- extconf.rb (LoadError)\n". - -testrb test || testrb test -x test_gem_ext_builder.rb +testrb test # CVE vulnerability check -ruby -Ilib %{SOURCE10} ruby -Ilib %{SOURCE11} +ruby -Ilib %{SOURCE12} %endif %files @@ -238,10 +201,13 @@ ruby -Ilib %{SOURCE11} %doc History.txt %doc MIT.txt LICENSE.txt %doc CVE-*txt +# TODO: Ruby's rubygems subpackage owns whole gem_dir. We should probably +# align the owhership either here or there. %dir %{gem_dir} %dir %{gem_dir}/build_info %dir %{gem_dir}/cache %dir %{gem_dir}/doc +%dir %{gem_dir}/extensions %dir %{gem_dir}/gems %dir %{gem_dir}/specifications %dir %{gem_dir}/specifications/default @@ -261,13 +227,19 @@ ruby -Ilib %{SOURCE11} %dir %{_exec_prefix}/lib64/gems/ruby %files devel -%{_sysconfdir}/rpm/macros.rubygems +%{_rpmconfigdir}/macros.d/macros.rubygems +%{_rpmconfigdir}/fileattrs/rubygems.attr +%{_rpmconfigdir}/rubygems.req +%{_rpmconfigdir}/rubygems.prov %files doc %doc %{gem_dir}/doc/* %changelog +* Wed May 07 2014 Vít Ondruch - 2.2.2-100 +- Update to RubyGems 2.2.2. + * Fri Jan 10 2014 Mamoru TASAKA - 2.1.11-115 - Add extension directory also to WhichCommand::gem_paths (bug 1051169) @@ -383,7 +355,7 @@ ruby -Ilib %{SOURCE11} - 1.8.23 - Use system-wide cert.pem -* Thu Apr 18 2012 Mamoru Tasaka - 1.8.22-1 +* Wed Apr 18 2012 Mamoru Tasaka - 1.8.22-1 - 1.8.22 * Thu Jan 26 2012 Vít Ondruch - 1.8.15-2 @@ -399,7 +371,7 @@ ruby -Ilib %{SOURCE11} * Sat Jan 14 2012 Fedora Release Engineering - 1.8.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild -* Mon Nov 11 2011 Mamoru Tasaka - 1.8.11-1 +* Tue Nov 22 2011 Mamoru Tasaka - 1.8.11-1 - 1.8.11 * Sun Aug 28 2011 Mamoru Tasaka - 1.8.10-1 diff --git a/sources b/sources index 81d49b9..f00a636 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b561b7aaa70d387e230688066e46e448 rubygems-2.1.11.tgz +f297a3fa7b1f3b693a11183a31668b9b rubygems-2.2.2.tgz