easyfpm 0.1.0.pre → 0.2.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/easyfpm/packaging.rb +30 -15
  2. metadata +67 -80
@@ -118,7 +118,6 @@ class EASYFPM::Packaging
118
118
  fpmconf += " --after-remove "+labelhashconf[param]
119
119
  when "pkg-iteration"
120
120
  fpmconf += " --iteration "+labelhashconf[param]
121
- fpmconf += labelhashconf["pkg-suffix"] if labelhashconf.has_key? "pkg-suffix"
122
121
  when "pkg-epoch"
123
122
  fpmconf += " --epoch "+labelhashconf[param]
124
123
  when "pkg-vendor"
@@ -138,9 +137,8 @@ class EASYFPM::Packaging
138
137
  fpmconf += " -d '"+pkgdepend+"'"
139
138
  end #labelhashconf[param].each
140
139
  when "pkg-suffix"
141
- #if iteration defines, suffix is with it, else it is like an iteration
142
- next if labelhashconf.has_key? "pkg-iteration"
143
- fpmconf += " --iteration 1"+labelhashconf[param]
140
+ #Due to a lack in fpm, the pkg-suffix is use only in package renaming
141
+ next
144
142
  when "pkg-changelog"
145
143
  case packageType
146
144
  when "deb","rpm"
@@ -297,9 +295,11 @@ class EASYFPM::Packaging
297
295
 
298
296
  #Do we have a specific output dir ?
299
297
  # there's a bug with fpm and this feature, so easyfpm take it itself for the moment
300
- if labelconf.has_key? "pkg-output-dir"
298
+ if labelconf.has_key? "pkg-output-dir" or labelconf.has_key? "pkg-suffix"
301
299
  #Making a new tmpdir for working in
302
300
  makingConf["pkg-output-dir"] = Dir.mktmpdir("easyfpm-output-dir")
301
+ #if pkg-output-dir is not defined, we have to put the result in the current dir
302
+ labelconf["pkg-output-dir"] = Dir.getwd unless labelconf.has_key? "pkg-output-dir"
303
303
  end
304
304
 
305
305
  #We are ready to generate the fpm command
@@ -308,7 +308,7 @@ class EASYFPM::Packaging
308
308
  puts "fpm "+fpmCmdOptions if (@verbose or @debug or @dryrun)
309
309
 
310
310
  unless @dryrun
311
- if makingConf.has_key? "pkg-output-dir"
311
+ if makingConf.has_key? "pkg-output-dir"
312
312
  #returnCode = system "cd "+makingConf["pkg-output-dir"]+" && fpm "+fpmCmdOptions
313
313
  Open3.popen2e("cd "+makingConf["pkg-output-dir"]+" && fpm "+fpmCmdOptions) do |stdin, stdout_err, wait_thr|
314
314
  #fpm uses Cabin::channel for logging
@@ -336,32 +336,47 @@ class EASYFPM::Packaging
336
336
 
337
337
  #Here we have the pkg-output-dir treatment
338
338
  if message == "Created package" and path
339
+ if labelconf.has_key? "pkg-suffix"
340
+ #We have to rename the package
341
+ case labelconf["pkg-type"]
342
+ when "rpm", "deb"
343
+ #Suffix has to be fixed before arch and extension
344
+ newpathmatch = /^(.+)(\.[^.]+\.[^.]+)$/.match(path)
345
+ newpath=newpathmatch[1]+labelconf["pkg-suffix"]+newpathmatch[2]
346
+ else
347
+ #By default suffix is before extension
348
+ newpathmatch = /^(.+)(\.[^.]+)$/.match(path)
349
+ newpath=newpathmatch[1]+labelconf["pkg-suffix"]+newpathmatch[2]
350
+ end
351
+ else
352
+ newpath=path
353
+ end
339
354
  if File.exists?(makingConf["pkg-output-dir"]+"/"+path)
340
355
  puts (message+" "+makingConf["pkg-output-dir"]+"/"+path)
341
356
  outline=nil
342
- if File.exists?(labelconf["pkg-output-dir"]+"/"+path)
357
+ if File.exists?(labelconf["pkg-output-dir"]+"/"+newpath)
343
358
  if labelconf.has_key?("pkg-force") and (labelconf["pkg-force"] == "yes")
344
359
  #Move file
345
360
  if (@verbose or @debug)
346
- FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+path, :force => true, :verbose => true)
361
+ FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+newpath, :force => true, :verbose => true)
347
362
  else
348
- FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+path, :force => true)
363
+ FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+newpath, :force => true)
349
364
  end #if (@verbose or @debug)
350
- puts "Package moved to #{labelconf["pkg-output-dir"]}/#{path}"
365
+ puts "Package moved to #{labelconf["pkg-output-dir"]}/#{newpath}"
351
366
  # We suppress
352
367
  else
353
- warn labelconf["pkg-output-dir"]+"/"+path+" already exists, use '--pkg-force yes' to force copy"
368
+ warn labelconf["pkg-output-dir"]+"/"+newpath+" already exists, use '--pkg-force yes' to force copy"
354
369
  returnCode = false
355
370
  end #if labelconf.has_key? "pkg-force" and labelconf["pkg-force"] == "yes"
356
371
  else
357
372
  #Move file
358
373
  if (@verbose or @debug)
359
- FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+path, :verbose => true)
374
+ FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+newpath, :verbose => true)
360
375
  else
