fpm 0.4.35 → 0.4.36

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELIST CHANGED
@@ -1,5 +1,11 @@
1
- 0.4.35 (May 8, 2013)
2
- - Fix dependencies listed in the gem.
1
+ 0.4.36 (May 15, 2013)
2
+ - pear: only do channel-discover if necessary (#438, patch by Hatt)
3
+ - cpan: now supports cpan modules that use Module::Build
4
+ - cpan: --no-cpan-test now skips tests for build/configure dependencies
5
+ - rpm: Add --rpm-defattrfile and --rpm-defattrdir flags (#428, patch
6
+ by phrawzty)
7
+
8
+ 0.4.35 -- was not announced
3
9
 
4
10
  0.4.34 (May 7, 2013)
5
11
  - Now supports CPAN - Perl mongers rejoice! For example:
@@ -63,7 +63,12 @@ class FPM::Package::CPAN < FPM::Package
63
63
  # Install any build/configure dependencies with cpanm.
64
64
  # We'll install to a temporary directory.
65
65
  @logger.info("Installing any build or configure dependencies")
66
- safesystem(attributes[:cpan_cpanm_bin], "-L", build_path("cpan"), moduledir)
66
+
67
+ if attributes[:cpan_test?]
68
+ safesystem(attributes[:cpan_cpanm_bin], "-L", build_path("cpan"), moduledir)
69
+ else
70
+ safesystem(attributes[:cpan_cpanm_bin], "-nL", build_path("cpan"), moduledir)
71
+ end
67
72
 
68
73
  if !attributes[:no_auto_depends?]
69
74
  if metadata.include?("requires")
@@ -99,24 +104,43 @@ class FPM::Package::CPAN < FPM::Package
99
104
 
100
105
  prefix = attributes[:prefix] || "/usr/local"
101
106
  # TODO(sissel): Set default INSTALL path?
102
- # perl -e 'use Config; print "$Config{sitelib}"'
103
- safesystem(attributes[:cpan_perl_bin],
104
- "-Mlocal::lib=#{build_path("cpan")}",
105
- "Makefile.PL",
106
- "PREFIX=#{prefix}",
107
- # Have to specify INSTALL_BASE as empty otherwise
108
- # Makefile.PL lies and claims we've set both PREFIX and
109
- # INSTALL_BASE.
110
- "INSTALL_BASE="
111
- )
112
-
113
- make = [ "make" ]
114
-
115
- safesystem(*make)
116
- safesystem(*(make + ["test"])) if attributes[:cpan_test?]
117
- safesystem(*(make + ["DESTDIR=#{staging_path}", "install"]))
107
+
108
+ # Try Makefile.PL, Build.PL
109
+ #
110
+ if File.exists?("Makefile.PL")
111
+ safesystem(attributes[:cpan_perl_bin],
112
+ "-Mlocal::lib=#{build_path("cpan")}",
113
+ "Makefile.PL",
114
+ "PREFIX=#{prefix}",
115
+ # Empty install_base to avoid local::lib being used.
116
+ "INSTALL_BASE=")
117
+ make = [ "make" ]
118
+ safesystem(*make)
119
+ safesystem(*(make + ["test"])) if attributes[:cpan_test?]
120
+ safesystem(*(make + ["DESTDIR=#{staging_path}", "install"]))
121
+ elsif File.exists?("Build.PL")
122
+ # Module::Build is in use here; different actions required.
123
+ safesystem(attributes[:cpan_perl_bin],
124
+ "-Mlocal::lib=#{build_path("cpan")}",
125
+ "Build.PL")
126
+ safesystem("./Build")
127
+
128
+ if attributes[:cpan_test?]
129
+ safesystem("./Build", "test")
130
+ end
131
+
132
+ safesystem("./Build", "install",
133
+ "--prefix", prefix, "--destdir", staging_path,
134
+ # Empty install_base to avoid local::lib being used.
135
+ "--install_base", "")
136
+ else
137
+ raise FPM::InvalidPackageConfiguration,
138
+ "I don't know how to build #{name}. No Makefile.PL nor " \
139
+ "Build.PL found"
140
+ end
118
141
  end
119
142
 
143
+
120
144
  # TODO(sissel): figure out if this perl module compiles anything
121
145
  # and set the architecture appropriately.
122
146
  self.architecture = "all"
@@ -56,10 +56,22 @@ class FPM::Package::PEAR < FPM::Package
56
56
  @logger.info("Setting php_bin", :php_bin => php_bin)
57
57
  safesystem("pear", "-c", config, "config-set", "php_bin", php_bin)
58
58
 
59
- # try channel-discover
59
+ # do channel-discover if required
60
60
  if !attributes[:pear_channel].nil?
61
61
  @logger.info("Custom channel specified", :channel => attributes[:pear_channel])
62
- safesystem("pear", "-c", config, "channel-discover", attributes[:pear_channel])
62
+ pear_lc_cmd = "pear -c #{config} list-channels"
63
+ pear_lc_fd = IO.popen(pear_lc_cmd)
64
+ pear_lc_out = pear_lc_fd.read()
65
+ pid, status = Process.waitpid2(pear_lc_fd.pid)
66
+ if !status.success?
67
+ raise FPM::Util::ProcessFailed.new("#{pear_ls_cmd.first} failed (exit " \
68
+ "code #{status.exitstatus}). " \
69
+ "Full command was: #{pear_ls_cmd.inspect}")
70
+ end
71
+ if !pear_lc_out =~ /#{Regexp.quote(attributes[:pear_channel])}/
72
+ @logger.info("Discovering new channel", :channel => attributes[:pear_channel])
73
+ safesystem("pear", "-c", config, "channel-discover", attributes[:pear_channel])
74
+ end
63
75
  input_package = "#{attributes[:pear_channel]}/#{input_package}"
64
76
  @logger.info("Prefixing package name with channel", :package => input_package)
65
77
  end
@@ -44,6 +44,18 @@ class FPM::Package::RPM < FPM::Package
44
44
  value
45
45
  end
46
46
 
47
+ option "--defattrfile", "ATTR",
48
+ "Set the default file mode (%defattr).",
49
+ :default => '-' do |value|
50
+ value
51
+ end
52
+
53
+ option "--defattrdir", "ATTR",
54
+ "Set the default dir mode (%defattr).",
55
+ :default => '-' do |value|
56
+ value
57
+ end
58
+
47
59
  rpmbuild_define = []
48
60
  option "--rpmbuild-define", "DEFINITION",
49
61
  "Pass a --define argument to rpmbuild." do |define|
@@ -1,5 +1,5 @@
1
1
  require "fpm/namespace"
2
- require "open4"
2
+ require "childprocess"
3
3
 
4
4
  # Some utility functions
5
5
  module FPM::Util
@@ -19,6 +19,11 @@ module FPM::Util
19
19
 
20
20
  # Run a command safely in a way that gets reports useful errors.
21
21
  def safesystem(*args)
22
+ # ChildProcess isn't smart enough to run a $SHELL if there's
23
+ # spaces in the first arg and there's only 1 arg.
24
+ if args.size == 1
25
+ args = [ ENV["SHELL"], "-c", args[0] ]
26
+ end
22
27
  program = args[0]
23
28
 
24
29
  # Scan path to find the executable
@@ -28,17 +33,26 @@ module FPM::Util
28
33
  end
29
34
 
30
35
  @logger.debug("Running command", :args => args)
31
-
32
- status = Open4::popen4(*args) do |pid, stdin, stdout, stderr|
33
- stdin.close
34
36
 
35
- @logger.debug("Process is running", :pid => pid)
36
- @logger.pipe(stdout => :info, stderr => :error)
37
- end
38
- success = (status.exitstatus == 0)
37
+ # Create a pair of pipes to connect the
38
+ # invoked process to the cabin logger
39
+ stdout_r, stdout_w = IO.pipe
40
+ stderr_r, stderr_w = IO.pipe
41
+
42
+ process = ChildProcess.build(*args)
43
+ process.io.stdout = stdout_w
44
+ process.io.stderr = stderr_w
45
+
46
+ process.start
47
+ stdout_w.close; stderr_w.close
48
+ @logger.debug('Process is running', :pid => process.pid)
49
+ @logger.pipe(stdout_r => :info, stderr_r => :error)
50
+
51
+ process.wait
52
+ success = (process.exit_code == 0)
39
53
 
40
54
  if !success
41
- raise ProcessFailed.new("#{program} failed (exit code #{status.exitstatus})" \
55
+ raise ProcessFailed.new("#{program} failed (exit code #{process.exit_code})" \
42
56
  ". Full command was:#{args.inspect}")
43
57
  end
44
58
  return success
@@ -1,3 +1,3 @@
1
1
  module FPM
2
- VERSION = "0.4.35"
2
+ VERSION = "0.4.36"
3
3
  end
@@ -142,7 +142,7 @@ cp <%= source_safe %> <%= target_safe %>
142
142
  <% end -%>
143
143
 
144
144
  %files
145
- %defattr(-,<%= attributes[:rpm_user] %>,<%= attributes[:rpm_group] %>,-)
145
+ %defattr(<%= attributes[:rpm_defattrfile] %>,<%= attributes[:rpm_user] %>,<%= attributes[:rpm_group] %>,<%= attributes[:rpm_defattrdir] %>)
146
146
  <%# Output config files and then regular files. -%>
147
147
  <% config_files.each do |path| -%>
148
148
  %config(noreplace) <%= rpm_fix_name(path) %>
metadata CHANGED
@@ -1,219 +1,211 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.35
5
- prerelease:
4
+ version: 0.4.36
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jordan Sissel
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-08 00:00:00.000000000 Z
12
+ date: 2013-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
17
18
  requirements:
18
- - - "~>"
19
+ - - ~>
19
20
  - !ruby/object:Gem::Version
20
21
  version: 1.7.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
21
25
  none: false
22
- requirement: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.7.7
27
- none: false
28
- prerelease: false
29
- type: :runtime
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: cabin
32
- version_requirements: !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
33
34
  requirements:
34
- - - ">="
35
+ - - ! '>='
35
36
  - !ruby/object:Gem::Version
36
37
  version: 0.6.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
37
41
  none: false
38
- requirement: !ruby/object:Gem::Requirement
39
42
  requirements:
40
- - - ">="
43
+ - - ! '>='
41
44
  - !ruby/object:Gem::Version
42
45
  version: 0.6.0
43
- none: false
44
- prerelease: false
45
- type: :runtime
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: backports
48
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
49
50
  requirements:
50
- - - ">="
51
+ - - ! '>='
51
52
  - !ruby/object:Gem::Version
52
53
  version: 2.6.2
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
53
57
  none: false
54
- requirement: !ruby/object:Gem::Requirement
55
58
  requirements:
56
- - - ">="
59
+ - - ! '>='
57
60
  - !ruby/object:Gem::Version
58
61
  version: 2.6.2
59
- none: false
60
- prerelease: false
61
- type: :runtime
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: arr-pm
64
- version_requirements: !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
65
66
  requirements:
66
- - - "~>"
67
+ - - ~>
67
68
  - !ruby/object:Gem::Version
68
69
  version: 0.0.8
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
69
73
  none: false
70
- requirement: !ruby/object:Gem::Requirement
71
74
  requirements:
72
- - - "~>"
75
+ - - ~>
73
76
  - !ruby/object:Gem::Version
74
77
  version: 0.0.8
75
- none: false
76
- prerelease: false
77
- type: :runtime
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: ftw
80
- version_requirements: !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
81
82
  requirements:
82
- - - "~>"
83
+ - - ~>
83
84
  - !ruby/object:Gem::Version
84
85
  version: 0.0.30
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
85
89
  none: false
86
- requirement: !ruby/object:Gem::Requirement
87
90
  requirements:
88
- - - "~>"
91
+ - - ~>
89
92
  - !ruby/object:Gem::Version
90
93
  version: 0.0.30
91
- none: false
92
- prerelease: false
93
- type: :runtime
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: clamp
96
- version_requirements: !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
97
98
  requirements:
98
99
  - - '='
99
100
  - !ruby/object:Gem::Version
100
101
  version: 0.6.0
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
101
105
  none: false
102
- requirement: !ruby/object:Gem::Requirement
103
106
  requirements:
104
107
  - - '='
105
108
  - !ruby/object:Gem::Version
106
109
  version: 0.6.0
107
- none: false
108
- prerelease: false
109
- type: :runtime
110
110
  - !ruby/object:Gem::Dependency
111
- name: open4
112
- version_requirements: !ruby/object:Gem::Requirement
111
+ name: childprocess
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
113
114
  requirements:
114
- - - ">="
115
+ - - ! '>='
115
116
  - !ruby/object:Gem::Version
116
- version: !binary |-
117
- MA==
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
118
121
  none: false
119
- requirement: !ruby/object:Gem::Requirement
120
122
  requirements:
121
- - - ">="
123
+ - - ! '>='
122
124
  - !ruby/object:Gem::Version
123
- version: !binary |-
124
- MA==
125
- none: false
126
- prerelease: false
127
- type: :runtime
125
+ version: '0'
128
126
  - !ruby/object:Gem::Dependency
129
127
  name: rush
130
- version_requirements: !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
131
130
  requirements:
132
- - - ">="
131
+ - - ! '>='
133
132
  - !ruby/object:Gem::Version
134
- version: !binary |-
135
- MA==
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
136
137
  none: false
137
- requirement: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ">="
139
+ - - ! '>='
140
140
  - !ruby/object:Gem::Version
141
- version: !binary |-
142
- MA==
143
- none: false
144
- prerelease: false
145
- type: :development
141
+ version: '0'
146
142
  - !ruby/object:Gem::Dependency
147
143
  name: rspec
148
- version_requirements: !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
149
146
  requirements:
150
- - - ">="
147
+ - - ! '>='
151
148
  - !ruby/object:Gem::Version
152
- version: !binary |-
153
- MA==
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
154
153
  none: false
155
- requirement: !ruby/object:Gem::Requirement
156
154
  requirements:
157
- - - ">="
155
+ - - ! '>='
158
156
  - !ruby/object:Gem::Version
159
- version: !binary |-
160
- MA==
161
- none: false
162
- prerelease: false
163
- type: :development
157
+ version: '0'
164
158
  - !ruby/object:Gem::Dependency
165
159
  name: insist
166
- version_requirements: !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
167
162
  requirements:
168
- - - "~>"
163
+ - - ~>
169
164
  - !ruby/object:Gem::Version
170
165
  version: 0.0.5
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
171
169
  none: false
172
- requirement: !ruby/object:Gem::Requirement
173
170
  requirements:
174
- - - "~>"
171
+ - - ~>
175
172
  - !ruby/object:Gem::Version
176
173
  version: 0.0.5
177
- none: false
178
- prerelease: false
179
- type: :development
180
174
  - !ruby/object:Gem::Dependency
181
175
  name: minitest
182
- version_requirements: !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
183
178
  requirements:
184
- - - ">="
179
+ - - ! '>='
185
180
  - !ruby/object:Gem::Version
186
- version: !binary |-
187
- MA==
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
188
185
  none: false
189
- requirement: !ruby/object:Gem::Requirement
190
186
  requirements:
191
- - - ">="
187
+ - - ! '>='
192
188
  - !ruby/object:Gem::Version
193
- version: !binary |-
194
- MA==
195
- none: false
196
- prerelease: false
197
- type: :development
189
+ version: '0'
198
190
  - !ruby/object:Gem::Dependency
199
191
  name: pry
200
- version_requirements: !ruby/object:Gem::Requirement
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
201
194
  requirements:
202
- - - ">="
195
+ - - ! '>='
203
196
  - !ruby/object:Gem::Version
204
- version: !binary |-
205
- MA==
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
206
201
  none: false
207
- requirement: !ruby/object:Gem::Requirement
208
202
  requirements:
209
- - - ">="
203
+ - - ! '>='
210
204
  - !ruby/object:Gem::Version
211
- version: !binary |-
212
- MA==
213
- none: false
214
- prerelease: false
215
- type: :development
216
- 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!
205
+ version: '0'
206
+ description: Convert directories, rpms, python eggs, rubygems, and more to rpms, debs,
207
+ solaris packages and more. Win at package management without wasting pointless hours
208
+ debugging bad rpm specs!
217
209
  email: jls@semicomplete.com
218
210
  executables:
219
211
  - fpm
@@ -224,9 +216,6 @@ files:
224
216
  - lib/fpm/util.rb
225
217
  - lib/fpm/package.rb
226
218
  - lib/fpm/errors.rb
227
- - lib/fpm/version.rb
228
- - lib/fpm/command.rb
229
- - lib/fpm/namespace.rb
230
219
  - lib/fpm/package/solaris.rb
231
220
  - lib/fpm/package/gem.rb
232
221
  - lib/fpm/package/dir.rb
@@ -244,43 +233,44 @@ files:
244
233
  - lib/fpm/package/pyfpm/get_metadata.py
245
234
  - lib/fpm/package/pyfpm/get_metadata.pyc
246
235
  - lib/fpm/package/pyfpm/__init__.py
236
+ - lib/fpm/version.rb
237
+ - lib/fpm/command.rb
238
+ - lib/fpm/namespace.rb
247
239
  - bin/fpm
248
240
  - templates/rpm.erb
249
- - templates/solaris.erb
250
- - templates/osxpkg.erb
251
- - templates/deb.erb
252
241
  - templates/puppet/package.pp.erb
253
242
  - templates/puppet/package/remove.pp.erb
254
243
  - templates/rpm/filesystem_list
244
+ - templates/solaris.erb
255
245
  - templates/deb/ldconfig.sh.erb
246
+ - templates/osxpkg.erb
247
+ - templates/deb.erb
256
248
  - LICENSE
257
249
  - CONTRIBUTORS
258
250
  - CHANGELIST
259
251
  homepage: https://github.com/jordansissel/fpm
260
252
  licenses: []
261
- post_install_message:
253
+ post_install_message:
262
254
  rdoc_options: []
263
255
  require_paths:
264
256
  - lib
265
257
  - lib
266
258
  required_ruby_version: !ruby/object:Gem::Requirement
259
+ none: false
267
260
  requirements:
268
- - - ">="
261
+ - - ! '>='
269
262
  - !ruby/object:Gem::Version
270
- version: !binary |-
271
- MA==
272
- none: false
263
+ version: '0'
273
264
  required_rubygems_version: !ruby/object:Gem::Requirement
265
+ none: false
274
266
  requirements:
275
- - - ">="
267
+ - - ! '>='
276
268
  - !ruby/object:Gem::Version
277
- version: !binary |-
278
- MA==
279
- none: false
269
+ version: '0'
280
270
  requirements: []
281
- rubyforge_project:
282
- rubygems_version: 1.8.24
283
- signing_key:
271
+ rubyforge_project:
272
+ rubygems_version: 1.8.25
273
+ signing_key:
284
274
  specification_version: 3
285
275
  summary: fpm - package building and mangling
286
276
  test_files: []