From e7903804af11623c258ab95384c03fc7c41ebfc9 Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Fri, 6 Sep 2024 09:22:28 +0200 Subject: [PATCH] fix(rpm): replace perl dependency by perl-interpreter --- lib/fpm/package/rpm.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/fpm/package/rpm.rb b/lib/fpm/package/rpm.rb index a925256561..5e79e5c3ac 100644 --- a/lib/fpm/package/rpm.rb +++ b/lib/fpm/package/rpm.rb @@ -277,7 +277,19 @@ def iteration # See FPM::Package#converted_from def converted_from(origin) - if origin == FPM::Package::Gem + if origin == FPM::Package::CPAN + fixed_deps = [] + self.dependencies.collect do |dep| + # RPM package "perl" is a metapackage which install all the Perl bits and core modules, then gcc... + # this must be replaced by perl-interpreter + if name=/^perl([\s<>=].*)$/.match(dep) + fixed_deps.push("perl-interpreter#{name[1]}") + else + fixed_deps.push(dep) + end + end + self.dependencies = fixed_deps + elsif origin == FPM::Package::Gem fixed_deps = [] self.dependencies.collect do |dep| # Gem dependency operator "~>" is not compatible with rpm. Translate any found.