Permalink
Browse files

Merge pull request #310 from r4um/fix_285

Add debian Recommends and Suggests
  • Loading branch information...
jordansissel committed Jan 2, 2013
2 parents f62470f + 103cde6 commit afc2daa24b7d23287c481ac7b100ac9a83a924b6
Showing with 16 additions and 0 deletions.
  1. +10 −0 lib/fpm/package/deb.rb
  2. +6 −0 templates/deb.erb
View
@@ -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
@@ -22,6 +22,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/" %>

0 comments on commit afc2daa

Please sign in to comment.