fpm 1.9.3 → 1.12.0

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.
@@ -1,4 +1,4 @@
1
- require "backports" # gem backports
1
+ require "backports/latest" # gem backports/latest
2
2
  require "fpm/package"
3
3
  require "fpm/util"
4
4
  require "fileutils"
@@ -111,8 +111,7 @@ class FPM::Package::Virtualenv < FPM::Package
111
111
  # Why is this hack here? It looks important, so I'll keep it in.
112
112
  safesystem(python_exe, pip_exe, "install", "-U", "-i",
113
113
  attributes[:virtualenv_pypi],
114
- "pip", "distribute")
115
- safesystem(python_exe, pip_exe, "uninstall", "-y", "distribute")
114
+ "pip")
116
115
 
117
116
  extra_index_url_args = []
118
117
  if attributes[:virtualenv_pypi_extra_index_urls]
@@ -1,4 +1,4 @@
1
- require "backports" # gem backports
1
+ require "backports/latest" # gem backports/latest
2
2
  require "fpm/package"
3
3
  require "fpm/util"
4
4
  require "fileutils"
@@ -29,7 +29,7 @@ end # module FPM
29
29
 
30
30
  module FPM; module Util; end; end
31
31
 
32
- # Like the ::Gem::Package::TarWriter but contains some backports and bug fixes
32
+ # Like the ::Gem::Package::TarWriter but contains some backports/latest and bug fixes
33
33
  class FPM::Util::TarWriter < ::Gem::Package::TarWriter
34
34
  if FPM::Issues::TarWriter.has_issues_with_split_name?
35
35
  def split_name(name)
@@ -1,3 +1,3 @@
1
1
  module FPM
2
- VERSION = "1.9.3"
2
+ VERSION = "1.12.0"
3
3
  end
