easyfpm 0.2.1.pre → 0.3.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2bc9a1c81762fb12afdd9c7ce17deb795134f74f
4
+ data.tar.gz: d33c267b019c7fe15b61dfc75e1616b55d959d98
5
+ SHA512:
6
+ metadata.gz: 61a3c3d801565734dc322fe5656042ff730e154a2dbc0e691688bf686b665057f4c8dcd39425311f7cdbc1357976f39bf209e41eb0ae20a92c0a4ce578e15f24
7
+ data.tar.gz: a293dc52f5a38eadad2bc2f75b7b6a3f21288c1bab495e671665aca8e53df4aebdce5ed0d7824ef0b1eb877ce2340f65faec21df4faebf70376eaab929fdb987
data/README.md CHANGED
@@ -2,3 +2,312 @@ easyfpm
2
2
  =======
3
3
 
4
4
  Methods and scripts for those who want to use fpm to make scripts packages
5
+
6
+ The aim of easyfpm is to facilitate the work of administrators and permit to deliver their scripts as packages.
7
+
8
+ help of the script
9
+ ------------------
10
+
11
+ this is given by --help parameter
12
+
13
+ ```
14
+ Usage easyfpm [options]
15
+ --config-file [string] Configuration file's path
16
+ (can be declared multiple times, declarative order is priority order)
17
+ --label [list by comma] Labels to work with
18
+ (can be declared multiple times)
19
+ --pkg-name [string] Package name
20
+ --pkg-type [string] Package type
21
+ --pkg-version [string] Package version, example 1.0
22
+ --pkg-src-dir [string] Package source dir
23
+ --pkg-mapping [string] Package install map file
24
+ --pkg-prefix [string] Package installation prefix
25
+ --pkg-output-dir [string] Destination dir for packages
26
+ --pkg-description [string] Package description
27
+ --pkg-arch [string] Package architecture
28
+ --pkg-content [string] source elements to package
29
+ --pkg-user [string] Owner of package's elements
30
+ --pkg-group [string] Group of package's elements
31
+ --template-activated [yes|no]
32
+ Activate fpm templating mode
33
+ --template-value [string key:value]
34
+ Couple key:value for fpm templating
35
+ --pkg-preinst [string] Path to pre-install package script
36
+ --pkg-postinst [string] Path to post-install package script
37
+ --pkg-prerm [string] Path to pre-delete package script
38
+ --pkg-postrm [string] Path to post-delete package script
39
+ --pkg-iteration [string] Package iteration
40
+ --pkg-epoch [integer] Package epoch value
41
+ --easyfpm-pkg-changelog [string]
42
+ Path to an easyfpm format changelog file
43
+ --pkg-vendor [string] Package vendor name
44
+ --pkg-url [string] Package vendor url
45
+ --pkg-license [string] Package license
46
+ --pkg-config-files [string] Files or directories considered as conf in the targeted OS
47
+ (can be declared multiple time)
48
+ --pkg-depends [string] Package dependancie
49
+ (can be declared multiple times)
50
+ --pkg-suffix [string] Package suffix
51
+ --pkg-changelog [string] Package changelog (in the wanted format for the package)
52
+ --pkg-force [yes|no] Force package generation even if the same name exists
53
+ --pkg-category [string] Category for this package
54
+ --pkg-provides [string] A tag of what provides this package
55
+ (can be declared multiple times)
56
+ --pkg-conflicts [string] Other packages that conflict with that one
57
+ (can be declared multiple times)
58
+ --pkg-recommends [string] Other package to recommend
59
+ (can be declared multiple times)
60
+ --pkg-suggests [string] Other package to suggests
61
+ (can be declared multiple times)
62
+ --pkg-directories [string] Mark recursively a directory on the targeted system as being owned by the package
63
+ (can be declared multiple times)
64
+ --pkg-maintainer [string] The maintainer of this package
65
+ --pkg-compression [string] The compression to use with this package (may not be possible)
66
+ --pkg-priority [string] The package 'priority' (depends of the targetted package type
67
+ --pkg-replaces [string] Other packages this package replace
68
+ (can be declared multiple times)
69
+ -v, --verbose Verbose mode
70
+ --debug Debug mode
71
+ -n, --dry-run Do not exec fpm, juste print what would be done
72
+ --version Display version and quit
73
+ --label-list Display the availables labels and quit
74
+ --help Display help and quit
75
+ ```
76
+
77
+ Example of config file
78
+ ----------------------
79
+
80
+ this config file can be found in easyfpm/doc/samples/easyfpm.cfg
81
+
82
+ ```shell
83
+ #############################
84
+ # easyfpm sample conf
85
+ #############################
86
+
87
+ #
88
+ # All of these parameters can be overloaded on command-line with --key value
89
+ # Example : --pkg-name easyfpm
90
+ #
91
+ # All the params with an uniline value (see fpm doc) can be templated on this script with {{key}}
92
+ # Example : pkg-mapping={{pkg-src-dir}}/_easyfpm/mapping.conf
93
+ #
94
+
95
+ #
96
+ # For each couple value key, the priority for value is :
97
+ # 1) the --key value given in command line
98
+ # 2) the key=value present in a [section]
99
+ # 3) the key=value in global section (before any [section] declaration)
100
+ #
101
+
102
+ #
103
+ # Package name
104
+ pkg-name=easyfpm
105
+
106
+ #
107
+ # Description
108
+ #
109
+ pkg-description="Tool wrapper for fpm"
110
+ pkg-description="aimly used to packages scripts"
111
+
112
+ #
113
+ # Package metadata
114
+ #
115
+ pkg-vendor=Erwan SEITE
116
+ pkg-url=https://github.com/wanix/easyfpm
117
+ pkg-licence=GPLv2
118
+
119
+
120
+ #
121
+ # Root dir for target system
122
+ # Default : /
123
+ #
124
+ pkg-prefix=/usr/local
125
+
126
+ #
127
+ # Source directory
128
+ # If --pkg-src-dir is given on command line, this value has no effect
129
+ #pkg-src-dir=
130
+
131
+ #
132
+ # aimed arch
133
+ #
134
+ pkg-arch=all
135
+
136
+ #
137
+ # If pkg-mapping is given, pkg-content has no effect, see the mapping example
138
+ #
139
+ #pkg-mapping={{pkg-src-dir}}/_easyfpm/mapping.conf
140
+
141
+ #
142
+ # user or group for the packaged file
143
+ # They MUST exists on the host which make the package
144
+ # default by fpm : root
145
+ #pkg-user=myname
146
+ #pkg-group=mygroup
147
+
148
+ #
149
+ # If template-activated is "yes", fpm will manage its templating (it is not the easyfpm one !)
150
+ template-activated=no
151
+
152
+ #
153
+ # See fpm doc for templating use in your packages' scripts
154
+ #template-value=oracle_group=dba
155
+
156
+ #
157
+ # Packages scripts if needed, see samples
158
+ #
159
+ #pkg-preinst={{pkg-src-dir}}/_easyfpm/pre-install.sh
160
+ #pkg-postinst={{pkg-src-dir}}/_easyfpm/post-install.sh
161
+ #pkg-prerm={{pkg-src-dir}}/_easyfpm/pre-delete.sh
162
+ #pkg-postrm={{pkg-src-dir}}/_easyfpm/post-delete.sh
163
+
164
+
165
+ #
166
+ # Package version
167
+ # Given by command line for my use
168
+ #pkg-version=
169
+
170
+ #
171
+ # See fpm doc for this two values
172
+ #
173
+ pkg-iteration=1
174
+ #pkg-epoch=0
175
+
176
+
177
+ #
178
+ # If easyfpm-pkg-changelog is given AND pkg-changelog is not for a package generation,
179
+ # then easyfpm will generate a changelog in the format waited by the package (easyfpm-tranlatecl)
180
+ # The easyfpm changelog have a simple specific format (aim : administrators who make scripts)
181
+ easyfpm-pkg-changelog={{pkg-src-dir}}/changelog
182
+
183
+
184
+ #
185
+ # Which files can be seen as conf file on the target system
186
+ #
187
+ pkg-config-files={{pkg-prefix}}/MONMODULECLIENT/cfg
188
+
189
+
190
+ #############################
191
+ # Specific sections
192
+ #############################
193
+ #
194
+ # With the command line, you can make only the wanted sections with --label
195
+ # Example: --label debian6 --label debian7
196
+ # By default, easyfpm make all sections given
197
+
198
+
199
+ [debian6]
200
+ #Specific section for debian (the name I choose, not asked by easyfpm)
201
+
202
+ #
203
+ # Package type
204
+ #
205
+ pkg-type=deb
206
+
207
+ #
208
+ # Dependancies
209
+ pkg-depends=ruby1.9.1
210
+ pkg-depends=libruby-unixconfigstyle >= 1.0.0
211
+ pkg-depends=libruby-ptools >= 1.2.4
212
+ pkg-depends=libruby-fpm >= 1.1.0
213
+
214
+ #
215
+ # Suffix in the package name (concat with iteration for fpm)
216
+ #
217
+ pkg-suffix=-squeeze
218
+
219
+ [debian7]
220
+ #For Debian7 (not the same ruby name in depends)
221
+ pkg-type=deb
222
+ pkg-depends=ruby >= 1.9.1
223
+ pkg-depends=libruby-unixconfigstyle >= 1.0.0
224
+ pkg-depends=libruby-ptools >= 1.2.4
225
+ pkg-depends=libruby-fpm >= 1.1.0
226
+ pkg-suffix=-wheezy
227
+
228
+ ```
229
+
230
+ Example of mapping file
231
+ -----------------------
232
+
233
+ this config file can be found in esasyfpm/doc/samples/easyfpm.cfg
234
+
235
+ ```
236
+ #
237
+ # This is a mapping sample
238
+ #
239
+ # source file (root dir is pkg-src-dir) => destination (root dir is pkg-prefix)
240
+ #
241
+
242
+ #This example suppose we want to package an apache specific configuration
243
+ # Tree on dev
244
+ # myapp
245
+ # conf.d/myapp.conf
246
+ # site/<php code>
247
+ # doc
248
+ #
249
+ # the pkg-source-dir is /home/packager/retrieve/myapp
250
+ # the pkg-prefix is /
251
+
252
+ conf.d/myapp.conf => etc/apache2/site-available/myapp.conf
253
+ site => app/httpd/www/myapp
254
+ doc => usr/share/doc/myapp
255
+
256
+ ```
257
+
258
+ Example of use
259
+ --------------
260
+
261
+ This tool can be used to make multiple packages in one shot.
262
+ I made for my company a wrapper which get a module in our CSV, look for an _easyfpm dir an then execute easyfpm with _easyfpm/easyfpm.cfg as config file.
263
+
264
+ consider the following module:
265
+ ```
266
+ ExampleModule
267
+ |
268
+ ---> _easyfpm
269
+ |
270
+ ---> easyfpm.cfg
271
+ ---> mapping_exampleModule.conf
272
+ ---> pre-install.sh
273
+ ---> post-delete.sh
274
+ ---> post-install.sh
275
+ ---> bin
276
+ |
277
+ ---> EM_doMyJob.sh
278
+ ---> EM_verifyIt.sh
279
+ ---> cfg
280
+ |
281
+ ---> EM_doMyJob.conf
282
+ ---> cron.d
283
+ |
284
+ ---> EM_doMyJob
285
+ ```
286
+
287
+ To deploy this module, I want to verify the existence of user exmoduser and create it if it not exists.This is done by pre-install.sh
288
+ To uninstall this module, I delete all the files from it and remove the user exmoduser. This last action is done by post-delete.sh.
289
+
290
+ I want to deploy bin/*.sh in /exploit/bin/
291
+ I want to deploy cfg/*.conf in /exploit/cfg/
292
+ I want to deploy cron.d/* in /etc/cron.d/
293
+ This mapping is done by mapping_exampleModule.conf
294
+
295
+ I want the file deployed in bin to be executable and owned by exmoduser and the config files in /exploit/cfg/ should be readable by exmoduser, this is done by post-install.sh
296
+
297
+ The wrapper is easy to use for admins, they launche on the build machine the following command:
298
+
299
+ makePackage --module ExampleModule --version 1.0
300
+
301
+ this command get the tag 1.0 of module ExampleModule on our git server an after launch easyfpm with a command like this :
302
+ easyfpm --config-file /packaging/cfg/makepackages/default-easyfpm.conf --config-file /packaging/tempodata/ExampleModule/_easyfpm/easyfpm.cfg --pkg-src-dir /packaging/tempodata/ExampleModule --pkg-version 1.0 --pkg-output-dir /packaging/output
303
+
304
+ After few seconds, we have 5 new packages generated in /packaging/output:
305
+ * ExampleModule_1.0-1_all-squeeze.deb
306
+ * ExampleModule_1.0-1_all-wheezy.deb
307
+ * ExampleModule-1.0-1.el5.noarch.rpm
308
+ * ExampleModule-1.0-1.el6.noarch.rpm
309
+ * ExampleModule-1.0-1.el7.noarch.rpm
310
+
311
+ Projects using easyfpm:
312
+ -----------------------
313
+ * https://github.com/wanix/mkpackage-tomcat7
@@ -69,7 +69,7 @@ template-activated=no
69
69
 
70
70
  #
71
71
  # See fpm doc for templating use in your scripts
72
- #template-value=oracle_group:dba
72
+ #template-value=oracle_group=dba
73
73
 
74
74
  #
75
75
  # Packages scripts if needed, see samples
@@ -143,11 +143,3 @@ pkg-depends=libruby-ptools >= 1.2.4
143
143
  pkg-depends=libruby-fpm >= 1.1.0
144
144
  pkg-suffix=-wheezy
145
145
 
146
- [gem]
147
- #For future use
148
- pkg-type=gem
149
- pkg-depends=ruby >= 1.9.1
150
- pkg-depends=unixconfigstyle >= 1.0.0
151
- pkg-depends=ptools >= 1.2.4
152
- pkg-depends=fpm >= 1.1.0
153
-
@@ -1,4 +1,4 @@
1
1
  #EASYFPM Module version
2
2
  module EASYFPM
3
- VERSION = "0.2.1-dev"
3
+ VERSION = "0.3.0-dev"
4
4
  end
metadata CHANGED
@@ -1,80 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: easyfpm
3
- version: !ruby/object:Gem::Version
4
- hash: 961915984
5
- prerelease: true
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- - pre
11
- version: 0.2.1.pre
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0.pre
12
5
  platform: ruby
13
- authors:
6
+ authors:
14
7
  - Erwan SEITE
15
8
  autorequire:
16
9
  bindir: bin
17
10
  cert_chain: []
18
-
19
- date: 2014-06-13 00:00:00 +02:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
23
14
  name: ptools
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
28
17
  - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 23
31
- segments:
32
- - 1
33
- - 2
34
- - 4
18
+ - !ruby/object:Gem::Version
35
19
  version: 1.2.4
36
20
  type: :runtime
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: fpm
40
21
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: fpm
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
44
31
  - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 19
47
- segments:
48
- - 1
49
- - 1
50
- - 0
32
+ - !ruby/object:Gem::Version
51
33
  version: 1.1.0
52
34
  type: :runtime
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: unixconfigstyle
56
35
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
60
38
  - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 23
63
- segments:
64
- - 1
65
- - 0
66
- - 0
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: unixconfigstyle
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
67
47
  version: 1.0.0
68
48
  type: :runtime
69
- version_requirements: *id003
70
- 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"
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.0
55
+ description: |2
56
+ Simplify packaging with fpm by using config files.
57
+ The aim is to have 1 config file to create many packages for one script module (deb, rpm).
58
+ 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.
71
59
  email: wanix.fr@gmail.com
72
- executables:
60
+ executables:
73
61
  - easyfpm
74
62
  - easyfpm-translatecl
75
63
  extensions: []
76
-
77
- extra_rdoc_files:
64
+ extra_rdoc_files:
78
65
  - README.md
79
66
  - LICENSE
80
67
  - THANKS
@@ -85,65 +72,50 @@ extra_rdoc_files:
85
72
  - doc/samples/install_scripts/post-delete.sh
86
73
  - doc/samples/install_scripts/pre-delete.sh
87
74
  - doc/samples/install_scripts/pre-install.sh
88
- files:
89
- - lib/easyfpm.rb
90
- - lib/easyfpm/exceptions.rb
91
- - lib/easyfpm/pkgchangelog.rb
92
- - lib/easyfpm/packaging.rb
93
- - lib/easyfpm/namespace.rb
94
- - lib/easyfpm/mapping.rb
95
- - lib/easyfpm/version.rb
96
- - lib/easyfpm/commandline.rb
97
- - lib/easyfpm/configuration.rb
98
- - README.md
75
+ files:
99
76
  - LICENSE
77
+ - README.md
100
78
  - THANKS
79
+ - bin/easyfpm
80
+ - bin/easyfpm-translatecl
101
81
  - changelog
102
82
  - doc/samples/easyfpm.cfg
103
- - doc/samples/mapping.conf
104
- - doc/samples/install_scripts/post-install.sh
105
83
  - doc/samples/install_scripts/post-delete.sh
84
+ - doc/samples/install_scripts/post-install.sh
106
85
  - doc/samples/install_scripts/pre-delete.sh
107
86
  - doc/samples/install_scripts/pre-install.sh
108
- - bin/easyfpm
109
- - bin/easyfpm-translatecl
110
- has_rdoc: true
87
+ - doc/samples/mapping.conf
88
+ - lib/easyfpm.rb
89
+ - lib/easyfpm/commandline.rb
90
+ - lib/easyfpm/configuration.rb
91
+ - lib/easyfpm/exceptions.rb
92
+ - lib/easyfpm/mapping.rb
93
+ - lib/easyfpm/namespace.rb
94
+ - lib/easyfpm/packaging.rb
95
+ - lib/easyfpm/pkgchangelog.rb
96
+ - lib/easyfpm/version.rb
111
97
  homepage: https://github.com/wanix/easyfpm
112
- licenses:
98
+ licenses:
113
99
  - GPLv2
100
+ metadata: {}
114
101
  post_install_message:
115
102
  rdoc_options: []
116
-
117
- require_paths:
103
+ require_paths:
118
104
  - lib
119
- required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
- requirements:
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
122
107
  - - ">="
123
- - !ruby/object:Gem::Version
124
- hash: 49
125
- segments:
126
- - 1
127
- - 9
128
- - 1
108
+ - !ruby/object:Gem::Version
129
109
  version: 1.9.1
130
- required_rubygems_version: !ruby/object:Gem::Requirement
131
- none: false
132
- requirements:
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
133
112
  - - ">"
134
- - !ruby/object:Gem::Version
135
- hash: 25
136
- segments:
137
- - 1
138
- - 3
139
- - 1
113
+ - !ruby/object:Gem::Version
140
114
  version: 1.3.1
141
115
  requirements: []
142
-
143
116
  rubyforge_project:
144
- rubygems_version: 1.3.7
117
+ rubygems_version: 2.2.2
145
118
  signing_key:
146
- specification_version: 3
119
+ specification_version: 4
147
120
  summary: Wrapper for fpm
148
121
  test_files: []
149
-