Add some ruby-related patches from Cooker

This commit is contained in:
Andrey Bondrov 2014-06-27 14:05:29 +11:00
parent 802e3141b8
commit 853920d09d
7 changed files with 123 additions and 5 deletions

View file

@ -0,0 +1,11 @@
--- rpm-5.4.14/scripts/rubygems.rb.no_ruby_version~ 2014-03-16 11:47:35.797098586 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 11:42:57.758190869 +0100
@@ -68,7 +68,7 @@ end
if requires or abi_provide
abidep = "ruby(abi)"
- if ruby_versioned
+ if ruby_versioned and RbConfig::CONFIG["ruby_version"] != ""
abidep += " = %s" % RbConfig::CONFIG["ruby_version"]
end
print abidep + "\n"

View file

@ -0,0 +1,33 @@
--- rpm-5.4.14/scripts/gem_helper.rb.gem_spec~ 2014-03-16 06:14:50.213542916 +0100
+++ rpm-5.4.14/scripts/gem_helper.rb 2014-03-16 08:22:46.196241762 +0100
@@ -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,18 @@ if ARGV[0] == "build" or ARGV[0] == "ins
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
+ exit(0)
+ end
+
if ARGV[0] == "install"
system("gem %s %s.gem" % [ARGV.join(' '), spec.full_name])
if !keepcache

View file

@ -0,0 +1,10 @@
--- rpm-5.4.14/scripts/rubygems.rb.rubyabiver~ 2014-03-16 08:07:27.652980213 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 08:19:23.104361204 +0100
@@ -41,6 +41,7 @@ for path in $stdin.readlines
# therefore provide ruby(abi) = version
if provides and path.match(RbConfig::CONFIG["archdir"] + "/rbconfig.rb")
abi_provide = true
+ ruby_versioned = true
elsif path.match(specpatt)
ruby_versioned = true
gems.push(path.chomp)

View file

@ -0,0 +1,19 @@
--- rpm-5.4.14/scripts/rubygems.rb.rubyarchdirs~ 2014-03-16 06:14:50.373536514 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 08:07:27.652980213 +0100
@@ -51,10 +51,16 @@ for path in $stdin.readlines
elsif not ruby_versioned
if path.match(RbConfig::CONFIG["rubylibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["archdir"])
+ ruby_versioned = true
elsif path.match(RbConfig::CONFIG["sitelibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["sitearchdir"])
+ ruby_versioned = true
elsif path.match(RbConfig::CONFIG["vendorlibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["vendorarchdir"])
+ ruby_versioned = true
end
end
end

View file

@ -0,0 +1,19 @@
--- rpm-5.4.14/scripts/gem_helper.rb.rubygems2~ 2014-03-16 11:17:38.008717554 +0100
+++ rpm-5.4.14/scripts/gem_helper.rb 2014-03-16 11:17:26.239185656 +0100
@@ -7,6 +7,7 @@
require 'optparse'
require 'rubygems'
+require 'rubygems/package'
if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
require 'yaml'
@@ -177,7 +178,7 @@ if ARGV[0] == "build" or ARGV[0] == "ins
spec = Gem::Specification.from_yaml(YAML.dump(header))
unless dry_run
- Gem::Builder.new(spec).build
+ Gem::Package.build(spec)
else
files.concat(spec.files)
print "%s\n" % files.join("\n")

View file

@ -0,0 +1,13 @@
--- rpm-5.4.14/macros/ruby.in.ruby_macros~ 2014-03-16 11:29:03.201449905 +0100
+++ rpm-5.4.14/macros/ruby.in 2014-03-16 11:29:06.391322789 +0100
@@ -21,8 +21,8 @@
%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"])')
+%ruby_gemdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubygemsdir"]')
+%ruby_ridir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["ridir"])')
%__gem_helper %{_usrlibrpm}/gem_helper.rb

View file

@ -53,14 +53,14 @@
#define prereldate 20110712
%define librpmname %mklibname rpm %{libver}
%define librpmnamedevel %mklibname -d rpm
%define librpmstatic %mklibname -d -s rpm
%define librpmnamedevel %mklibname rpm -d
%define librpmstatic %mklibname rpm -d -s
Summary: The RPM package management system
Name: rpm
Epoch: 1
Version: %{libver}.%{minorver}
Release: %{?prereldate:0.%{prereldate}.}37
Release: %{?prereldate:0.%{prereldate}.}38
License: LGPLv2.1+
Group: System/Configuration/Packaging
URL: http://rpm5.org/
@ -467,6 +467,13 @@ Patch196: rpm-5.4.10-fix-64bit-tagSwab.patch
Patch198: rpm-5.4.10-enable-nofsync-for-rpm-rebuilddb.patch
Patch199: rpm-5.4.10-fix-font-dep-misidentification.patch
Patch216: rpm-5.4.14-ruby-archdirs.patch
Patch217: rpm-5.4.14-ruby-abi-versioned.patch
Patch218: rpm-5.4.14-gem_helper-spec-arg.patch
Patch219: rpm-5.4.14-rubygems2-support.patch
Patch220: rpm-5.4.14-update-ruby_gemdir-and-ruby_ridir-macros.patch
Patch221: rpm-5.4.14-fix-dependency-generation-when-ruby_version-is-empty.patch
# ROSA stuff
Patch501: rpm-5.3.12.vendor.ROSA.patch
# Restore RPM_PACKAGE_NAME export as it's still used by aot-compile-rpm
@ -659,11 +666,10 @@ Requires: python-rpm = %{EVRD}
Requires: perl-RPM = %{EVRD}
%endif
# Used by __urlgetfile to download files from external sources
Requires: wget
Requires: wget
Conflicts: rpmlint < 1.4-4
Conflicts: multiarch-utils < 1:5.3.10
Conflicts: rpm < 1:5.4.4-32
Obsoletes: rpm5-manbo-setup
%rename rpm-manbo-setup-build
%description build
@ -896,6 +902,13 @@ This package contains the RPM API documentation generated in HTML format.
%patch198 -p1 -b .rpmdbnofsync~
%patch199 -p1 -b .fontdep_sure~
%patch216 -p1 -b .rubyarchdirs~
%patch217 -p1 -b .rubyabiver~
%patch218 -p1 -b .gem_spec~
%patch219 -p1 -b .rubygems2~
%patch220 -p1 -b .ruby_macros~
%patch221 -p1 -b .no_ruby_version~
%patch501 -p1 -b .rosa_vendor~
%patch502 -p1 -b .package_name~
%patch503 -p1 -b .specspo~