1
0
mirror of https://github.com/jordansissel/fpm synced 2025-09-04 08:54:39 +02:00
fpm/templates/deb.erb

36 lines
1.0 KiB
Plaintext

Package: <%= name %>
Version: <%= version %>-<%= iteration %>
Architecture: <%= architecture %>
Maintainer: <%= maintainer or "<unknown>" %>
<% if dependencies.size > 0 %>
<%
properdeps = dependencies.collect do |d|
# Convert strings 'foo >= bar' to 'foo (>= bar)'
if d =~ /\(/
# nothing
else
da = d.split(/ +/)
d = "#{da[0]} (#{da[1]} #{da[2]})"
end
# Convert gem ~> X.Y.Z to '>= X.Y.Z' and << X.Y+1.0
if d =~ /\(~>/
name, version = d.gsub(/[()~>]/, "").split(/ +/)[0..1]
nextversion = version.split(".").collect { |v| v.to_i }
nextversion[1] += 1
nextversion[2] = 0
nextversion = nextversion.join(".")
["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
else
d
end
end
%>Depends: <%= properdeps.flatten.join(", ") %>
<% end %>
Standards-Version: 3.9.1
Section: <%= category or "unknown" %>
Priority: extra
Homepage: <%= url or "http://nourlgiven.example.com/" %>
Description: <%= summary or "no summary given" %>
<%= summary or "no description given"%>