fpm 0.4.6 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELIST CHANGED
@@ -1,3 +1,13 @@
1
+ 0.4.8 (April 25, 2012)
2
+ - RPM: use 'noreplace' option for config files (#194, patch by Steve Lum)
3
+ - Python: Fix bug around exact dependency versions (#206, patch by Lars van
4
+ de Kerkhof)
5
+ - Gem->RPM: Make 'provides' "rubygem(thegemname)" instead of "rubygem-thegemname"
6
+ - Fix oddity where Ruby would complain about constant redefinition (#198,
7
+ patch by Marcus Vinicius Ferreira)
8
+
9
+ 0.4.7 skipped.
10
+
1
11
  0.4.6 (April 10, 2012)
2
12
  - Work around more problems in RPM with respect to file listing (#202)
3
13
 
@@ -17,7 +17,7 @@ class FPM::Package::Deb < FPM::Package
17
17
  :after_install => "postinst",
18
18
  :before_remove => "prerm",
19
19
  :after_remove => "postrm",
20
- }
20
+ } unless defined?(SCRIPT_MAP)
21
21
 
22
22
  option "--ignore-iteration-in-dependencies", :flag,
23
23
  "For '=' (equal) dependencies, allow iterations on the specified " \
@@ -261,8 +261,10 @@ class FPM::Package::Deb < FPM::Package
261
261
  nextversion[l-1] = 0
262
262
  nextversion = nextversion.join(".")
263
263
  return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
264
- elsif (m = dep.match(/(\S+)\s+\(= (.+)\)/))
264
+ elsif (m = dep.match(/(\S+)\s+\(= (.+)\)/)) and
265
+ self.attributes[:deb_ignore_iteration_in_dependencies?]
265
266
  # Convert 'foo (= x)' to 'foo (>= x)' and 'foo (<< x+1)'
267
+ # but only when flag --ignore-iteration-in-dependencies is passed.
266
268
  name, version = m[1..2]
267
269
  nextversion = version.split('.').collect { |v| v.to_i }
268
270
  nextversion[-1] += 1
@@ -270,7 +272,7 @@ class FPM::Package::Deb < FPM::Package
270
272
  return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
271
273
  else
272
274
  # otherwise the dep is probably fine
273
- return dep
275
+ return dep.rstrip
274
276
  end
275
277
  end # def fix_dependency
276
278
 
@@ -135,7 +135,7 @@ class FPM::Package::Gem < FPM::Package
135
135
 
136
136
  # By default, we'll usually automatically provide this, but in the case that we are
137
137
  # composing multiple packages, it's best to explicitly include it in the provides list.
138
- self.provides << "rubygem-#{self.name}"
138
+ self.provides << "#{self.name}"
139
139
 
140
140
  spec.runtime_dependencies.map do |dep|
141
141
  # rubygems 1.3.5 doesn't have 'Gem::Dependency#requirement'
@@ -2,11 +2,13 @@ from distutils.core import Command
2
2
  import json
3
3
  import re
4
4
  import time
5
+ import pkg_resources
5
6
 
6
7
  # Note, the last time I coded python daily was at Google, so it's entirely
7
8
  # possible some of my techniques below are outdated or bad.
8
9
  # If you have fixes, let me know.
9
10
 
11
+
10
12
  class get_metadata(Command):
11
13
  description = "get package metadata"
12
14
  user_options = []
@@ -45,44 +47,19 @@ class get_metadata(Command):
45
47
  data["architecture"] = "all"
46
48
  # end if
47
49
 
48
- dependencies = None
49
- try:
50
- dependencies = self.distribution.install_requires
51
- except:
52
- pass
53
-
54
- # In some cases (Mysql-Python) 'dependencies' is none, not empty.
55
- if dependencies is None:
56
- dependencies = []
57
-
58
- # Some cases (like paramiko) dependencies is actually just a string, not a
59
- # list
60
- if isinstance(dependencies, str):
61
- dependencies = [dependencies]
62
-
63
50
  final_deps = []
