fpm 0.2.15 → 0.2.16

Sign up to get free protection for your applications and to get access to all the features.
data/bin/fpm CHANGED
@@ -22,55 +22,60 @@ def main(args)
22
22
  else
23
23
  settings.package_path = "#{Dir.pwd}/#{path}"
24
24
  end
25
- end
25
+ end # --package
26
26
 
27
27
  opts.on("-n PACKAGENAME", "--name PACKAGENAME",
28
28
  "What name to give to the package") do |name|
29
29
  settings.package_name = name
30
- end
30
+ end # --name
31
31
 
32
32
  opts.on("-v VERSION", "--version VERSION",
33
33
  "version to give the package") do |version|
34
- settings.version = version
35
- end
34
+ settings.version = version
35
+ end # --version
36
+
37
+ opts.on("--epoch EPOCH",
38
+ "(optional) Set epoch value for this package.") do |epoch|
39
+ settings.epoch = epoch
40
+ end # --epoch
36
41
 
37
42
  opts.on("-d DEPENDENCY", "--depends DEPENDENCY") do |dep|
38
43
  settings.dependencies ||= []
39
44
  settings.dependencies << dep
40
- end
45
+ end # --depends
41
46
 
42
47
  opts.on("-a ARCHITECTURE", "--architecture ARCHITECTURE") do |arch|
43
48
  settings.architecture = arch
44
- end
49
+ end # --architecture
45
50
 
46
51
  opts.on("-m MAINTAINER", "--maintainer MAINTAINER") do |maintainer|
47
52
  settings.maintainer = maintainer
48
- end
53
+ end # --maintainer
49
54
 
50
55
  opts.on("-C DIRECTORY", "Change directory before searching for files") do |dir|
51
56
  settings.chdir = dir
52
- end
57
+ end # -C
53
58
 
54
59
  opts.on("-t PACKAGE_TYPE", "the type of package you want to create") do |type|
55
60
  settings.package_type = type
56
- end
61
+ end # -t
57
62
 
58
63
  opts.on("-s SOURCE_TYPE", "what to build the package from") do |st|
59
64
  settings.source_type = st
60
- end
65
+ end # -s
61
66
 
62
67
  opts.on("-S PACKAGE_SUFFIX", "which suffix to append to package and dependances") do |sfx|
63
68
  settings.suffix = sfx
64
- end
69
+ end # -S
65
70
 
66
71
  opts.on("--prefix PREFIX",
67
72
  "A path to prefix files with when building the target package. This may not be necessary for all source types. For example, the 'gem' type will prefix with your gem directory (gem env | grep -A1 PATHS:)") do |prefix|
68
73
  settings.prefix = prefix
69
- end
74
+ end # --prefix
70
75
 
71
76
  opts.on("-e", "--edit", "Edit the specfile before building") do
72
77
  settings.edit = true
73
- end
78
+ end # --edit
74
79
 
75
80
  opts.on("-x PATTERN", "--exclude PATTERN",
76
81
  "Exclude paths matching pattern (according to tar --exclude)") do |pattern|
@@ -33,6 +33,7 @@ class FPM::Builder
33
33
  @source = source_class_for(settings.source_type || 'dir').new(
34
34
  paths, root,
35
35
  :version => settings.version,
36
+ :epoch => settings.epoch,
36
37
  :name => settings.package_name,
37
38
  :prefix => settings.prefix,
38
39
  :suffix => settings.suffix,
@@ -47,6 +48,7 @@ class FPM::Builder
47
48
  # Append dependencies given from settings (-d flag for fpm)
48
49
  @package.dependencies += settings.dependencies if settings.dependencies
49
50
  @package.architecture = settings.architecture if settings.architecture
51
+ #@package.epoch = settings.epoch # nil is OK
50
52
 
51
53
  @output = settings.package_path
52
54
  @recurse_dependencies = settings.recurse_dependencies
@@ -8,6 +8,11 @@ class FPM::Package
8
8
  # The version of this package (the upstream version)
9
9
  attr_accessor :version
10
10
 
11
+ # The epoch version of this package
12
+ # This is used most when an upstream package changes it's versioning
13
+ # style so standard comparisions wouldn't work.
14
+ attr_accessor :epoch
15
+
11
16
  # The iteration of this package.
12
17
  # Debian calls this 'release' and is the last '-NUMBER' in the version
13
18
  # RedHat has this as 'Release' in the .spec file
@@ -48,6 +53,7 @@ class FPM::Package
48
53
 
49
54
  # Default version is 1.0 in case nobody told us a specific version.
50
55
  @version = source[:version] || "1.0"
56
+ @epoch = source[:epoch]
51
57
 
52
58
  @dependencies = source[:dependencies] || []
53
59
  # Iteration can be nil. If nil, the fpm package implementation is expected
@@ -7,6 +7,8 @@ class FPM::Target::Rpm < FPM::Package
7
7
 
8
8
  def build!(params)
9
9
  raise "No package name given. Can't assemble package" if !@name
10
+ # TODO(sissel): Abort if 'rpmbuild' tool not found.
11
+
10
12
  %w(BUILD RPMS SRPMS SOURCES SPECS).each { |d| Dir.mkdir(d) }
11
13
  args = ["rpmbuild", "-ba",
12
14
  "--define", "buildroot #{Dir.pwd}/BUILD",
@@ -1,5 +1,5 @@
1
1
  Package: <%= name %>
2
- Version: <%= version %><%= iteration && '-'+iteration.to_s %>
2
+ Version: <%= "#{epoch}:" if epoch %><%= version %><%= iteration && '-'+iteration.to_s %>
3
3
  Architecture: <%= architecture %>
4
4
  Maintainer: <%= maintainer or "<unknown>" %>
5
5
  <% if dependencies.size > 0 %>
@@ -1,5 +1,8 @@
1
1
  Name: <%= @name %>
2
2
  Version: <%= @version %>
3
+ <% if @epoch %>
4
+ Epoch: <%= @epoch %>
5
+ <% end %>
3
6
  Release: <%= @iteration or 1 %>
4
7
  Summary: <%= @summary %>
5
8
  BuildArch: <%= architecture %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 15
10
- version: 0.2.15
9
+ - 16
10
+ version: 0.2.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-11 00:00:00 -07:00
18
+ date: 2011-04-25 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: "0"
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
- description: Turn directories into packages. Fix broken packages. Win the package management game.
35
+ description: Turn directories into packages. Fix broken packages. Win the package building game.
36
36
  email: jls@semicomplete.com
37
37
  executables:
38
38
  - fpm
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project:
92
- rubygems_version: 1.5.1
92
+ rubygems_version: 1.6.0
93
93
  signing_key:
94
94
  specification_version: 3
95
95
  summary: fpm - package building and mangling