Skip to content

Commit 858d1c1

Browse files
authored
Merge pull request #2066 from kduret/fix-rpm-perl-dependency-name
fix(rpm): replace perl dependency by perl-interpreter
2 parents 98cc060 + e790380 commit 858d1c1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/fpm/package/rpm.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,19 @@ def changelog
295295

296296
# See FPM::Package#converted_from
297297
def converted_from(origin)
298-
if origin == FPM::Package::Gem
298+
if origin == FPM::Package::CPAN
299+
fixed_deps = []
300+
self.dependencies.collect do |dep|
301+
# RPM package "perl" is a metapackage which install all the Perl bits and core modules, then gcc...
302+
# this must be replaced by perl-interpreter
303+
if name=/^perl([\s<>=].*)$/.match(dep)
304+
fixed_deps.push("perl-interpreter#{name[1]}")
305+
else
306+
fixed_deps.push(dep)
307+
end
308+
end
309+
self.dependencies = fixed_deps
310+
elsif origin == FPM::Package::Gem
299311
fixed_deps = []
300312
self.dependencies.collect do |dep|
301313
# Gem dependency operator "~>" is not compatible with rpm. Translate any found.

0 commit comments

Comments
 (0)