fpm 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fpm/builder.rb +2 -1
- data/lib/fpm/package.rb +15 -9
- data/templates/deb.erb +1 -1
- data/templates/rpm.erb +1 -1
- metadata +3 -3
data/lib/fpm/builder.rb
CHANGED
@@ -54,7 +54,8 @@ class FPM::Builder
|
|
54
54
|
|
55
55
|
# Assemble the package
|
56
56
|
def assemble!
|
57
|
-
|
57
|
+
version_a = [ @source[:version], @package.iteration ].compact
|
58
|
+
output.gsub!(/VERSION/, version_a.join('-'))
|
58
59
|
output.gsub!(/ARCH/, @package.architecture)
|
59
60
|
|
60
61
|
File.delete(output) if File.exists?(output) && !File.directory?(output)
|
data/lib/fpm/package.rb
CHANGED
@@ -48,30 +48,32 @@ class FPM::Package
|
|
48
48
|
@version = source[:version] # || fail
|
49
49
|
|
50
50
|
@dependencies = source[:dependencies] || []
|
51
|
-
|
51
|
+
# Iteration can be nil. If nil, the fpm package implementation is expected
|
52
|
+
# to handle any default value that should be instead.
|
53
|
+
@iteration = source[:iteration]
|
52
54
|
@url = source[:url] || "http://nourlgiven.example.com/no/url/given"
|
53
55
|
@category = source[:category] || "default"
|
54
56
|
@license = source[:license] || "unknown"
|
55
57
|
@maintainer = source[:maintainer] || "<#{ENV["USER"]}@#{Socket.gethostname}>"
|
56
58
|
@architecture = source[:architecture] || %x{uname -m}.chomp
|
57
59
|
@summary = source[:summary] || "no summary given"
|
58
|
-
end
|
60
|
+
end # def initialize
|
59
61
|
|
60
62
|
def generate_specfile(builddir, paths)
|
61
63
|
spec = template.result(binding)
|
62
64
|
File.open(specfile(builddir), "w") { |f| f.puts spec }
|
63
|
-
end
|
65
|
+
end # def generate_specfile
|
64
66
|
|
65
67
|
def generate_md5sums(builddir, paths)
|
66
68
|
md5sums = self.checksum(paths)
|
67
69
|
File.open("#{builddir}/md5sums", "w") { |f| f.puts md5sums }
|
68
70
|
md5sums
|
69
|
-
end
|
71
|
+
end # def generate_md5sums
|
70
72
|
|
71
73
|
# TODO [Jay]: make this better...?
|
72
74
|
def type
|
73
75
|
self.class.name.split(':').last.downcase
|
74
|
-
end
|
76
|
+
end # def type
|
75
77
|
|
76
78
|
def template
|
77
79
|
@template ||= begin
|
@@ -80,13 +82,17 @@ class FPM::Package
|
|
80
82
|
)
|
81
83
|
ERB.new(tpl, nil, "<>")
|
82
84
|
end
|
83
|
-
end
|
85
|
+
end # def template
|
84
86
|
|
85
87
|
def render_spec
|
86
88
|
template.result(binding)
|
87
|
-
end
|
89
|
+
end # def render_spec
|
88
90
|
|
89
91
|
def default_output
|
90
|
-
|
91
|
-
|
92
|
+
if iteration
|
93
|
+
"#{name}-#{version}-#{iteration}.#{architecture}.#{type}"
|
94
|
+
else
|
95
|
+
"#{name}-#{version}.#{architecture}.#{type}"
|
96
|
+
end
|
97
|
+
end # def default_output
|
92
98
|
end
|
data/templates/deb.erb
CHANGED
data/templates/rpm.erb
CHANGED
metadata
CHANGED