-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
deb.erb
52 lines (52 loc) · 2.33 KB
/
deb.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Package: <%= name %>
Version: <%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>
License: <%= license %>
<% if !vendor.nil? and !vendor.empty? -%>
Vendor: <%= vendor %>
<% end -%>
Architecture: <%= architecture %>
Maintainer: <%= maintainer %>
Installed-Size: <%= attributes[:deb_installed_size] %>
<% if !dependencies.empty? and !attributes[:no_depends?] -%>
Depends: <%= dependencies.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if !conflicts.empty? -%>
Conflicts: <%= conflicts.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if attributes[:deb_breaks] and !attributes[:deb_breaks].empty? -%>
Breaks: <%= attributes[:deb_breaks].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if attributes[:deb_pre_depends] and !attributes[:deb_pre_depends].empty? -%>
Pre-Depends: <%= attributes[:deb_pre_depends].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if attributes[:deb_build_depends] and !attributes[:deb_build_depends].empty? -%>
Build-Depends: <%= attributes[:deb_build_depends].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if !provides.empty? -%>
<%# Turn each provides from 'foo = 123' to simply 'foo' because Debian :\ -%>
<%# http://www.debian.org/doc/debian-policy/ch-relationships.html -%>
Provides: <%= provides.map {|p| p.split(" ").first}.join ", " %>
<% end -%>
<% if !replaces.empty? -%>
Replaces: <%= replaces.join(", ") %>
<% end -%>
<% if attributes[:deb_recommends] and !attributes[:deb_recommends].empty? -%>
Recommends: <%= attributes[:deb_recommends].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if attributes[:deb_suggests] and !attributes[:deb_suggests].empty? -%>
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/" %>
<% lines = (description or "no description given").split("\n") -%>
<% firstline, *remainder = lines -%>
Description: <%= firstline %>
<% if remainder.any? -%>
<%= remainder.collect { |l| l =~ /^ *$/ ? " ." : " #{l}" }.join("\n") %>
<% end -%>
<% if attributes[:deb_field_given?] -%>
<% attributes[:deb_field].each do |field, value| -%>
<%= field %>: <%= value %>
<% end -%>
<% end -%>