@@ -28,7 +28,7 @@ Build-Depends: <%= attributes[:deb_build_depends].collect { |d| fix_dependency(d
28
28
  Provides: <%= provides.map {|p| p.split(" ").first}.join ", " %>
29
29
  <% end -%>
30
30
  <% if !replaces.empty? -%>
31
- Replaces: <%= replaces.join(", ") %>
31
+ Replaces: <%= replaces.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
32
32
  <% end -%>
33
33
  <% if attributes[:deb_recommends] and !attributes[:deb_recommends].empty? -%>
34
34
  Recommends: <%= attributes[:deb_recommends].collect { |d| fix_dependency(d) }.flatten.join(", ") %>
@@ -0,0 +1,30 @@
1
+ Format: 1.8
2
+ Date: <%= (if attributes[:source_date_epoch].nil? then Time.now() else Time.at(attributes[:source_date_epoch].to_i) end).strftime("%a, %d %b %Y %T %z") %>
3
+ Source: <%= name %>
4
+ Binary: <%= name %>
5
+ Architecture: <%= architecture %>
6
+ Version: <%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>
7
+ Distribution: <%= distribution %>
8
+ Urgency: medium
9
+ Maintainer: <%= maintainer %>
10
+ <% lines = (description or "no description given").split("\n") -%>
11
+ <% firstline, *remainder = lines -%>
12
+ Description: <%= firstline %>
13
+ <% if remainder.any? -%>
14
+ <%= remainder.collect { |l| l =~ /^ *$/ ? " ." : " #{l}" }.join("\n") %>
15
+ <% end -%>
16
+ Changes:
17
+ <%= name %> (<%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>) whatever; urgency=medium
18
+ * Package created with FPM.
19
+ Checksums-Sha1:
20
+ <% changes_files.each do |file| -%>
21
+ <%= file[:sha1sum] %> <%= file[:size] %> <%= file[:name] %>
22
+ <% end -%>
23
+ Checksums-Sha256:
24
+ <% changes_files.each do |file| -%>
25
+ <%= file[:sha256sum] %> <%= file[:size] %> <%= file[:name] %>
26
+ <% end -%>
27
+ Files:
28
+ <% changes_files.each do |file| -%>
29
+ <%= file[:md5sum] %> <%= file[:size] %> default <%= attributes[:deb_priority] %> <%= file[:name] %>
30
+ <% end -%>
@@ -1,4 +1,9 @@
1
1
  #!/bin/sh
2
+
3
+ <% if attributes[:deb_maintainerscripts_force_errorchecks?] -%>
4
+ set -e
5
+ <% end -%>
6
+
2
7
  after_upgrade() {
3
8
  <%# Making sure that at least one command is in the function -%>
4
9
  <%# avoids a lot of potential errors, including the case that -%>
@@ -8,18 +13,26 @@ after_upgrade() {
8
13
  <%= script(:after_upgrade) %>
9
14
  <% end -%>
10
15
 
11
- <% if attributes[:deb_systemd] -%>
16
+ <%# if any systemd services specified, loop through and start them -%>
17
+ <% if attributes[:deb_systemd].any? -%>
12
18
  systemctl --system daemon-reload >/dev/null || true
13
- if ! systemctl is-enabled <%= attributes[:deb_systemd] %> >/dev/null
19
+ debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
20
+ <% attributes[:deb_systemd].each do |service| -%>
21
+ if ! systemctl is-enabled <%= service %> >/dev/null
14
22
  then
15
- systemctl enable <%= attributes[:deb_systemd] %> >/dev/null || true
16
- systemctl start <%= attributes[:deb_systemd] %> >/dev/null || true
23
+ <% if attributes[:deb_systemd_enable?]-%>
24
+ systemctl enable <%= service %> >/dev/null || true
25
+ <% end -%>
26
+ <% if attributes[:deb_systemd_auto_start?]-%>
27
+ $debsystemctl start <%= service %> >/dev/null || true
28
+ <% end -%>
17
29
  <% if attributes[:deb_systemd_restart_after_upgrade?] -%>
18
30
  else
19
- systemctl restart <%= attributes[:deb_systemd] %> >/dev/null || true
31
+ $debsystemctl restart <%= service %> >/dev/null || true
20
32
  <% end -%>
21
33
  fi
22
34
  <% end -%>
35
+ <% end -%>
23
36
  }
24
37
 
25
38
  after_install() {
@@ -31,10 +44,18 @@ after_install() {
31
44
  <%= script(:after_install) %>
32
45
  <% end -%>
33
46
 
34
- <% if attributes[:deb_systemd] -%>
47
+ <%# if any systemd services specified, loop through and start them -%>
48
+ <% if attributes[:deb_systemd].any? -%>
35
49
  systemctl --system daemon-reload >/dev/null || true
36
- systemctl enable <%= attributes[:deb_systemd] %> >/dev/null || true
37
- systemctl start <%= attributes[:deb_systemd] %> >/dev/null || true
50
+ debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
51
+ <% attributes[:deb_systemd].each do |service| -%>
52
+ <% if attributes[:deb_systemd_enable?]-%>
53
+ systemctl enable <%= service %> >/dev/null || true
54
+ <% end -%>
55
+ <% if attributes[:deb_systemd_auto_start?]-%>
56
+ $debsystemctl start <%= service %> >/dev/null || true
57
+ <% end -%>
58
+ <% end -%>
38
59
  <% end -%>
39
60
  }
40
61
 
@@ -1,4 +1,9 @@
1
1
  #!/bin/sh
2
+
3
+ <% if attributes[:deb_maintainerscripts_force_errorchecks?] -%>
4
+ set -e
5
+ <% end -%>
6
+
2
7
  after_remove() {
3
8
  <%# Making sure that at least one command is in the function -%>
4
9
  <%# avoids a lot of potential errors, including the case that -%>
@@ -1,4 +1,9 @@
1
1
  #!/bin/sh
2
+
3
+ <% if attributes[:deb_maintainerscripts_force_errorchecks?] -%>
4
+ set -e
5
+ <% end -%>
6
+
2
7
  before_upgrade() {
3
8
  <%# Making sure that at least one command is in the function -%>
4
9
  <%# avoids a lot of potential errors, including the case that -%>
@@ -1,4 +1,9 @@
1
1
  #!/bin/sh
2
+
3
+ <% if attributes[:deb_maintainerscripts_force_errorchecks?] -%>
4
+ set -e
5
+ <% end -%>
6
+
2
7
  before_remove() {
3
8
  <%# Making sure that at least one command is in the function -%>
4
9
  <%# avoids a lot of potential errors, including the case that -%>
@@ -8,10 +13,13 @@ before_remove() {
8
13
  <%= script(:before_remove) %>
9
14
  <% end -%>
10
15
 
11
- <%# Removing the systemd service-%>
12
- <% if attributes[:deb_systemd] -%>
13
- systemctl stop <%= attributes[:deb_systemd] %> >/dev/null || true
14
- systemctl disable <%= attributes[:deb_systemd] %> >/dev/null || true
16
+ <%# Stop and remove any systemd services that were installed-%>
17
+ <% if attributes[:deb_systemd].any? -%>
18
+ debsystemctl=$(command -v deb-systemd-invoke || echo systemctl)
19
+ <% attributes[:deb_systemd].each do |service| -%>
20
+ $debsystemctl stop <%= service %> >/dev/null || true
21
+ systemctl disable <%= service %> >/dev/null || true
22
+ <% end -%>
15
23
  systemctl --system daemon-reload >/dev/null || true
16
24
  <% end -%>
17
25
  }
@@ -17,6 +17,9 @@
17
17
  # Disable checking for unpackaged files ?
18
18
  #%undefine __check_files
19
19
 
20
+ # Allow building noarch packages that contain binaries
21
+ %define _binaries_in_noarch_packages_terminate_build 0
22
+
20
23
  # Use <%= attributes[:rpm_digest] %> file digest method.
21
24
  # The first macro is the one used in RPM v4.9.1.1
22
25
  %define _binary_filedigest_algorithm <%= digest_algorithm %>
@@ -123,7 +126,7 @@ Obsoletes: <%= repl %>
123
126
  -%>
124
127
  <% if script?(:before_upgrade) or script?(:after_upgrade) -%>
125
128
  <% if script?(:before_upgrade) or script?(:before_install) -%>
126
- %pre
129
+ %pre <% if attributes[:rpm_macro_expansion?] -%><%= " -e " %> <% end -%>
127
130
  upgrade() {
128
131
  <%# Making sure that at least one command is in the function -%>
129
132
  <%# avoids a lot of potential errors, including the case that -%>
@@ -133,7 +136,7 @@ upgrade() {
133
136
  <%= script(:before_upgrade) %>
134
137
  <% end -%>
135
138
  }
136
- install() {
139
+ _install() {
137
140
  <%# Making sure that at least one command is in the function -%>
138
141
  <%# avoids a lot of potential errors, including the case that -%>
139
142
  <%# the script is non-empty, but just whitespace and/or comments -%>
@@ -145,7 +148,7 @@ install() {
145
148
  if [ "${1}" -eq 1 ]
146
149
  then
147
150
  # "before install" goes here
148
- install
151
+ _install
149
152
  elif [ "${1}" -gt 1 ]
150
153
  then
151
154
  # "before upgrade" goes here
@@ -153,7 +156,7 @@ then
153
156
  fi
154
157
  <% end -%>
155
158
  <% if script?(:after_upgrade) or script?(:after_install) -%>
156
- %post
159
+ %post <% if attributes[:rpm_macro_expansion?] -%><%= " -e " %> <% end -%>
157
160
  upgrade() {
158
161
  <%# Making sure that at least one command is in the function -%>
159
162
  <%# avoids a lot of potential errors, including the case that -%>
@@ -163,7 +166,7 @@ upgrade() {
163
166
  <%= script(:after_upgrade) %>
164
167
  <% end -%>
165
168
  }
166
- install() {
169
+ _install() {
167
170
  <%# Making sure that at least one command is in the function -%>
168
171
  <%# avoids a lot of potential errors, including the case that -%>
169
172
  <%# the script is non-empty, but just whitespace and/or comments -%>
@@ -175,7 +178,7 @@ install() {
175
178
  if [ "${1}" -eq 1 ]
176
179
  then
177
180
  # "after install" goes here
178
- install
181
+ _install
179
182
  elif [ "${1}" -gt 1 ]
180
183
  then
181
184
  # "after upgrade" goes here
@@ -183,7 +186,7 @@ then
183
186
  fi
184
187
  <% end -%>
185
188
  <% if script?(:before_remove) -%>
186
- %preun
189
+ %preun <% if attributes[:rpm_macro_expansion?] -%><%= " -e " %> <% end -%>
187
190
  if [ "${1}" -eq 0 ]
188
191
  then
189
192
  <%# Making sure that at least one command is in the function -%>
@@ -194,7 +197,7 @@ then
194
197
  fi
195
198
  <% end -%>
196
199
  <% if script?(:after_remove) -%>
197
- %postun
200
+ %postun <% if attributes[:rpm_macro_expansion?] -%><%= " -e " %> <% end -%>
198
201
  if [ "${1}" -eq 0 ]
199
202
  then
200
203
  <%# Making sure that at least one command is in the function -%>
@@ -216,7 +219,7 @@ fi
216
219
  -%>
217
220
  <% scriptmap.each do |name, rpmname| -%>
218
221
  <% if script?(name) -%>
219
- %<%= rpmname %>
222
+ %<%= rpmname -%> <%= ' -e' if attributes[:rpm_macro_expansion?] %>
220
223
  <%= script(name) %>
221
224
  <% end -%>
222
225
  <% end -%>
@@ -268,7 +268,12 @@ function clean_out_old_releases(){
268
268
  function print_package_metadata(){
269
269
  local metadata_line=$(grep -a -n -m1 '__METADATA__$' $0 | sed 's/:.*//')
270
270
  local archive_line=$(grep -a -n -m1 '__ARCHIVE__$' $0 | sed 's/:.*//')
271
- sed -n "$((metadata_line + 1)),$((archive_line - 1)) p" $0
271
+
272
+ # This used to be a sed call but it was taking _forever_ and this method is super fast
273
+ local start_at=$((metadata_line + 1))
274
+ local take_num=$((archive_line - start_at))
275
+
276
+ head -n${start_at} $0 | tail -n${take_num}
272
277
  }
273
278
 
274
279
  function print_usage(){
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-20 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 1.7.7
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 1.7.7
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: cabin
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -90,30 +90,30 @@ dependencies:
90
90
  name: childprocess
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - "<"
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
95
+ version: 1.0.0
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: '0'
102
+ version: 1.0.0
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: ffi
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: 1.12.0
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ">="
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '0'
116
+ version: 1.12.0
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: rake
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -132,16 +132,16 @@ dependencies:
132
132
  name: ruby-xz
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">="
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '0'
137
+ version: 0.2.3
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '0'
144
+ version: 0.2.3
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: pleaserun
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,26 @@ dependencies:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
158
  version: 0.0.29
159
+ - !ruby/object:Gem::Dependency
160
+ name: git
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: 1.3.0
166
+ - - "<"
167
+ - !ruby/object:Gem::Version
168
+ version: '2.0'
169
+ type: :runtime
170
+ prerelease: false
171
+ version_requirements: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: 1.3.0
176
+ - - "<"
177
+ - !ruby/object:Gem::Version
178
+ version: '2.0'
159
179
  - !ruby/object:Gem::Dependency
160
180
  name: stud
161
181
  requirement: !ruby/object:Gem::Requirement
@@ -250,6 +270,7 @@ files:
250
270
  - lib/fpm/package/python.rb
251
271
  - lib/fpm/package/rpm.rb
252
272
  - lib/fpm/package/sh.rb
273
+ - lib/fpm/package/snap.rb
253
274
  - lib/fpm/package/solaris.rb
254
275
  - lib/fpm/package/tar.rb
255
276
  - lib/fpm/package/virtualenv.rb
@@ -260,6 +281,7 @@ files:
260
281
  - lib/fpm/version.rb
261
282
  - templates/deb.erb
262
283
  - templates/deb/changelog.erb
284
+ - templates/deb/deb.changes.erb
263
285
  - templates/deb/ldconfig.sh.erb
264
286
  - templates/deb/postinst_upgrade.sh.erb
265
287
  - templates/deb/postrm_upgrade.sh.erb
@@ -293,7 +315,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
315
  requirements:
294
316
  - - ">="
295
317
  - !ruby/object:Gem::Version
296
- version: '0'
318
+ version: 1.9.3
297
319
  required_rubygems_version: !ruby/object:Gem::Requirement
298
320
  requirements:
299
321
  - - ">="
@@ -301,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
323
  version: '0'
302
324
  requirements: []
303
325
  rubyforge_project:
304
- rubygems_version: 2.6.11
326
+ rubygems_version: 2.7.6
305
327
  signing_key:
306
328
  specification_version: 4
307
329
  summary: fpm - package building and mangling