%__gem_helper %{_usrlibrpm}/gem_helper.rb
-diff -urN rpm-5.4.9/scripts/gem_helper.rb rpm-5.4.9-patched/scripts/gem_helper.rb
---- rpm-5.4.9/scripts/gem_helper.rb 2010-10-16 20:58:48.000000000 +1100
-+++ rpm-5.4.9-patched/scripts/gem_helper.rb 2012-08-30 18:12:11.233007114 +1100
-@@ -57,10 +57,13 @@
- argv.delete_at(0)
- end
-
-- file_data = Zlib::GzipReader.open("metadata.gz")
-+ file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
- header = YAML::load(file_data)
-- file_data.close()
-- body = header.instance_variable_get :@ivars
-+ body = {}
-+ # I don't know any better.. :/
-+ header.instance_variables.each do |iv|
-+ body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
-+ end
-
- require 'rubygems'
- spec = Gem::Specification.from_yaml(YAML.dump(header))
-diff -urN rpm-5.4.9/scripts/rubygems.rb rpm-5.4.9-patched/scripts/rubygems.rb
---- rpm-5.4.9/scripts/rubygems.rb 2011-04-01 18:30:28.000000000 +1100
-+++ rpm-5.4.9-patched/scripts/rubygems.rb 2012-08-30 18:09:09.771009037 +1100
-@@ -30,7 +30,7 @@
- exit(1)
- end
-
--specpatt = Config::CONFIG["rubylibdir"].sub(Config::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
-+specpatt = RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
- gems = []
- ruby_versioned = false
- abi_provide = false
-@@ -44,17 +44,17 @@
- # package is dependent on this specific version.
- # FIXME: only supports current ruby version
- elsif not ruby_versioned
-- if path.match(Config::CONFIG["rubylibdir"])
-+ if path.match(RbConfig::CONFIG["rubylibdir"])
- ruby_versioned = true
- # even more fugly, but we make the assumption that if the package has
- # this file, the package is the current ruby version, and should
- # therefore provide ruby(abi) = version
-- if provides and path.match(Config::CONFIG["rubylibdir"] + "/Env.rb")
-+ if provides and path.match(RbConfig::CONFIG["rubylibdir"] + "/Env.rb")
- abi_provide = true
- end
-- elsif path.match(Config::CONFIG["sitelibdir"])
-+ elsif path.match(RbConfig::CONFIG["sitelibdir"])
- ruby_versioned = true
-- elsif path.match(Config::CONFIG["vendorlibdir"])
-+ elsif path.match(RbConfig::CONFIG["vendorlibdir"])
- ruby_versioned = true
- end
- end
-@@ -63,7 +63,7 @@
- if requires or abi_provide
- print "ruby(abi)"
- if ruby_versioned
-- print " = %s\n" % Config::CONFIG["ruby_version"]
-+ print " = %s\n" % RbConfig::CONFIG["ruby_version"]
- end
- end
-
-@@ -105,7 +105,7 @@
- end
- if requires
- for d in spec.dependencies
-- print d.requirement.to_rpm(d.name) unless d.type != :runtime
-+ print d.requirement.to_rpm(d.name)[0] unless d.type != :runtime
- end
- for d in spec.required_rubygems_version.to_rpm("rubygems")
- print d.gsub(/(rubygem\()|(\))/, "")