[packages/rpm] gem_helper: add action 'spec' just to write out .gemspec; always load rubygems

glen glen at pld-linux.org
Fri Jun 21 14:43:14 CEST 2013


commit b53b1f84cd22d6b2fdead018618306c4ca6dfe20
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Jun 21 09:47:34 2013 +0300

    gem_helper: add action 'spec' just to write out .gemspec; always load rubygems

 gem_helper-spec-arg.patch | 32 ++++++++++++++++++++++++++++++++
 rpm.spec                  |  5 ++++-
 2 files changed, 36 insertions(+), 1 deletion(-)
---
diff --git a/rpm.spec b/rpm.spec
index f40f0ae..852aa1a 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -43,7 +43,7 @@ Summary(ru.UTF-8):	Менеджер пакетов от RPM
 Summary(uk.UTF-8):	Менеджер пакетів від RPM
 Name:		rpm
 Version:	5.4.10
-Release:	54
+Release:	55
 License:	LGPL v2.1
 Group:		Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.10-0.20120706.src.rpm
@@ -155,6 +155,7 @@ Patch69:	rubyprov-abi-versioned.patch
 Patch70:	python-%{name}sense-missingok.patch
 Patch71:	%{name}-changelog-encoding.patch
 Patch72:	%{name}-preserve-tag-type.patch
+Patch73:	gem_helper-spec-arg.patch
 
 # Patches imported from Mandriva
 
@@ -760,6 +761,7 @@ Group:		Applications/File
 Requires:	%{name} = %{version}-%{release}
 Requires:	ruby
 Requires:	ruby-modules
+Requires:	ruby-rubygems
 
 %description rubyprov
 Ruby tools, which simplifies creation of RPM packages with Ruby
@@ -892,6 +894,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch70 -p1
 %patch71 -p1
 %patch72 -p1
+%patch73 -p1
 
 %patch1000 -p1
 %patch1001 -p1
diff --git a/gem_helper-spec-arg.patch b/gem_helper-spec-arg.patch
new file mode 100644
index 0000000..6eb29bb
--- /dev/null
+++ b/gem_helper-spec-arg.patch
@@ -0,0 +1,32 @@
+--- 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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/b53b1f84cd22d6b2fdead018618306c4ca6dfe20



More information about the pld-cvs-commit mailing list