fpm 1.10.0 → 1.13.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.
- checksums.yaml +5 -5
- data/CHANGELOG.rst +51 -1
- data/lib/fpm.rb +1 -0
- data/lib/fpm/package.rb +2 -2
- data/lib/fpm/package/apk.rb +1 -1
- data/lib/fpm/package/cpan.rb +6 -6
- data/lib/fpm/package/deb.rb +89 -19
- data/lib/fpm/package/dir.rb +3 -3
- data/lib/fpm/package/empty.rb +1 -1
- data/lib/fpm/package/freebsd.rb +15 -20
- data/lib/fpm/package/gem.rb +39 -12
- data/lib/fpm/package/pacman.rb +22 -10
- data/lib/fpm/package/python.rb +29 -2
- data/lib/fpm/package/rpm.rb +31 -9
- data/lib/fpm/package/sh.rb +1 -1
- data/lib/fpm/package/snap.rb +130 -0
- data/lib/fpm/package/tar.rb +1 -1
- data/lib/fpm/package/virtualenv.rb +1 -2
- data/lib/fpm/package/zip.rb +1 -1
- data/lib/fpm/util.rb +29 -46
- data/lib/fpm/util/tar_writer.rb +1 -1
- data/lib/fpm/version.rb +1 -1
- data/templates/deb.erb +1 -1
- data/templates/deb/deb.changes.erb +2 -3
- data/templates/deb/postinst_upgrade.sh.erb +30 -8
- data/templates/deb/postrm_upgrade.sh.erb +5 -0
- data/templates/deb/preinst_upgrade.sh.erb +5 -0
- data/templates/deb/prerm_upgrade.sh.erb +12 -4
- data/templates/rpm.erb +5 -5
- data/templates/sh.erb +6 -1
- metadata +38 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f231a03d2baac73ae0f4f8f15094237ca94ec43de51ef0b86dde886a8647efa2
|
|
4
|
+
data.tar.gz: 91666a6a7b09b6f3ab3bb6dccf32e647d58a43754d2163a4748ae8a2e14515e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b21d482730c5e532f9bf6f9e7faf51bf712aa9f75ebab9b8453d1f1b9cd9f1e0ef5a32bb84f18808bc5bc8c15a8e1c47546ad1d474e9c3c581eaa7afe85e80b9
|
|
7
|
+
data.tar.gz: 72963da4b7601fa8d416ab20ce26e15838960b7dca9c364b38312266857e3beb9b11b32a9c708ff393a612f0e5ff350b6098fd794c4b5b05fe767c0a4323dfdd
|
data/CHANGELOG.rst
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
Release Notes and Change Log
|
|
2
2
|
============================
|
|
3
3
|
|
|
4
|
+
1.13.0 (June 19, 2021)
|
|
5
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
|
6
|
+
* Apple M1 users should now work (`#1772`_, `#1785`_, `#1786`_; Jordan Sissel)
|
|
7
|
+
* Removed `ffi` ruby library as a dependency. This should make it easier to support a wider range of Ruby versions (Ruby 2.2, 3.0, etc) and platforms (like arm64, Apple M1, etc) in the future. (`#1785`_, `#1786`_; Jordan Sissel)
|
|
8
|
+
* Now uses the correct architecture synonym for ARM 64 systems. Debian uses `arm64` as a synonym for what other systems call `aarch64` (linux kernel, RPM, Arch Linux). (`#1775`_; Steve Kamerman)
|
|
9
|
+
* Docs: Fix a typo in an example (`#1785`_; Zoe O'Connell)
|
|
10
|
+
* rpm: File paths can now contain single-quote characters (`#1774`_; Jordan Sissel)
|
|
11
|
+
* rpm: Use correct SPEC syntax when using --after-upgrade or similar features (`#1761`_; Jo Vandeginste. Robert Fielding)
|
|
12
|
+
* Ruby 3.0 support: Added `rexml` as a runtime dependency. In Ruby 2.0, `rexml` came by default, but in Ruby 3.0, `rexml` is now a bundled gem and some distributiosn do not include it by default. (`#1794`_; Jordan Sissel)
|
|
13
|
+
* Fix error "git: not found (Git::GitExecuteError)". Now loads `git` library only when using git features. (`#1753`_, `#1748`_, `#1751`_, `#1766`_; Jordan Sissel, Cameron Nemo, Jason Rogers, Luke Short)
|
|
14
|
+
* deb: Fix syntax error in `postinst` (`--after-install`) script. (`#1752`_, `#1749`_, `#1764`_; rmanus, Adam Mohammed, Elliot Murphy, kimw, Jordan Sissel)
|
|
15
|
+
* deb: --deb-compression now uses the same compression and file suffix on the control.tar file (`#1760`_; Philippe Poilbarbe
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
1.12.0 (January 19, 2021)
|
|
20
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
21
|
+
|
|
22
|
+
* Pin ffi dependency to ruby ffi 1.12.x to try keeping fpm compatible with older/abandoned rubies like 2.0 and 2.1. (`#1709`_; Matt Patterson)
|
|
23
|
+
* deb: New flag to add 'set -e' to all scripts. `--deb-maintainerscripts-force-errorchecks` which defaults to off. (`#1697`_; Andreas Ulm)
|
|
24
|
+
* deb: Fix bug when converting rubygems to debs where certain constraints like `~>1` would generate a deb dependency that couldn't be satisfied. (`#1699`_; Vlastimil Holer)
|
|
25
|
+
* deb: Fix error 'uninitialized constant FPM::Package::Deb::Zlib' (`#1739`_, `#1740`_; Federico Lancerin)
|
|
26
|
+
* python: Prepend to PYTHONPATH instead of replacing it. This should help on platforms that rely heavily on PYTHONPATH, such as NixOSX (`#1711`_, `#1710`_; anarg)
|
|
27
|
+
* python: Add `--python-trusted-host` flag which passes `--trusted-host` flag to `pip` (`#1737`_; Vladimir Ponarevsky)
|
|
28
|
+
* Documentation improvements (`#1724`_, `#1738`_, `#1667`_, `#1636`_)
|
|
29
|
+
* Dockerfile updated to Alpine 3.12 (`#1745`_; Cameron Nemo)
|
|
30
|
+
* Remove the 'backports' deprecation warning (`#1727`_; Jose Galvez)
|
|
31
|
+
* sh: Performance improvement when printing package metadata (`#1729`_; James Logsdon, Ed Healy)
|
|
32
|
+
* rpm: Add support for `xzmt` compression (multithreaded xz compressor) to help when creating very large packages (several gigabytes). (`#1447`_, `#1419`_; amnobc)
|
|
33
|
+
* rpm: Add `--rpm-macro-expansion` flag to enable macro expansion in scripts during rpmbuild. See https://rpm.org/user_doc/scriptlet_expansion.html for more details. (`#1642`_; juliantrzeciak)
|
|
34
|
+
* deb: use correct control.tar filename (`#1668`_; Mike Perham)
|
|
35
|
+
|
|
36
|
+
1.11.0 (January 30, 2019)
|
|
37
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
38
|
+
|
|
39
|
+
* snap: Snap packages can now be created! (`#1490`_; kyrofa)
|
|
40
|
+
* Fix an installation problem where a dependency (childprocess) fails to install correctly. (#1592; Jordan Sissel)
|
|
41
|
+
|
|
42
|
+
1.10.2 (July 3, 2018)
|
|
43
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
44
|
+
|
|
45
|
+
* cpan: Fix a crash where fpm would crash trying to parse a perl version string (`#1515`_, `#1514`; Jordan Sissel, William N. Braswell, Jr)
|
|
46
|
+
|
|
47
|
+
1.10.1 (July 3, 2018)
|
|
48
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
49
|
+
|
|
50
|
+
* cpan: Fixes some package building by setting PERL5LIB correctly (`#1509`_, `#1511`_; William N. Braswell, Jr)
|
|
51
|
+
* cpan: Adds `--[no-]cpan-verbose` flag which, when set, runs `cpanm` with the `--verbose` flag (`#1511`_; William N. Braswell, Jr)
|
|
52
|
+
|
|
4
53
|
1.10.0 (May 21, 2018)
|
|
5
54
|
^^^^^^^^^^^^^^^^^^^^
|
|
6
55
|
|
|
@@ -14,6 +63,7 @@ Release Notes and Change Log
|
|
|
14
63
|
* rpm: fix shell function name `install` conflicting with `install` program. In
|
|
15
64
|
postinst (after-install), the function is now called `_install` to avoid
|
|
16
65
|
conflicting with `/usr/bin/install` (`#1434`_; Torsten Schmidt)
|
|
66
|
+
* rpm: Allow binary "arch dependent" files in noarch rpms (Jordan Sissel)
|
|
17
67
|
* - deb: --config-files ? (`#1440`_, `#1443`_; NoBodyCam)
|
|
18
68
|
* FPM source repo now contains a Brewfile for use with Homebrew.
|
|
19
69
|
* FPM source repo has a Dockerfile for invoking fpm with docker. (`#1484`_, ;Allan Lewis
|
|
@@ -36,7 +86,7 @@ Release Notes and Change Log
|
|
|
36
86
|
* Fix bug so fpm can now copy symlinks correctly (`#1348`_; ServiusHack)
|
|
37
87
|
* apk: Improve performance (`#1358`_; Jan Delgado)
|
|
38
88
|
* cpan: Fix crash when CPAN query returns a version value that was a number and fpm was expecting a string. (`#1344`_, `#1343`_; liger1978)
|
|
39
|
-
* cpan: Fix MetaCPAN searches to use v1 of MetaCPAN's API. The v0 API is no longer provided by MetaCPAN. (`#1341`_, `#1339
|
|
89
|
+
* cpan: Fix MetaCPAN searches to use v1 of MetaCPAN's API. The v0 API is no longer provided by MetaCPAN. (`#1341`_, `#1339`_; Bob Bell)
|
|
40
90
|
* cpan: Have perl modules implicitly "provide" (`--provides`) capabilities. (`#1340`_; Bob Bell. `#1345`_; liger1978)
|
|
41
91
|
* cpan: Now transforms perl version values like "5.008001" to "5.8.1" (`#1342`_; Bob Bell)
|
|
42
92
|
* cpan: Use `>=` ("this version or newer") for package dependencies instead of `=` ("exactly this version"). (`#1338`_; Bob Bell)
|
data/lib/fpm.rb
CHANGED
data/lib/fpm/package.rb
CHANGED
|
@@ -4,7 +4,7 @@ require "pathname" # stdlib
|
|
|
4
4
|
require "find"
|
|
5
5
|
require "tmpdir" # stdlib
|
|
6
6
|
require "ostruct"
|
|
7
|
-
require "backports/
|
|
7
|
+
require "backports/latest"
|
|
8
8
|
require "socket" # stdlib, for Socket.gethostname
|
|
9
9
|
require "shellwords" # stdlib, for Shellwords.escape
|
|
10
10
|
require "erb" # stdlib, for template processing
|
|
@@ -316,7 +316,7 @@ class FPM::Package
|
|
|
316
316
|
# the path before returning.
|
|
317
317
|
#
|
|
318
318
|
# Wrapping Find.find in an Enumerator is required for sane operation in ruby 1.8.7,
|
|
319
|
-
# but requires the 'backports' gem (which is used in other places in fpm)
|
|
319
|
+
# but requires the 'backports/latest' gem (which is used in other places in fpm)
|
|
320
320
|
return Enumerator.new { |y| Find.find(staging_path) { |path| y << path } } \
|
|
321
321
|
.select { |path| path != staging_path } \
|
|
322
322
|
.select { |path| is_leaf.call(path) } \
|
data/lib/fpm/package/apk.rb
CHANGED
data/lib/fpm/package/cpan.rb
CHANGED
|
@@ -25,6 +25,9 @@ class FPM::Package::CPAN < FPM::Package
|
|
|
25
25
|
option "--test", :flag,
|
|
26
26
|
"Run the tests before packaging?", :default => true
|
|
27
27
|
|
|
28
|
+
option "--verbose", :flag,
|
|
29
|
+
"Produce verbose output from cpanm?", :default => false
|
|
30
|
+
|
|
28
31
|
option "--perl-lib-path", "PERL_LIB_PATH",
|
|
29
32
|
"Path of target Perl Libraries"
|
|
30
33
|
|
|
@@ -137,6 +140,7 @@ class FPM::Package::CPAN < FPM::Package
|
|
|
137
140
|
cpanm_flags += ["--mirror", "#{attributes[:cpan_mirror]}"] if !attributes[:cpan_mirror].nil?
|
|
138
141
|
cpanm_flags += ["--mirror-only"] if attributes[:cpan_mirror_only?] && !attributes[:cpan_mirror].nil?
|
|
139
142
|
cpanm_flags += ["--force"] if attributes[:cpan_cpanm_force?]
|
|
143
|
+
cpanm_flags += ["--verbose"] if attributes[:cpan_verbose?]
|
|
140
144
|
|
|
141
145
|
safesystem(attributes[:cpan_cpanm_bin], *cpanm_flags)
|
|
142
146
|
|
|
@@ -156,7 +160,7 @@ class FPM::Package::CPAN < FPM::Package
|
|
|
156
160
|
found_dependencies.each do |dep_name, version|
|
|
157
161
|
# Special case for representing perl core as a version.
|
|
158
162
|
if dep_name == "perl"
|
|
159
|
-
m = version.match(/^(\d)\.(\d{3})(\d{3})$/)
|
|
163
|
+
m = version.to_s.match(/^(\d)\.(\d{3})(\d{3})$/)
|
|
160
164
|
if m
|
|
161
165
|
version = m[1] + '.' + m[2].sub(/^0*/, '') + '.' + m[3].sub(/^0*/, '')
|
|
162
166
|
end
|
|
@@ -241,11 +245,7 @@ class FPM::Package::CPAN < FPM::Package
|
|
|
241
245
|
# Empty install_base to avoid local::lib being used.
|
|
242
246
|
"INSTALL_BASE=")
|
|
243
247
|
end
|
|
244
|
-
|
|
245
|
-
make = [ "env", "PERL5LIB=#{build_path("cpan/lib/perl5")}", "make" ]
|
|
246
|
-
else
|
|
247
|
-
make = [ "make" ]
|
|
248
|
-
end
|
|
248
|
+
make = [ "env", "PERL5LIB=#{build_path("cpan/lib/perl5")}", "make" ]
|
|
249
249
|
safesystem(*make)
|
|
250
250
|
safesystem(*(make + ["test"])) if attributes[:cpan_test?]
|
|
251
251
|
safesystem(*(make + ["DESTDIR=#{staging_path}", "install"]))
|
data/lib/fpm/package/deb.rb
CHANGED
|
@@ -3,9 +3,10 @@ require "fpm/namespace"
|
|
|
3
3
|
require "fpm/package"
|
|
4
4
|
require "fpm/errors"
|
|
5
5
|
require "fpm/util"
|
|
6
|
-
require "backports"
|
|
6
|
+
require "backports/latest"
|
|
7
7
|
require "fileutils"
|
|
8
8
|
require "digest"
|
|
9
|
+
require "zlib"
|
|
9
10
|
|
|
10
11
|
# Support for debian packages (.deb files)
|
|
11
12
|
#
|
|
@@ -22,7 +23,7 @@ class FPM::Package::Deb < FPM::Package
|
|
|
22
23
|
} unless defined?(SCRIPT_MAP)
|
|
23
24
|
|
|
24
25
|
# The list of supported compression types. Default is gz (gzip)
|
|
25
|
-
COMPRESSION_TYPES = [ "gz", "bzip2", "xz" ]
|
|
26
|
+
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "none" ]
|
|
26
27
|
|
|
27
28
|
option "--ignore-iteration-in-dependencies", :flag,
|
|
28
29
|
"For '=' (equal) dependencies, allow iterations on the specified " \
|
|
@@ -177,10 +178,14 @@ class FPM::Package::Deb < FPM::Package
|
|
|
177
178
|
end
|
|
178
179
|
|
|
179
180
|
option "--systemd", "FILEPATH", "Add FILEPATH as a systemd script",
|
|
180
|
-
|
|
181
|
+
:multivalued => true do |file|
|
|
181
182
|
next File.expand_path(file)
|
|
182
183
|
end
|
|
183
184
|
|
|
185
|
+
option "--systemd-enable", :flag , "Enable service on install or upgrade", :default => false
|
|
186
|
+
|
|
187
|
+
option "--systemd-auto-start", :flag , "Start service after install or upgrade", :default => false
|
|
188
|
+
|
|
184
189
|
option "--systemd-restart-after-upgrade", :flag , "Restart service after upgrade", :default => true
|
|
185
190
|
|
|
186
191
|
option "--after-purge", "FILE",
|
|
@@ -189,6 +194,11 @@ class FPM::Package::Deb < FPM::Package
|
|
|
189
194
|
File.expand_path(val) # Get the full path to the script
|
|
190
195
|
end # --after-purge
|
|
191
196
|
|
|
197
|
+
option "--maintainerscripts-force-errorchecks", :flag ,
|
|
198
|
+
"Activate errexit shell option according to lintian. " \
|
|
199
|
+
"https://lintian.debian.org/tags/maintainer-script-ignores-errors.html",
|
|
200
|
+
:default => false
|
|
201
|
+
|
|
192
202
|
def initialize(*args)
|
|
193
203
|
super(*args)
|
|
194
204
|
attributes[:deb_priority] = "extra"
|
|
@@ -218,6 +228,9 @@ class FPM::Package::Deb < FPM::Package
|
|
|
218
228
|
when "x86_64"
|
|
219
229
|
# Debian calls x86_64 "amd64"
|
|
220
230
|
@architecture = "amd64"
|
|
231
|
+
when "aarch64"
|
|
232
|
+
# Debian calls aarch64 "arm64"
|
|
233
|
+
@architecture = "arm64"
|
|
221
234
|
when "noarch"
|
|
222
235
|
# Debian calls noarch "all"
|
|
223
236
|
@architecture = "all"
|
|
@@ -265,10 +278,32 @@ class FPM::Package::Deb < FPM::Package
|
|
|
265
278
|
end # def input
|
|
266
279
|
|
|
267
280
|
def extract_info(package)
|
|
281
|
+
compression = `#{ar_cmd[0]} t #{package}`.split("\n").grep(/control.tar/).first.split(".").last
|
|
282
|
+
case compression
|
|
283
|
+
when "gz"
|
|
284
|
+
controltar = "control.tar.gz"
|
|
285
|
+
compression = "-z"
|
|
286
|
+
when "bzip2","bz2"
|
|
287
|
+
controltar = "control.tar.bz2"
|
|
288
|
+
compression = "-j"
|
|
289
|
+
when "xz"
|
|
290
|
+
controltar = "control.tar.xz"
|
|
291
|
+
compression = "-J"
|
|
292
|
+
when 'tar'
|
|
293
|
+
controltar = "control.tar"
|
|
294
|
+
compression = ""
|
|
295
|
+
when nil
|
|
296
|
+
raise FPM::InvalidPackageConfiguration, "Missing control.tar in deb source package #{package}"
|
|
297
|
+
else
|
|
298
|
+
raise FPM::InvalidPackageConfiguration,
|
|
299
|
+
"Unknown compression type '#{compression}' for control.tar in deb source package #{package}"
|
|
300
|
+
end
|
|
301
|
+
|
|
268
302
|
build_path("control").tap do |path|
|
|
269
303
|
FileUtils.mkdir(path) if !File.directory?(path)
|
|
304
|
+
# unpack the control.tar.{,gz,bz2,xz} from the deb package into staging_path
|
|
270
305
|
# Unpack the control tarball
|
|
271
|
-
safesystem(ar_cmd[0] + " p #{package}
|
|
306
|
+
safesystem(ar_cmd[0] + " p #{package} #{controltar} | tar #{compression} -xf - -C #{path}")
|
|
272
307
|
|
|
273
308
|
control = File.read(File.join(path, "control"))
|
|
274
309
|
|
|
@@ -376,15 +411,18 @@ class FPM::Package::Deb < FPM::Package
|
|
|
376
411
|
when "xz"
|
|
377
412
|
datatar = "data.tar.xz"
|
|
378
413
|
compression = "-J"
|
|
414
|
+
when 'tar'
|
|
415
|
+
datatar = "data.tar"
|
|
416
|
+
compression = ""
|
|
417
|
+
when nil
|
|
418
|
+
raise FPM::InvalidPackageConfiguration, "Missing data.tar in deb source package #{package}"
|
|
379
419
|
else
|
|
380
420
|
raise FPM::InvalidPackageConfiguration,
|
|
381
|
-
"Unknown compression type '#{
|
|
382
|
-
"in deb source package #{package}"
|
|
421
|
+
"Unknown compression type '#{compression}' for data.tar in deb source package #{package}"
|
|
383
422
|
end
|
|
384
423
|
|
|
385
424
|
# unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path
|
|
386
|
-
safesystem(ar_cmd[0] + " p #{package} #{datatar} "
|
|
387
|
-
"| tar #{compression} -xf - -C #{staging_path}")
|
|
425
|
+
safesystem(ar_cmd[0] + " p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}")
|
|
388
426
|
end # def extract_files
|
|
389
427
|
|
|
390
428
|
def output(output_path)
|
|
@@ -428,6 +466,7 @@ class FPM::Package::Deb < FPM::Package
|
|
|
428
466
|
raise "#{name}: tar is insufficient to support source_date_epoch."
|
|
429
467
|
end
|
|
430
468
|
|
|
469
|
+
attributes[:deb_systemd] = []
|
|
431
470
|
attributes.fetch(:deb_systemd_list, []).each do |systemd|
|
|
432
471
|
name = File.basename(systemd, ".service")
|
|
433
472
|
dest_systemd = staging_path("lib/systemd/system/#{name}.service")
|
|
@@ -435,19 +474,19 @@ class FPM::Package::Deb < FPM::Package
|
|
|
435
474
|
FileUtils.cp(systemd, dest_systemd)
|
|
436
475
|
File.chmod(0644, dest_systemd)
|
|
437
476
|
|
|
438
|
-
#
|
|
439
|
-
attributes[:deb_systemd]
|
|
477
|
+
# add systemd service name to attribute
|
|
478
|
+
attributes[:deb_systemd] << name
|
|
440
479
|
end
|
|
441
480
|
|
|
442
|
-
if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd]
|
|
481
|
+
if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd].any?
|
|
443
482
|
puts "Adding action files"
|
|
444
483
|
if script?(:before_install) or script?(:before_upgrade)
|
|
445
484
|
scripts[:before_install] = template("deb/preinst_upgrade.sh.erb").result(binding)
|
|
446
485
|
end
|
|
447
|
-
if script?(:before_remove) or attributes[:deb_systemd]
|
|
486
|
+
if script?(:before_remove) or not attributes[:deb_systemd].empty?
|
|
448
487
|
scripts[:before_remove] = template("deb/prerm_upgrade.sh.erb").result(binding)
|
|
449
488
|
end
|
|
450
|
-
if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd]
|
|
489
|
+
if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd].any?
|
|
451
490
|
scripts[:after_install] = template("deb/postinst_upgrade.sh.erb").result(binding)
|
|
452
491
|
end
|
|
453
492
|
if script?(:after_remove)
|
|
@@ -552,13 +591,20 @@ class FPM::Package::Deb < FPM::Package
|
|
|
552
591
|
case self.attributes[:deb_compression]
|
|
553
592
|
when "gz", nil
|
|
554
593
|
datatar = build_path("data.tar.gz")
|
|
594
|
+
controltar = build_path("control.tar.gz")
|
|
555
595
|
compression = "-z"
|
|
556
596
|
when "bzip2"
|
|
557
597
|
datatar = build_path("data.tar.bz2")
|
|
598
|
+
controltar = build_path("control.tar.bz2")
|
|
558
599
|
compression = "-j"
|
|
559
600
|
when "xz"
|
|
560
601
|
datatar = build_path("data.tar.xz")
|
|
602
|
+
controltar = build_path("control.tar.xz")
|
|
561
603
|
compression = "-J"
|
|
604
|
+
when "none"
|
|
605
|
+
datatar = build_path("data.tar")
|
|
606
|
+
controltar = build_path("control.tar")
|
|
607
|
+
compression = ""
|
|
562
608
|
else
|
|
563
609
|
raise FPM::InvalidPackageConfiguration,
|
|
564
610
|
"Unknown compression type '#{self.attributes[:deb_compression]}'"
|
|
@@ -577,7 +623,7 @@ class FPM::Package::Deb < FPM::Package
|
|
|
577
623
|
# the 'debian-binary' file has to be first
|
|
578
624
|
File.expand_path(output_path).tap do |output_path|
|
|
579
625
|
::Dir.chdir(build_path) do
|
|
580
|
-
safesystem(*ar_cmd, output_path, "debian-binary",
|
|
626
|
+
safesystem(*ar_cmd, output_path, "debian-binary", controltar, datatar)
|
|
581
627
|
end
|
|
582
628
|
end
|
|
583
629
|
|
|
@@ -682,8 +728,13 @@ class FPM::Package::Deb < FPM::Package
|
|
|
682
728
|
name, version = dep.gsub(/[()~>]/, "").split(/ +/)[0..1]
|
|
683
729
|
nextversion = version.split(".").collect { |v| v.to_i }
|
|
684
730
|
l = nextversion.length
|
|
685
|
-
|
|
686
|
-
|
|
731
|
+
if l > 1
|
|
732
|
+
nextversion[l-2] += 1
|
|
733
|
+
nextversion[l-1] = 0
|
|
734
|
+
else
|
|
735
|
+
# Single component versions ~> 1
|
|
736
|
+
nextversion[l-1] += 1
|
|
737
|
+
end
|
|
687
738
|
nextversion = nextversion.join(".")
|
|
688
739
|
return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
|
|
689
740
|
elsif (m = dep.match(/(\S+)\s+\(!= (.+)\)/))
|
|
@@ -749,11 +800,30 @@ class FPM::Package::Deb < FPM::Package
|
|
|
749
800
|
write_triggers # write trigger config to 'triggers' file
|
|
750
801
|
write_md5sums # write the md5sums file
|
|
751
802
|
|
|
803
|
+
# Tar up the staging_path into control.tar.{compression type}
|
|
804
|
+
case self.attributes[:deb_compression]
|
|
805
|
+
when "gz", nil
|
|
806
|
+
controltar = "control.tar.gz"
|
|
807
|
+
compression = "-z"
|
|
808
|
+
when "bzip2"
|
|
809
|
+
controltar = "control.tar.bz2"
|
|
810
|
+
compression = "-j"
|
|
811
|
+
when "xz"
|
|
812
|
+
controltar = "control.tar.xz"
|
|
813
|
+
compression = "-J"
|
|
814
|
+
when "none"
|
|
815
|
+
controltar = "control.tar"
|
|
816
|
+
compression = ""
|
|
817
|
+
else
|
|
818
|
+
raise FPM::InvalidPackageConfiguration,
|
|
819
|
+
"Unknown compression type '#{self.attributes[:deb_compression]}'"
|
|
820
|
+
end
|
|
821
|
+
|
|
752
822
|
# Make the control.tar.gz
|
|
753
|
-
build_path(
|
|
823
|
+
build_path(controltar).tap do |controltar|
|
|
754
824
|
logger.info("Creating", :path => controltar, :from => control_path)
|
|
755
825
|
|
|
756
|
-
args = [ tar_cmd, "-C", control_path, "-
|
|
826
|
+
args = [ tar_cmd, "-C", control_path, compression, "-cf", controltar,
|
|
757
827
|
"--owner=0", "--group=0", "--numeric-owner", "." ]
|
|
758
828
|
if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
|
|
759
829
|
# Force deterministic file order and timestamp
|
|
@@ -931,7 +1001,7 @@ class FPM::Package::Deb < FPM::Package
|
|
|
931
1001
|
|
|
932
1002
|
if attributes[:deb_templates]
|
|
933
1003
|
FileUtils.cp(attributes[:deb_templates], control_path("templates"))
|
|
934
|
-
File.chmod(
|
|
1004
|
+
File.chmod(0644, control_path("templates"))
|
|
935
1005
|
end
|
|
936
1006
|
end # def write_debconf
|
|
937
1007
|
|
data/lib/fpm/package/dir.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "fpm/package"
|
|
2
2
|
require "fpm/util"
|
|
3
|
-
require "backports"
|
|
3
|
+
require "backports/latest"
|
|
4
4
|
require "fileutils"
|
|
5
5
|
require "find"
|
|
6
6
|
require "socket"
|
|
@@ -83,8 +83,8 @@ class FPM::Package::Dir < FPM::Package
|
|
|
83
83
|
# can include license data from themselves (rpms, gems, etc),
|
|
84
84
|
# but to make sure a simple dir -> rpm works without having
|
|
85
85
|
# to specify a license.
|
|
86
|
-
self.license
|
|
87
|
-
self.vendor
|
|
86
|
+
self.license ||= "unknown"
|
|
87
|
+
self.vendor ||= [ENV["USER"], Socket.gethostname].join("@")
|
|
88
88
|
ensure
|
|
89
89
|
# Clean up any logger context we added.
|
|
90
90
|
logger.remove("method")
|
data/lib/fpm/package/empty.rb
CHANGED
data/lib/fpm/package/freebsd.rb
CHANGED
|
@@ -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 "digest"
|
|
@@ -17,10 +17,6 @@ class FPM::Package::FreeBSD < FPM::Package
|
|
|
17
17
|
:default => "fpm/<name>"
|
|
18
18
|
|
|
19
19
|
def output(output_path)
|
|
20
|
-
# See https://github.com/jordansissel/fpm/issues/1090
|
|
21
|
-
# require xz later, because this triggers a load of liblzma.so.5 that is
|
|
22
|
-
# unavailable on older CentOS/RH distros.
|
|
23
|
-
require "xz"
|
|
24
20
|
output_check(output_path)
|
|
25
21
|
|
|
26
22
|
# Build the packaging metadata files.
|
|
@@ -80,22 +76,19 @@ class FPM::Package::FreeBSD < FPM::Package
|
|
|
80
76
|
file.write(pkgdata.to_json + "\n")
|
|
81
77
|
end
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
FPM::Util::TarWriter.new(xz) do |tar|
|
|
87
|
-
# The manifests must come first for pkg.
|
|
88
|
-
add_path(tar, "+COMPACT_MANIFEST",
|
|
89
|
-
File.join(staging_path, "+COMPACT_MANIFEST"))
|
|
90
|
-
add_path(tar, "+MANIFEST",
|
|
91
|
-
File.join(staging_path, "+MANIFEST"))
|
|
92
|
-
|
|
93
|
-
checksums.keys.each do |path|
|
|
94
|
-
add_path(tar, "/" + path, File.join(staging_path, path))
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
79
|
+
file_list = File.new(build_path("file_list"), "w")
|
|
80
|
+
files.each do |i|
|
|
81
|
+
file_list.puts(i)
|
|
98
82
|
end
|
|
83
|
+
file_list.close
|
|
84
|
+
|
|
85
|
+
# Create the .txz package archive from the files in staging_path.
|
|
86
|
+
# We use --files-from here to keep the tar entries from having `./` as the prefix.
|
|
87
|
+
# This is done as a best effor to mimic what FreeBSD packages do, having everything at the top-level as
|
|
88
|
+
# file names, like "+MANIFEST" instead of "./+MANIFEST"
|
|
89
|
+
# Note: This will include top-level files like "/usr/bin/foo" listed in the tar as "usr/bin/fo" without
|
|
90
|
+
# a leading slash. I don't know if this has any negative impact on freebsd packages.
|
|
91
|
+
safesystem("tar", "-Jcf", output_path, "-C", staging_path, "--files-from", build_path("file_list"))
|
|
99
92
|
end # def output
|
|
100
93
|
|
|
101
94
|
# Handle architecture naming conversion:
|
|
@@ -110,6 +103,8 @@ class FPM::Package::FreeBSD < FPM::Package
|
|
|
110
103
|
wordsize = case @architecture
|
|
111
104
|
when nil, 'native'
|
|
112
105
|
%x{getconf LONG_BIT}.chomp # 'native' is current arch
|
|
106
|
+
when 'arm64'
|
|
107
|
+
'64'
|
|
113
108
|
when 'amd64'
|
|
114
109
|
'64'
|
|
115
110
|
when 'i386'
|