64
- dep_re = re.compile("([^<>= ]+)(?:\s*([<>=]{1,2})\s*([^,]*))?(?:,\s*([<>=]{1,2})\s*(.*))?$")
65
- for dep in dependencies:
66
- # python deps are strings that look like:
67
- # "packagename"
68
- # "packagename >= version"
69
- # Replace 'packagename' with 'python#{suffix}-packagename'
70
- m = dep_re.match(dep)
71
- if m is None:
72
- print "Bad dep: %s" % dep
73
- time.sleep(3)
74
- elif m.groups()[1] is None:
75
- name, cond, version = m.groups()[0], ">=", 0
76
- else:
77
- groups = m.groups()
78
- name, cond, version = groups[0:3]
79
- if groups[3] is not None:
80
- final_deps.append("%s %s %s" % (groups[0], groups[3], groups[4]))
81
- # end if
82
- # end if
83
-
84
- final_deps.append("%s %s %s" % (name, cond, version))
85
- # end for i in dependencies
51
+ if getattr(self.distribution, 'install_requires', None):
52
+ for dep in pkg_resources.parse_requirements(self.distribution.install_requires):
53
+ # add all defined specs to the dependecy list separately.
54
+ if dep.specs:
55
+ for operator, version in dep.specs:
56
+ final_deps.append("%s %s %s" % (
57
+ dep.project_name,
58
+ "=" if operator == "==" else operator,
59
+ version
60
+ ))
61
+ else:
62
+ final_deps.append(dep.project_name)
86
63
 
87
64
  data["dependencies"] = final_deps
88
65
 
@@ -21,13 +21,13 @@ class FPM::Package::RPM < FPM::Package
21
21
  "sha256" => 8,
22
22
  "sha384" => 9,
23
23
  "sha512" => 10
24
- }
24
+ } unless defined?(DIGEST_ALGORITHM_MAP)
25
25
 
26
26
  COMPRESSION_MAP = {
27
27
  "xz" => "w2.xzdio",
28
28
  "gzip" => "w9.gzdio",
29
29
  "bzip2" => "w9.bzdio"
30
- }
30
+ } unless defined?(COMPRESSION_MAP)
31
31
 
32
32
 
33
33
  option "--rpmbuild-define", "DEFINITION",
@@ -98,6 +98,20 @@ class FPM::Package::RPM < FPM::Package
98
98
  end
99
99
  end
100
100
  self.dependencies = fixed_deps
101
+
102
+ # Convert 'rubygem-foo' provides values to 'rubygem(foo)'
103
+ # since that's what most rpm packagers seem to do.
104
+ self.provides = self.provides.collect do |provides|
105
+ first, remainder = provides.split("-", 2)
106
+ if first == "rubygem"
107
+ name, remainder = remainder.split(" ", 2)
108
+ # yield rubygem(name)...
109
+ "rubygem(#{name})#{remainder ? " #{remainder}" : ""}"
110
+ else
111
+ provides
112
+ end
113
+ end
114
+ #self.provides << "rubygem(#{self.name})"
101
115
  end
102
116
  end # def converted
103
117
 
@@ -99,7 +99,7 @@ fi
99
99
  %defattr(-,root,root,-)
100
100
  <%# Output config files and then regular files. -%>
101
101
  <% config_files.each do |path| -%>
102
- %config <%= path %>
102
+ %config(noreplace) <%= path %>
103
103
  <% end -%>
104
104
  <%# list only files, not directories? -%>
105
105
  <%=
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.6
4
+ version: 0.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-10 00:00:00.000000000 Z
12
+ date: 2012-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 1.6.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: 1.6.6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: cabin
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -80,17 +80,17 @@ dependencies:
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ! '>='
83
+ - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: '0'
85
+ version: 0.3.1
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ! '>='
91
+ - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: 0.3.1
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: rush
96
96
  requirement: !ruby/object:Gem::Requirement