]> git.pld-linux.org Git - packages/rpm.git/commitdiff
rubygems.rb: ruby-2.0 compatible packaging fixes (missing version in noarch packages) auto/th/rpm-5.4.14-4
authorElan Ruusamäe <glen@delfi.ee>
Sun, 1 Jun 2014 19:14:24 +0000 (22:14 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 1 Jun 2014 19:14:24 +0000 (22:14 +0300)
rpm.spec
rubygems.rb

index b8a7b678285ad0e3070cb1079c246b50c13d6171..a0a7463f711fde7b9d42b76cd3ff31af832bb173 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -50,7 +50,7 @@ Summary(ru.UTF-8):    Менеджер пакетов от RPM
 Summary(uk.UTF-8):     Менеджер пакетів від RPM
 Name:          rpm
 Version:       5.4.14
-Release:       3
+Release:       4
 License:       LGPL v2.1
 Group:         Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm
index f048488a810702d513db5725f82812ac5467b501..62dc71edfa5f3148021c23609cb08407bd9e2149 100755 (executable)
@@ -30,10 +30,14 @@ if rest.size != 0 or (!provides and !requires) or (provides and requires)
   exit(1)
 end
 
-specpatt = RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
+require 'rubygems'
+gem_dir = Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first
+specpatt = "#{gem_dir}/specifications/.*\.gemspec$"
 gems = []
 ruby_versioned = false
 abi_provide = false
+# as ruby_version may be empty, take version from basename of archdir
+ruby_version = RbConfig::CONFIG["ruby_version"].empty? ? File.basename(RbConfig::CONFIG["archdir"]) : RbConfig::CONFIG["ruby_version"]
 
 for path in $stdin.readlines
   # way fugly, but we make the assumption that if the package has
@@ -55,11 +59,11 @@ for path in $stdin.readlines
     elsif path.match(RbConfig::CONFIG["archdir"])
       ruby_versioned = true
     elsif path.match(RbConfig::CONFIG["sitelibdir"])
-      ruby_versioned = true
+      ruby_versioned = !RbConfig::CONFIG["ruby_version"].empty?
     elsif path.match(RbConfig::CONFIG["sitearchdir"])
       ruby_versioned = true
     elsif path.match(RbConfig::CONFIG["vendorlibdir"])
-      ruby_versioned = true
+      ruby_versioned = !RbConfig::CONFIG["ruby_version"].empty?
     elsif path.match(RbConfig::CONFIG["vendorarchdir"])
       ruby_versioned = true
     end
@@ -69,7 +73,7 @@ end
 if requires or abi_provide
   abidep = "ruby(abi)"
   if ruby_versioned
-    abidep += " = %s" % RbConfig::CONFIG["ruby_version"]
+    abidep += " = %s" % ruby_version
   end
   print abidep + "\n"
 end
This page took 0.039046 seconds and 4 git commands to generate.