Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add debian Recommends and Suggests #310

Merged
merged 2 commits into from

2 participants

@r4um
Collaborator
  • Fix #285 Allow adding debian Recommends and Suggests fields.
@jordansissel jordansissel merged commit afc2daa into jordansissel:master
@jordansissel
Owner

Thanks!

@r4um r4um deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2012
  1. @r4um
Commits on Dec 21, 2012
  1. @r4um
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 0 deletions.
  1. +10 −0 lib/fpm/package/deb.rb
  2. +6 −0 templates/deb.erb
View
10 lib/fpm/package/deb.rb
@@ -77,6 +77,16 @@ class FPM::Package::Deb < FPM::Package
File.expand_path(file)
end
+ option "--recommends", "PACKAGE", "Add PACKAGE to Recommends" do |pkg|
+ @recommends ||= []
+ @recommends << pkg
+ end
+
+ option "--suggests", "PACKAGE", "Add PACKAGE to Suggests" do |pkg|
+ @suggests ||= []
+ @suggests << pkg
+ end
+
def initialize(*args)
super(*args)
attributes[:deb_priority] = "extra"
View
6 templates/deb.erb
@@ -23,6 +23,12 @@ Provides: <%= provides.map {|p| p.split(" ").first}.join ", " %>
<% if !replaces.empty? -%>
Replaces: <%= replaces.join(", ") %>
<% end -%>
+<% if attributes[:deb_recommends_given?] -%>
+Recommends: <%= attributes[:deb_recommends].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
+<% end -%>
+<% if attributes[:deb_suggests_given?] -%>
+Suggests: <%= attributes[:deb_suggests].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
+<% end -%>
Section: <%= category %>
Priority: <%= attributes[:deb_priority] %>
Homepage: <%= url or "http://nourlgiven.example.com/" %>
Something went wrong with that request. Please try again.