361
- FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+path)
376
+ FileUtils.mv(makingConf["pkg-output-dir"]+"/"+path, labelconf["pkg-output-dir"]+"/"+newpath)
362
377
  end
363
- puts "Package moved to #{labelconf["pkg-output-dir"]}/#{path}"
364
- end #if File.exists?(labelconf["pkg-output-dir"]+"/"+path)
378
+ puts "Package moved to #{labelconf["pkg-output-dir"]}/#{newpath}"
379
+ end #if File.exists?(labelconf["pkg-output-dir"]+"/"+newpath)
365
380
  end #if File.exists?(makingConf["pkg-output-dir"]+"/"+path)
366
381
  end #message == "Created package" and path
367
382
  #We display the message if not filtered
metadata CHANGED
@@ -1,76 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: easyfpm
3
- version: !ruby/object:Gem::Version
4
- prerelease: true
5
- segments:
6
- - 0
7
- - 1
8
- - 0
9
- - pre
10
- version: 0.1.0.pre
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0.pre
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Erwan SEITE
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2014-05-15 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2014-06-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: ptools
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- segments:
30
- - 1
31
- - 2
32
- - 4
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.2.4
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: fpm
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.4
30
+ - !ruby/object:Gem::Dependency
31
+ name: fpm
32
+ requirement: !ruby/object:Gem::Requirement
40
33
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- segments:
45
- - 1
46
- - 1
47
- - 0
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
48
37
  version: 1.1.0
49
38
  type: :runtime
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: unixconfigstyle
53
39
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
55
41
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- segments:
60
- - 1
61
- - 0
62
- - 0
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.1.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: unixconfigstyle
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
63
53
  version: 1.0.0
64
54
  type: :runtime
65
- version_requirements: *id003
66
- description: " Simplify packaging with fpm by using config files.\n The aim is to have 1 config file to create many packages for one script module (deb, rpm).\n For the moment, the source MUST be a directory, but this tool can manage a changelog format and also mapping files if the module tree is different from the targeted (deployment) tree.\n"
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ description: ! " Simplify packaging with fpm by using config files.\n The aim is
63
+ to have 1 config file to create many packages for one script module (deb, rpm).\n
64
+ \ For the moment, the source MUST be a directory, but this tool can manage a changelog
65
+ format and also mapping files if the module tree is different from the targeted
66
+ (deployment) tree.\n"
67
67
  email: wanix.fr@gmail.com
68
- executables:
68
+ executables:
69
69
  - easyfpm
70
70
  - easyfpm-translatecl
71
71
  extensions: []
72
-
73
- extra_rdoc_files:
72
+ extra_rdoc_files:
74
73
  - README.md
75
74
  - LICENSE
76
75
  - THANKS
@@ -81,16 +80,16 @@ extra_rdoc_files:
81
80
  - doc/samples/install_scripts/post-delete.sh
82
81
  - doc/samples/install_scripts/pre-delete.sh
83
82
  - doc/samples/install_scripts/pre-install.sh
84
- files:
83
+ files:
85
84
  - lib/easyfpm.rb
86
- - lib/easyfpm/exceptions.rb
87
- - lib/easyfpm/pkgchangelog.rb
88
- - lib/easyfpm/packaging.rb
89
- - lib/easyfpm/namespace.rb
90
- - lib/easyfpm/mapping.rb
91
85
  - lib/easyfpm/version.rb
92
86
  - lib/easyfpm/commandline.rb
87
+ - lib/easyfpm/mapping.rb
88
+ - lib/easyfpm/exceptions.rb
93
89
  - lib/easyfpm/configuration.rb
90
+ - lib/easyfpm/packaging.rb
91
+ - lib/easyfpm/pkgchangelog.rb
92
+ - lib/easyfpm/namespace.rb
94
93
  - README.md
95
94
  - LICENSE
96
95
  - THANKS
@@ -103,41 +102,29 @@ files:
103
102
  - doc/samples/install_scripts/pre-install.sh
104
103
  - bin/easyfpm
105
104
  - bin/easyfpm-translatecl
106
- has_rdoc: true
107
105
  homepage: https://github.com/wanix/easyfpm
108
- licenses:
106
+ licenses:
109
107
  - GPLv2
110
108
  post_install_message:
111
109
  rdoc_options: []
112
-
113
- require_paths:
110
+ require_paths:
114
111
  - lib
115
- required_ruby_version: !ruby/object:Gem::Requirement
112
+ required_ruby_version: !ruby/object:Gem::Requirement
116
113
  none: false
117
- requirements:
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- segments:
121
- - 1
122
- - 9
123
- - 1
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
124
117
  version: 1.9.1
125
- required_rubygems_version: !ruby/object:Gem::Requirement
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
119
  none: false
127
- requirements:
128
- - - ">"
129
- - !ruby/object:Gem::Version
130
- segments:
131
- - 1
132
- - 3
133
- - 1
120
+ requirements:
121
+ - - ! '>'
122
+ - !ruby/object:Gem::Version
134
123
  version: 1.3.1
135
124
  requirements: []
136
-
137
125
  rubyforge_project:
138
- rubygems_version: 1.3.7
126
+ rubygems_version: 1.8.23
139
127
  signing_key:
140
128
  specification_version: 3
141
129
  summary: Wrapper for fpm
142
130
  test_files: []
143
-