--- rpm-5.4.10/scripts/gem_helper.rb~ 2013-06-21 09:44:47.273773411 +0300 +++ rpm-5.4.10/scripts/gem_helper.rb 2013-06-21 09:45:34.619165559 +0300 @@ -6,8 +6,9 @@ #++ require 'optparse' +require 'rubygems' -if ARGV[0] == "build" or ARGV[0] == "install" +if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec" require 'yaml' require 'zlib' @@ -65,9 +66,17 @@ body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv) end - require 'rubygems' spec = Gem::Specification.from_yaml(YAML.dump(header)) + if ARGV[0] == "spec" + # Write the .gemspec specification (in Ruby) + file_name = spec.full_name.untaint + '.gemspec' + File.open(file_name, "w") do |file| + file.puts spec.to_ruby_for_cache + end + print "Wrote: %s\n" % file_name + end + if ARGV[0] == "install" system("gem %s %s.gem" % [ARGV.join(' '), spec.full_name]) if !keepcache