Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Make gem 'provides' really provide 'rubygem-foo'

- When converting gem->rpm, turn 'rubygem-foo' provides into
  'rubygem(foo)'
  • Loading branch information...
commit 548fe68853654acedfa1c93ead89e4da008d286e 1 parent d69dd68
Jordan Sissel authored
Showing with 15 additions and 1 deletion.
  1. +1 −1  lib/fpm/package/gem.rb
  2. +14 −0 lib/fpm/package/rpm.rb
2  lib/fpm/package/gem.rb
View
@@ -135,7 +135,7 @@ def load_package_info(gem_path)
# By default, we'll usually automatically provide this, but in the case that we are
# composing multiple packages, it's best to explicitly include it in the provides list.
- self.provides << "rubygem-#{self.name}"
+ self.provides << "#{self.name}"
spec.runtime_dependencies.map do |dep|
# rubygems 1.3.5 doesn't have 'Gem::Dependency#requirement'
14 lib/fpm/package/rpm.rb
View
@@ -98,6 +98,20 @@ def converted_from(origin)
end
end
self.dependencies = fixed_deps
+
+ # Convert 'rubygem-foo' provides values to 'rubygem(foo)'
+ # since that's what most rpm packagers seem to do.
+ self.provides = self.provides.collect do |provides|
+ first, remainder = provides.split("-", 2)
+ if first == "rubygem"
+ name, remainder = remainder.split(" ", 2)
+ # yield rubygem(name)...
+ "rubygem(#{name})#{remainder ? " #{remainder}" : ""}"
+ else
+ provides
+ end
+ end
+ #self.provides << "rubygem(#{self.name})"
end
end # def converted
Please sign in to comment.
Something went wrong with that request. Please try again.