fpm 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELIST +9 -1
- data/CONTRIBUTORS +1 -1
- data/lib/fpm/command.rb +0 -3
- data/lib/fpm/monkeypatches.rb +11 -0
- data/lib/fpm/package.rb +8 -3
- data/lib/fpm/package/deb.rb +2 -0
- data/lib/fpm/package/dir.rb +1 -1
- data/lib/fpm/package/gem.rb +4 -1
- data/lib/fpm/package/pyfpm/__init__.pyc +0 -0
- data/lib/fpm/package/pyfpm/get_metadata.pyc +0 -0
- data/lib/fpm/package/rpm.rb +1 -0
- data/lib/fpm/package/tar.rb +10 -0
- metadata +135 -127
data/CHANGELIST
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1 (March 19, 2012)
|
2
|
+
- Fix fpm so it works in ruby 1.8 again.
|
3
|
+
Tests run, and passing:
|
4
|
+
rvm 1.8.7,1.9.2,1.9.3 do bundle exec rspec
|
5
|
+
|
6
|
+
0.4.0 (March 18, 2012)
|
2
7
|
- Complete rewrite of pretty much everything.
|
3
8
|
* Otherwise, the 'fpm' command functionality should be the same
|
4
9
|
* Please let me know if something broke!
|
5
10
|
- Now has an API (see examples/api directory)
|
6
11
|
- Also has a proper test suite
|
12
|
+
- Updated the rpm spec generator to disable all the ways I've found rpmbuild
|
13
|
+
to molest packages. This means that fpm-generated rpms will no longer
|
14
|
+
strip libraries, move files around, randomly mutate jar files, etc.
|
7
15
|
- Add --license and --vendor settings (via Pieter Loubser)
|
8
16
|
- python support: try to name python packages sanely. Some pypi packages
|
9
17
|
are literally called 'python-foo' so make sure we generate packages named
|
data/CONTRIBUTORS
CHANGED
data/lib/fpm/command.rb
CHANGED
@@ -150,9 +150,6 @@ class FPM::Command < Clamp::Command
|
|
150
150
|
" and directories you want to include in the package. For others, like " \
|
151
151
|
"'gem', it specifies the packages to download and use as the gem input",
|
152
152
|
:attribute_name => :args
|
153
|
-
def settings
|
154
|
-
@settings ||= {}
|
155
|
-
end
|
156
153
|
|
157
154
|
FPM::Package.types.each do |name, klass|
|
158
155
|
klass.apply_options(self)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Copied from https://raw.github.com/marcandre/backports/master/lib/backports/1.9.3/io.rb
|
2
|
+
# Also Hacked just to make it work
|
3
|
+
# This is necessary until a newer version of backports (> 2.3.0) is available
|
4
|
+
class << IO
|
5
|
+
# Standard in Ruby 1.9.3 See official documentation[http://ruby-doc.org/core-1.9.3/IO.html#method-c-write]
|
6
|
+
def write(name, string, offset = nil, options = Backports::Undefined)
|
7
|
+
File.open(name, "w") do |fd|
|
8
|
+
fd.write(string)
|
9
|
+
end
|
10
|
+
end unless method_defined? :write
|
11
|
+
end
|
data/lib/fpm/package.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "fpm/namespace" # local
|
2
2
|
require "fpm/util" # local
|
3
3
|
require "tmpdir" # stdlib
|
4
|
+
require "backports" # gem 'backports'
|
4
5
|
require "socket" # stdlib, for Socket.gethostname
|
5
6
|
require "shellwords" # stdlib, for Shellwords.escape
|
6
7
|
require "cabin" # gem "cabin"
|
@@ -16,6 +17,7 @@ class FPM::Package
|
|
16
17
|
|
17
18
|
# This class is raised when a file already exists when trying to write.
|
18
19
|
class FileAlreadyExists < StandardError
|
20
|
+
# Get a human-readable error message
|
19
21
|
def to_s
|
20
22
|
return "File already exists, refusing to continue: #{super}"
|
21
23
|
end # def to_s
|
@@ -221,7 +223,7 @@ class FPM::Package
|
|
221
223
|
end # def output
|
222
224
|
|
223
225
|
def staging_path(path=nil)
|
224
|
-
@staging_path ||= ::Dir.mktmpdir(
|
226
|
+
@staging_path ||= ::Dir.mktmpdir("package-#{type}-staging", ::Dir.pwd)
|
225
227
|
|
226
228
|
if path.nil?
|
227
229
|
return @staging_path
|
@@ -231,7 +233,7 @@ class FPM::Package
|
|
231
233
|
end # def staging_path
|
232
234
|
|
233
235
|
def build_path(path=nil)
|
234
|
-
@build_path ||= ::Dir.mktmpdir(
|
236
|
+
@build_path ||= ::Dir.mktmpdir("package-#{type}-build", ::Dir.pwd)
|
235
237
|
|
236
238
|
if path.nil?
|
237
239
|
return @build_path
|
@@ -268,7 +270,10 @@ class FPM::Package
|
|
268
270
|
# Find will print the path you're searching first, so skip it and return
|
269
271
|
# the rest. Also trim the leading path such that '#{staging_path}/' is removed
|
270
272
|
# from the path before returning.
|
271
|
-
|
273
|
+
#
|
274
|
+
# Wrapping Find.find in an Enumerator is required for sane operation in ruby 1.8.7,
|
275
|
+
# but requires the 'backports' gem (which is used in other places in fpm)
|
276
|
+
return Enumerator.new { |y| Find.find(staging_path) { |path| y << path } } \
|
272
277
|
.select { |path| path != staging_path } \
|
273
278
|
.collect { |path| path[staging_path.length + 1.. -1] }
|
274
279
|
end # def files
|
data/lib/fpm/package/deb.rb
CHANGED
data/lib/fpm/package/dir.rb
CHANGED
@@ -74,7 +74,7 @@ class FPM::Package::Dir < FPM::Package
|
|
74
74
|
def clone(source, destination)
|
75
75
|
# Copy all files from 'path' into staging_path
|
76
76
|
|
77
|
-
Find.find(source)
|
77
|
+
Find.find(source) do |file|
|
78
78
|
next if source == file && File.directory?(file) # ignore the directory itself
|
79
79
|
target = File.join(destination, file)
|
80
80
|
copy(file, target)
|
data/lib/fpm/package/gem.rb
CHANGED
@@ -128,7 +128,10 @@ class FPM::Package::Gem < FPM::Package
|
|
128
128
|
self.description = description_options.find { |d| !(d.nil? or d.strip.empty?) }
|
129
129
|
|
130
130
|
# Upstream rpms seem to do this, might as well share.
|
131
|
-
|
131
|
+
# TODO(sissel): Figure out how to hint this only to rpm?
|
132
|
+
# maybe something like attributes[:rpm_provides] for rpm specific stuff?
|
133
|
+
# Or just ignore it all together.
|
134
|
+
#self.provides << "rubygem(#{self.name})"
|
132
135
|
|
133
136
|
# By default, we'll usually automatically provide this, but in the case that we are
|
134
137
|
# composing multiple packages, it's best to explicitly include it in the provides list.
|
Binary file
|
Binary file
|
data/lib/fpm/package/rpm.rb
CHANGED
data/lib/fpm/package/tar.rb
CHANGED
@@ -4,7 +4,12 @@ require "fpm/util"
|
|
4
4
|
require "fileutils"
|
5
5
|
require "fpm/package/dir"
|
6
6
|
|
7
|
+
# Use a tarball as a package.
|
8
|
+
#
|
9
|
+
# This provides no metadata. Both input and output are supported.
|
7
10
|
class FPM::Package::Tar < FPM::Package
|
11
|
+
|
12
|
+
# Input a tarball. Compressed tarballs should be OK.
|
8
13
|
def input(input_path)
|
9
14
|
# use part of the filename as the package name
|
10
15
|
self.name = File.basename(input_path).split(".").first
|
@@ -37,6 +42,10 @@ class FPM::Package::Tar < FPM::Package
|
|
37
42
|
dir.cleanup_build
|
38
43
|
end # def input
|
39
44
|
|
45
|
+
# Output a tarball.
|
46
|
+
#
|
47
|
+
# If the output path ends predictably (like in .tar.gz) it will try to obey
|
48
|
+
# the compression type.
|
40
49
|
def output(output_path)
|
41
50
|
# Unpack the tarball to the staging path
|
42
51
|
args = ["-cf", output_path, "-C", staging_path, "."]
|
@@ -47,6 +56,7 @@ class FPM::Package::Tar < FPM::Package
|
|
47
56
|
safesystem("tar", *args)
|
48
57
|
end # def output
|
49
58
|
|
59
|
+
# Generate the proper tar flags based on the path name.
|
50
60
|
def tar_compression_flag(path)
|
51
61
|
case path
|
52
62
|
when /\.tar\.bz2$/
|
metadata
CHANGED
@@ -1,154 +1,152 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fpm
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Jordan Sissel
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-03-19 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: json
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 0.4.3
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
38
32
|
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: cabin
|
39
36
|
prerelease: false
|
40
|
-
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
38
|
none: false
|
42
|
-
requirements:
|
39
|
+
requirements:
|
43
40
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 9
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
- 4
|
46
|
+
- 3
|
45
47
|
version: 0.4.3
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: backports
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - '='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 2.3.0
|
54
48
|
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: backports
|
55
52
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - "="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 3
|
62
|
+
- 0
|
61
63
|
version: 2.3.0
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: arr-pm
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 0.0.7
|
70
64
|
type: :runtime
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: arr-pm
|
71
68
|
prerelease: false
|
72
|
-
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
70
|
none: false
|
74
|
-
requirements:
|
71
|
+
requirements:
|
75
72
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 17
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
- 0
|
78
|
+
- 7
|
77
79
|
version: 0.0.7
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: clamp
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
80
|
type: :runtime
|
81
|
+
version_requirements: *id004
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: clamp
|
87
84
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
85
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
type: :runtime
|
95
|
+
version_requirements: *id005
|
96
|
+
- !ruby/object:Gem::Dependency
|
95
97
|
name: rush
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :development
|
103
98
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
99
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
118
108
|
type: :development
|
109
|
+
version_requirements: *id006
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rspec
|
119
112
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ~>
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: 0.0.3
|
113
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
hash: 3
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
version: "0"
|
134
122
|
type: :development
|
123
|
+
version_requirements: *id007
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: insist
|
135
126
|
prerelease: false
|
136
|
-
|
127
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
137
128
|
none: false
|
138
|
-
requirements:
|
129
|
+
requirements:
|
139
130
|
- - ~>
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
hash: 21
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
- 0
|
136
|
+
- 5
|
137
|
+
version: 0.0.5
|
138
|
+
type: :development
|
139
|
+
version_requirements: *id008
|
140
|
+
description: Convert directories, rpms, python eggs, rubygems, and more to rpms, debs, solaris packages and more. Win at package management without wasting pointless hours debugging bad rpm specs!
|
145
141
|
email: jls@semicomplete.com
|
146
|
-
executables:
|
142
|
+
executables:
|
147
143
|
- fpm
|
148
144
|
- fpm-npm
|
149
145
|
extensions: []
|
146
|
+
|
150
147
|
extra_rdoc_files: []
|
151
|
-
|
148
|
+
|
149
|
+
files:
|
152
150
|
- lib/fpm/errors.rb
|
153
151
|
- lib/fpm/util.rb
|
154
152
|
- lib/fpm/command.rb
|
@@ -166,6 +164,7 @@ files:
|
|
166
164
|
- lib/fpm/package/dir.rb
|
167
165
|
- lib/fpm/package/puppet.rb
|
168
166
|
- lib/fpm/package/solaris.rb
|
167
|
+
- lib/fpm/monkeypatches.rb
|
169
168
|
- lib/fpm/package.rb
|
170
169
|
- lib/fpm/namespace.rb
|
171
170
|
- lib/fpm.rb
|
@@ -181,28 +180,37 @@ files:
|
|
181
180
|
- CHANGELIST
|
182
181
|
homepage: https://github.com/jordansissel/fpm
|
183
182
|
licenses: []
|
183
|
+
|
184
184
|
post_install_message:
|
185
185
|
rdoc_options: []
|
186
|
-
|
186
|
+
|
187
|
+
require_paths:
|
187
188
|
- lib
|
188
189
|
- lib
|
189
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
190
191
|
none: false
|
191
|
-
requirements:
|
192
|
-
- -
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
|
195
|
-
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
hash: 3
|
196
|
+
segments:
|
197
|
+
- 0
|
198
|
+
version: "0"
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
200
|
none: false
|
197
|
-
requirements:
|
198
|
-
- -
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
|
201
|
+
requirements:
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
hash: 3
|
205
|
+
segments:
|
206
|
+
- 0
|
207
|
+
version: "0"
|
201
208
|
requirements: []
|
209
|
+
|
202
210
|
rubyforge_project:
|
203
|
-
rubygems_version: 1.8.
|
211
|
+
rubygems_version: 1.8.19
|
204
212
|
signing_key:
|
205
213
|
specification_version: 3
|
206
214
|
summary: fpm - package building and mangling
|
207
215
|
test_files: []
|
208
|
-
|
216
|
+
|