Skip to content

Commit

Permalink
Merge pull request #2085 from jordansissel/feature/add-rpm-old-perl-flag
Browse files Browse the repository at this point in the history
Add flag to allow using older 'perl' rpm dependency name for systems which do not have 'perl-interpreter' dependency available. (#2066)
  • Loading branch information
jordansissel authored Dec 9, 2024
2 parents e7e7449 + 862a686 commit 28fea4c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/fpm/package/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ class FPM::Package::RPM < FPM::Package
end
end

option "--old-perl-dependency-name", :flag,
"Use older 'perl' depdency name. Newer Red Hat (and derivatives) use a dependency named 'perl-interpreter'."

private

# Fix path name
Expand Down Expand Up @@ -296,17 +299,19 @@ def changelog
# See FPM::Package#converted_from
def converted_from(origin)
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)
if !attributes[:rpm_old_perl_dependency_name?]
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
end
self.dependencies = fixed_deps
elsif origin == FPM::Package::Gem
fixed_deps = []
self.dependencies.collect do |dep|
Expand Down

0 comments on commit 28fea4c

Please sign in to comment.