diff -urN rpm-5.4.9/macros/ruby.in rpm-5.4.9-patched/macros/ruby.in --- rpm-5.4.9/macros/ruby.in 2011-10-15 23:56:57.000000000 +1100 +++ rpm-5.4.9-patched/macros/ruby.in 2012-08-30 18:09:09.732009037 +1100 @@ -2,7 +2,7 @@ # To make use of these macros insert the following line into your spec file: # %{load:%{_usrlibrpm}/macros.d/ruby} -%__ruby @__RUBY@ +%__ruby /usr/bin/ruby # Path to scripts to autogenerate php package dependencies, # @@ -11,18 +11,18 @@ %__ruby_provides %{_rpmhome}/rubygems.rb --provides %__ruby_requires %{_rpmhome}/rubygems.rb --requires -%ruby_version %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["ruby_version"]') +%ruby_version %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["ruby_version"]') -%ruby_archdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["archdir"]') -%ruby_libdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["rubylibdir"]') -%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitedir"]') -%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitearchdir"]') -%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]') -%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendordir"]') -%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorarchdir"]') -%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorlibdir"]') -%ruby_gemdir %(%{__ruby} -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")') -%ruby_ridir %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])') +%ruby_archdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["archdir"]') +%ruby_libdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"]') +%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]') +%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitearchdir"]') +%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitelibdir"]') +%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendordir"]') +%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorarchdir"]') +%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorlibdir"]') +%ruby_gemdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], "gems/#{RbConfig::CONFIG["ruby_version"]}")') +%ruby_ridir %(%{__ruby} -rrbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", RbConfig::CONFIG["ruby_version"])') %__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\()|(\))/, "")