fpm 0.4.22 → 0.4.23

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELIST CHANGED
@@ -1,3 +1,20 @@
1
+ 0.4.23 (November 26, 2012)
2
+ - The --directories flag is now recursive when the output package is rpm.
3
+ This makes all directories under a given path as owned by the package
4
+ so they'll be removed when the package is uninstalled (#245, #293, #294,
5
+ patch by Justin Ellison)
6
+ - Add fpm version info to '--help' output (#281)
7
+ - gem to rpm: Use 'rubygem(gemname)' for dependencies (#284, patch by
8
+ Jan Vansteenkiste)
9
+ - Fix a bug in gem version mangling (#292, #291; patch by Pranay Kanwar)
10
+ - Fix compatibility with Python 2.5 (#279, patch by Denis Bilenko)
11
+
12
+ 0.4.22 (November 15, 2012)
13
+ - Add --no-depends flag for creating packages with no dependencies listed
14
+ (#289, patch by Brett Gailey)
15
+ - Fix a bug where blank lines were present in a debian control file.
16
+ (#288, patch by Andrew Bunday)
17
+
1
18
  0.4.21 (November 8, 2012)
2
19
  - gem: remove restriction on expected gem names (#287)
3
20
  - add --directory flag; lets you mark a directory as being owned by a
@@ -1,5 +1,6 @@
1
1
  require "rubygems"
2
2
  require "fpm/namespace"
3
+ require "fpm/version"
3
4
  require "fpm/util"
4
5
  require "clamp"
5
6
  require "ostruct"
@@ -21,6 +22,24 @@ end
21
22
  class FPM::Command < Clamp::Command
22
23
  include FPM::Util
23
24
 
25
+ def help(*args)
26
+ return [
27
+ "Intro:",
28
+ "",
29
+ " This is fpm version #{FPM::VERSION}",
30
+ "",
31
+ " If you think something is wrong, it's probably a bug! :)",
32
+ " Please file these here: https://github.com/jordansissel/fpm/issues",
33
+ "",
34
+ " You can find support on irc (#fpm on freenode irc) or via email with",
35
+ " fpm-users@googlegroups.com",
36
+ "",
37
+
38
+ # Lastly, include the default help output via Clamp.
39
+ super
40
+ ].join("\n")
41
+ end # def help
42
+
24
43
  option "-t", "OUTPUT_TYPE",
25
44
  "the type of package you want to create (deb, rpm, solaris, etc)",
26
45
  :attribute_name => :output_type
@@ -111,8 +111,8 @@ class FPM::Package::Gem < FPM::Package
111
111
  # expand spec's version to match RationalVersioningPolicy to prevent cases
112
112
  # where missing 'build' number prevents correct dependency resolution by target
113
113
  # package manager. Ie. for dpkg 1.1 != 1.1.0
114
- m = spec.version.to_s.match /^(\d)?.?(\d+)?.?(\d+)?/
115
- self.version = m.captures.map {|m| m ? m : 0}.join('.')
114
+ m = spec.version.to_s.scan(/(\d+)\.?/)
115
+ self.version = m.flatten.fill('0', m.length..2).join('.')
116
116
 
117
117
  self.vendor = spec.author
118
118
  self.url = spec.homepage
@@ -1,8 +1,11 @@
1
1
  from distutils.core import Command
2
- import json
3
2
  import re
4
3
  import time
5
4
  import pkg_resources
5
+ try:
6
+ import json
7
+ except ImportError:
8
+ import simplejson as json
6
9
 
7
10
  # Note, the last time I coded python daily was at Google, so it's entirely
8
11
  # possible some of my techniques below are outdated or bad.
@@ -64,10 +67,10 @@ class get_metadata(Command):
64
67
  data["dependencies"] = final_deps
65
68
 
66
69
  #print json.dumps(data, indent=2)
67
- try:
68
- print(json.dumps(data, indent=2))
69
- except AttributeError as e:
70
- # For Python 2.5 and Debian's python-json
71
- print(json.write(data))
70
+ if hasattr(json, 'dumps'):
71
+ print(json.dumps(data, indent=2))
72
+ else:
73
+ # For Python 2.5 and Debian's python-json
74
+ print(json.write(data))
72
75
  # def run
73
76
  # class list_dependencies
@@ -121,6 +121,15 @@ class FPM::Package::RPM < FPM::Package
121
121
  provides
122
122
  end
123
123
  end
124
+ self.dependencies = self.dependencies.collect do |dependency|
125
+ first, remainder = dependency.split("-", 2)
126
+ if first == "rubygem"
127
+ name, remainder = remainder.split(" ", 2)
128
+ "rubygem(#{name})#{remainder ? " #{remainder}" : ""}"
129
+ else
130
+ dependency
131
+ end
132
+ end
124
133
  #self.provides << "rubygem(#{self.name})"
125
134
  end
126
135
  end # def converted
@@ -0,0 +1,3 @@
1
+ module FPM
2
+ VERSION = "0.4.23"
3
+ end
@@ -109,8 +109,15 @@ fi
109
109
  <% config_files.each do |path| -%>
110
110
  %config(noreplace) <%= File.join(prefix, path) %>
111
111
  <% end -%>
112
+ <% subdirs = [] -%>
112
113
  <% directories.each do |path| -%>
113
114
  %dir <%= File.join(prefix, path) %>
115
+ <%# We need to include hidden directories, but exclude . and .. -%>
116
+ <% ::Dir.glob("#{path}/**/*/", File::FNM_DOTMATCH) do |subdir| -%>
117
+ <% next if File.basename(subdir) =~ /^\.+$/ -%>
118
+ %dir <%= File.join(prefix, subdir) %>
119
+ <% subdirs << subdir -%>
120
+ <% end -%>
114
121
  <% end -%>
115
122
  <%# list only files, not directories? -%>
116
123
  <%=
@@ -125,6 +132,7 @@ fi
125
132
  # Replace % with [%] to make rpm not expand macros
126
133
  files.collect { |f| "/#{f}" } \
127
134
  .reject { |f| config_files.include?(f) } \
135
+ .reject { |f| subdirs.include?("#{f}/") } \
128
136
  .collect { |f| f[/\s/] and "\"#{f}\"" or f } \
129
137
  .collect { |f| f.gsub("[", "[\\[]") } \
130
138
  .collect { |f| f.gsub("*", "[*]") } \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.22
4
+ version: 0.4.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-15 00:00:00.000000000 Z
12
+ date: 2012-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -149,33 +149,32 @@ executables:
149
149
  extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
- - lib/fpm/command.rb
152
+ - lib/fpm.rb
153
+ - lib/fpm/errors.rb
153
154
  - lib/fpm/namespace.rb
154
155
  - lib/fpm/package.rb
155
- - lib/fpm/package/pyfpm/get_metadata.pyc
156
- - lib/fpm/package/pyfpm/get_metadata.py
157
- - lib/fpm/package/pyfpm/__init__.pyc
158
- - lib/fpm/package/pyfpm/__init__.py
159
- - lib/fpm/package/tar.rb
160
156
  - lib/fpm/package/deb.rb
161
157
  - lib/fpm/package/dir.rb
158
+ - lib/fpm/package/npm.rb
159
+ - lib/fpm/package/pear.rb
162
160
  - lib/fpm/package/puppet.rb
163
- - lib/fpm/package/gem.rb
161
+ - lib/fpm/package/pyfpm/__init__.py
162
+ - lib/fpm/package/pyfpm/get_metadata.py
164
163
  - lib/fpm/package/python.rb
165
- - lib/fpm/package/solaris.rb
166
164
  - lib/fpm/package/rpm.rb
167
- - lib/fpm/package/npm.rb
168
- - lib/fpm/package/pear.rb
169
- - lib/fpm/errors.rb
165
+ - lib/fpm/package/solaris.rb
166
+ - lib/fpm/package/tar.rb
167
+ - lib/fpm/package/gem.rb
170
168
  - lib/fpm/util.rb
171
- - lib/fpm.rb
172
- - bin/fpm-npm
169
+ - lib/fpm/command.rb
170
+ - lib/fpm/version.rb
173
171
  - bin/fpm
174
- - templates/solaris.erb
175
- - templates/rpm.erb
172
+ - bin/fpm-npm
176
173
  - templates/deb.erb
177
- - templates/puppet/package/remove.pp.erb
178
174
  - templates/puppet/package.pp.erb
175
+ - templates/puppet/package/remove.pp.erb
176
+ - templates/solaris.erb
177
+ - templates/rpm.erb
179
178
  - LICENSE
180
179
  - CONTRIBUTORS
181
180
  - CHANGELIST