Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement rich dependencies in gem2rpm templates #10025

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions gem2rpm/default.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ BuildRequires: <%= requirement 'rubygems-devel', req %>
<% end -%>
<% unless spec.extensions.empty? -%>
<% for dep in runtime_dependencies.virtualize -%>
<% for req in dep.requirement -%>
BuildRequires: <%= requirement(dep.name, req) %>
<% end -%>
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
Comment on lines +70 to +71
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fedora-ruby/gem2rpm#124 would make this:

Suggested change
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
BuildRequires: <%= dep.to_rich_rpm %>

<% end -%>
# Compiler is required for build of gem binary extension.
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
Expand Down
19 changes: 6 additions & 13 deletions gem2rpm/foreman_plugin.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,20 @@ BuildRequires: <%= requirement "ruby#{'-devel' unless spec.extensions.empty?}",
<% for req in spec.required_rubygems_version -%>
BuildRequires: <%= requirement 'rubygems-devel', req %>
<% end -%>
<% unless spec.extensions.empty? -%>
<% if !spec.extensions.empty? || has_assets || has_webpack -%>
<% for dep in runtime_dependencies.virtualize -%>
<% for req in dep.requirement -%>
BuildRequires: <%= requirement(dep.name, req) %>
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
<% end -%>
<% end -%>
<% if spec.extensions.empty? -%>
BuildArch: noarch
<% else -%>
# Compiler is required for build of gem binary extension.
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
BuildRequires: gcc
<% end -%>
<% if spec.extensions.empty? -%>
BuildArch: noarch
<% end -%>
Provides: foreman-plugin-%{plugin_name} = %{version}
<% if has_assets || has_webpack -%>
<% for d in spec.runtime_dependencies -%>
<% for req in d.requirement -%>
BuildRequires: rubygem(<%= d.name %>)<%= " #{req}" unless req.empty? %>
<% end -%>
<% end -%>
<% end -%>
# end specfile generated dependencies
<% if has_package_json -%>

Expand Down
5 changes: 2 additions & 3 deletions gem2rpm/hammer_plugin.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ BuildRequires: <%= requirement 'rubygems-devel', req %>
<% end -%>
<% unless spec.extensions.empty? -%>
<% for dep in runtime_dependencies.virtualize -%>
<% for req in dep.requirement -%>
BuildRequires: <%= requirement(dep.name, req) %>
<% end -%>
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
<% end -%>
# Compiler is required for build of gem binary extension.
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
Expand Down
5 changes: 2 additions & 3 deletions gem2rpm/smart_proxy_plugin.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ BuildRequires: <%= requirement 'rubygems-devel', req %>
<% end -%>
<% unless spec.extensions.empty? -%>
<% for dep in runtime_dependencies.virtualize -%>
<% for req in dep.requirement -%>
BuildRequires: <%= requirement(dep.name, req) %>
<% end -%>
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
<% end -%>
# Compiler is required for build of gem binary extension.
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
Expand Down