fpm 1.15.1 → 1.17.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 +4 -4
- data/CHANGELOG.rst +30 -0
- data/lib/fpm/command.rb +10 -2
- data/lib/fpm/package/deb.rb +102 -18
- data/lib/fpm/package/dir.rb +0 -4
- data/lib/fpm/package/freebsd.rb +23 -11
- data/lib/fpm/package/pacman.rb +8 -4
- data/lib/fpm/package/pyfpm/parse_requires.py +24 -0
- data/lib/fpm/package/python.rb +404 -170
- data/lib/fpm/package/rpm.rb +45 -5
- data/lib/fpm/package/virtualenv.rb +26 -2
- data/lib/fpm/package.rb +0 -1
- data/lib/fpm/rake_task.rb +30 -4
- data/lib/fpm/util.rb +33 -16
- data/lib/fpm/version.rb +1 -1
- data/templates/rpm.erb +1 -1
- metadata +10 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef536c2af546fea798392b6cca4c07b81b5f9a3d52654e72c5cb9543d1d4a21d
|
4
|
+
data.tar.gz: 95a4ea389bb037d2555ea95fd99313897b0f30c5b3bb8c5519a19d330b1e2842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccd36e905583145a6a80ca5efc62388ea2abdc1e35a8d3a077b5f946f2d2ea864a282fac0e77f9b5c0c82af09a96e6ae84067a6424b6d0d88f56282eea888111
|
7
|
+
data.tar.gz: 6c4a93a51fe6af403ecda1910466b41843a8508837cea3f68042e56dba1083543f61a45b14d560167063b265279da57166368471dfc32bd8837c5e9d65847ed7
|
data/CHANGELOG.rst
CHANGED
@@ -1,6 +1,36 @@
|
|
1
1
|
Release Notes and Change Log
|
2
2
|
============================
|
3
3
|
|
4
|
+
1.17.0 (October 2, 2025)
|
5
|
+
^^^^^^^^^^^^^^^^^^^^^^^^
|
6
|
+
|
7
|
+
* python: Support modern Python project features: pyproject.toml, wheels, etc. Now, any project that can be built or installed with ``pip`` can be packaged by fpm. Previously, fpm relied on a long-deprecated features in setup.py to see a python project's metadata such as name, version, and dependencies. Fpm now uses python's package tools to identify the project's name, version, dependencies, and other information. (`#2104`_, `#2105`_, `#2040`_, `#1982`_, `#2029`_; Jordan Sissel, cwegener, amdei, gmabey)
|
8
|
+
* dir: When copying files, only use hardlinks if the original files were also hardlinks. (`#2103`_, `#2102`_; Michael Telatynski, Matthew Rathbone, Jordan Sissel). :w
|
9
|
+
Related: https://github.com/electron-userland/electron-builder/issues/5721
|
10
|
+
* deb: bug fix: when a file given with ``--config-files <path>`` copied into the package, fpm was forgetting to mark the file as being a config file in the package, aka Debian "conffiles" (`#2027`_, `#1823`_; Alexandr Zarubkin, Kientz Arnaud)
|
11
|
+
* pacman: Now can build packages with aarch64 and arm7hf architecture (`#2017`_; Markson Hon)
|
12
|
+
* rpm: Paths with '{' and '}' characters can now be included in rpms (`#2088`_ `#2087`_; Jordan Sissel, Manish2481983)
|
13
|
+
* docs: Updated urls which pointed at rpm documentation (`#2092`_, `#2011`_, `#2054`_; André Kelpe, Natanael Arndt)
|
14
|
+
* Ruby 3.4.0 no longer gives warnings related to `ostruct` (`#2106`_, also `#2104`_ and `#2103`_; Jordan Sissel)
|
15
|
+
|
16
|
+
1.16.0 (December 8, 2024)
|
17
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
18
|
+
|
19
|
+
* deb: Add support for zstd compression (`#2009`_, `#2084`_; Ștefan Rusu)
|
20
|
+
* deb: Add compression level setting, ``--deb-compression-level`` (`#2036`_; Hugo Beauzée-Luyssen)
|
21
|
+
* rpm: Generate an empty rpm changelog if none is given. This should help cases where ``rpmlint`` would complain about missing a changelog entry in the rpm. (`#2041`_; Gordon Bleux)
|
22
|
+
* deb: When converting from an rpm, remove package information that is not valid on Debian systems. (`#2053`_, `#1627`; Jordan Stopford, Jamesits)
|
23
|
+
* python: Fix bug when PYTHONPATH has spaces in it (`#2062`_; Kristof Willaert)
|
24
|
+
* deb: You can now choose a different systemd directory with ``--deb-systemd-path`` (`#2063`_; Reinier Schoof)
|
25
|
+
* freebsd: OS version can now be specified with ``--freebsd-osversion``: (`#2064`_; David Newhall II)
|
26
|
+
* freebsd: Improve the 'architecture' value used by fpm to generate freebsd packages (`#2064`_, `#1880`_; David Newhall II, Matthew R Kasun)
|
27
|
+
* deb: Timer units can be given to ``--deb-systemd`` now (`#2065`_, `#1978`_; phillipp, Robert Schneider)
|
28
|
+
* rpm: When converting cpan packages, use newer ``perl-interpreter`` dependency name. To use the old dependency name ``perl``, use the flag ``--rpm-old-perl-dependency-name`` (`#2066`_, `#2085`_; Kevin Duret, Nicholas Hubbard, William N. Braswell, Jr., Jordan Sissel))
|
29
|
+
* Some errors now correctly print just an error message instead of dumping a ruby stack trace (`#2067`_; Jordan Sissel)
|
30
|
+
* python: Support modules which download as zip files (`#2068`_, `#2074`_, `#2072`_; Matt Ezell, hussainbani, hbani)
|
31
|
+
* rpm: Fix rpm build failures on Fedora 41 (`#2082`_, `#2076`_; Wayne Heaney, Antheas Kapenekakis, Romain Geissler)
|
32
|
+
|
33
|
+
|
4
34
|
1.15.1 (January 31, 2023)
|
5
35
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
6
36
|
* Ruby 3.2.0 now supported. This fixes error 'undefined method exists? for File' '(`#1981`_, `#1988`_; Nicholas Hubbard, romulasry)
|
data/lib/fpm/command.rb
CHANGED
@@ -3,7 +3,6 @@ require "fpm/namespace"
|
|
3
3
|
require "fpm/version"
|
4
4
|
require "fpm/util"
|
5
5
|
require "clamp"
|
6
|
-
require "ostruct"
|
7
6
|
require "fpm"
|
8
7
|
require "tmpdir" # for Dir.tmpdir
|
9
8
|
|
@@ -260,7 +259,11 @@ class FPM::Command < Clamp::Command
|
|
260
259
|
"'gem', it specifies the packages to download and use as the gem input",
|
261
260
|
:attribute_name => :args
|
262
261
|
|
262
|
+
# Keep a copy of the original flags (ones declared above, not by package types)
|
263
|
+
# This helps when generating the documentation
|
264
|
+
GENERAL_OPTIONS = @declared_options.clone
|
263
265
|
FPM::Package.types.each do |name, klass|
|
266
|
+
# This adds each package's flags to the main command
|
264
267
|
klass.apply_options(self)
|
265
268
|
end
|
266
269
|
|
@@ -410,7 +413,12 @@ class FPM::Command < Clamp::Command
|
|
410
413
|
set = proc do |object, attribute|
|
411
414
|
# if the package's attribute is currently nil *or* the flag setting for this
|
412
415
|
# attribute is non-default, use the value.
|
413
|
-
|
416
|
+
|
417
|
+
# Not all options have a default value, so we assume `nil` if there's no default. (#1543)
|
418
|
+
# In clamp >= 1.3.0, options without `:default => ..` will not have any # `default_xyz`
|
419
|
+
# methods generated, so we need to check for the presence of this method first.
|
420
|
+
default = respond_to?("default_#{attribute}") ? send("default_#{attribute}") : nil
|
421
|
+
if object.send(attribute).nil? || send(attribute) != default
|
414
422
|
logger.info("Setting from flags: #{attribute}=#{send(attribute)}")
|
415
423
|
object.send("#{attribute}=", send(attribute))
|
416
424
|
end
|
data/lib/fpm/package/deb.rb
CHANGED
@@ -27,7 +27,7 @@ class FPM::Package::Deb < FPM::Package
|
|
27
27
|
} unless defined?(SCRIPT_MAP)
|
28
28
|
|
29
29
|
# The list of supported compression types. Default is gz (gzip)
|
30
|
-
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "none" ]
|
30
|
+
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "zst", "none" ]
|
31
31
|
|
32
32
|
# https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields
|
33
33
|
# Example value with version relationship: libc6 (>= 2.2.1)
|
@@ -73,12 +73,25 @@ class FPM::Package::Deb < FPM::Package
|
|
73
73
|
option "--compression", "COMPRESSION", "The compression type to use, must " \
|
74
74
|
"be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "gz" do |value|
|
75
75
|
if !COMPRESSION_TYPES.include?(value)
|
76
|
-
raise
|
76
|
+
raise FPM::Package::InvalidArgument, "deb compression value of '#{value}' is invalid. " \
|
77
77
|
"Must be one of #{COMPRESSION_TYPES.join(", ")}"
|
78
78
|
end
|
79
79
|
value
|
80
80
|
end
|
81
81
|
|
82
|
+
option "--compression-level", "[0-9]", "Select a compression level. 0 is none or minimal. 9 is max compression.",
|
83
|
+
# Specify which compression level to use on the compressor backend, when building a package
|
84
|
+
:default => nil do |value|
|
85
|
+
valint = value.to_i
|
86
|
+
# if self.attributes[:deb_compression].nil?
|
87
|
+
# raise "Can't specify a compression level with compression disabled"
|
88
|
+
# end
|
89
|
+
unless value =~ /^\d$/ && valint >= 0 && valint <= 9
|
90
|
+
raise "Invalid compression level '#{value}'. Valid values are integers between 0 and 9 inclusive."
|
91
|
+
end
|
92
|
+
valint
|
93
|
+
end
|
94
|
+
|
82
95
|
option "--dist", "DIST-TAG", "Set the deb distribution.", :default => "unstable"
|
83
96
|
|
84
97
|
# Take care about the case when we want custom control file but still use fpm ...
|
@@ -210,6 +223,11 @@ class FPM::Package::Deb < FPM::Package
|
|
210
223
|
next File.expand_path(file)
|
211
224
|
end
|
212
225
|
|
226
|
+
option "--systemd-path", "FILEPATH", "Relative path to the systemd service directory",
|
227
|
+
:default => "lib/systemd/system" do |file|
|
228
|
+
next file.gsub(/^\/*/, '')
|
229
|
+
end
|
230
|
+
|
213
231
|
option "--systemd-enable", :flag , "Enable service on install or upgrade", :default => false
|
214
232
|
|
215
233
|
option "--systemd-auto-start", :flag , "Start service after install or upgrade", :default => false
|
@@ -262,6 +280,9 @@ class FPM::Package::Deb < FPM::Package
|
|
262
280
|
when "noarch"
|
263
281
|
# Debian calls noarch "all"
|
264
282
|
@architecture = "all"
|
283
|
+
when "ppc64le"
|
284
|
+
# Debian calls ppc64le "ppc64el"
|
285
|
+
@architecture = "ppc64el"
|
265
286
|
end
|
266
287
|
return @architecture
|
267
288
|
end # def architecture
|
@@ -332,6 +353,9 @@ class FPM::Package::Deb < FPM::Package
|
|
332
353
|
when "xz"
|
333
354
|
controltar = "control.tar.xz"
|
334
355
|
compression = "-J"
|
356
|
+
when "zst"
|
357
|
+
controltar = "control.tar.zst"
|
358
|
+
compression = "--use-compress-program 'zstd -d'"
|
335
359
|
when 'tar'
|
336
360
|
controltar = "control.tar"
|
337
361
|
compression = ""
|
@@ -344,7 +368,7 @@ class FPM::Package::Deb < FPM::Package
|
|
344
368
|
|
345
369
|
build_path("control").tap do |path|
|
346
370
|
FileUtils.mkdir(path) if !File.directory?(path)
|
347
|
-
# unpack the control.tar.{,gz,bz2,xz} from the deb package into staging_path
|
371
|
+
# unpack the control.tar.{,gz,bz2,xz,zst} from the deb package into staging_path
|
348
372
|
# Unpack the control tarball
|
349
373
|
safesystem(ar_cmd[0] + " p #{package} #{controltar} | tar #{compression} -xf - -C #{path}")
|
350
374
|
|
@@ -364,7 +388,7 @@ class FPM::Package::Deb < FPM::Package
|
|
364
388
|
version_re = /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/
|
365
389
|
m = version_re.match(parse.call("Version"))
|
366
390
|
if !m
|
367
|
-
raise "Unsupported version string '#{parse.call("Version")}'"
|
391
|
+
raise FPM::InvalidPackageConfiguration, "Unsupported version string '#{parse.call("Version")}'"
|
368
392
|
end
|
369
393
|
self.epoch, self.version, self.iteration = m.captures
|
370
394
|
|
@@ -454,6 +478,9 @@ class FPM::Package::Deb < FPM::Package
|
|
454
478
|
when "xz"
|
455
479
|
datatar = "data.tar.xz"
|
456
480
|
compression = "-J"
|
481
|
+
when "zst"
|
482
|
+
datatar = "data.tar.zst"
|
483
|
+
compression = "--use-compress-program 'zstd -d'"
|
457
484
|
when 'tar'
|
458
485
|
datatar = "data.tar"
|
459
486
|
compression = ""
|
@@ -504,27 +531,36 @@ class FPM::Package::Deb < FPM::Package
|
|
504
531
|
end
|
505
532
|
if attributes[:source_date_epoch] == "0"
|
506
533
|
logger.error("Alas, ruby's Zlib::GzipWriter does not support setting an mtime of zero. Aborting.")
|
507
|
-
raise "#{name}: source_date_epoch of 0 not supported."
|
534
|
+
raise FPM::InvalidPackageConfiguration, "#{name}: source_date_epoch of 0 not supported."
|
508
535
|
end
|
509
536
|
if not attributes[:source_date_epoch].nil? and not ar_cmd_deterministic?
|
510
537
|
logger.error("Alas, could not find an ar that can handle -D option. Try installing recent gnu binutils. Aborting.")
|
511
|
-
raise "#{name}: ar is insufficient to support source_date_epoch."
|
538
|
+
raise FPM::InvalidPackageConfiguration, "#{name}: ar is insufficient to support source_date_epoch."
|
512
539
|
end
|
513
540
|
if not attributes[:source_date_epoch].nil? and not tar_cmd_supports_sort_names_and_set_mtime?
|
514
541
|
logger.error("Alas, could not find a tar that can set mtime and sort. Try installing recent gnu tar. Aborting.")
|
515
|
-
raise "#{name}: tar is insufficient to support source_date_epoch."
|
542
|
+
raise FPM::InvalidPackageConfiguration, "#{name}: tar is insufficient to support source_date_epoch."
|
516
543
|
end
|
517
544
|
|
518
545
|
attributes[:deb_systemd] = []
|
519
546
|
attributes.fetch(:deb_systemd_list, []).each do |systemd|
|
520
|
-
name = File.basename(systemd
|
521
|
-
|
547
|
+
name = File.basename(systemd)
|
548
|
+
extname = File.extname(name)
|
549
|
+
|
550
|
+
name_with_extension = if extname.empty?
|
551
|
+
"#{name}.service"
|
552
|
+
elsif [".service", ".timer"].include?(extname)
|
553
|
+
name
|
554
|
+
else
|
555
|
+
raise FPM::InvalidPackageConfiguration, "Invalid systemd unit file extension: #{extname}. Expected .service or .timer, or no extension."
|
556
|
+
end
|
557
|
+
|
558
|
+
dest_systemd = staging_path(File.join(attributes[:deb_systemd_path], "#{name_with_extension}"))
|
522
559
|
mkdir_p(File.dirname(dest_systemd))
|
523
560
|
FileUtils.cp(systemd, dest_systemd)
|
524
561
|
File.chmod(0644, dest_systemd)
|
525
562
|
|
526
|
-
|
527
|
-
attributes[:deb_systemd] << name
|
563
|
+
attributes[:deb_systemd] << name_with_extension
|
528
564
|
end
|
529
565
|
|
530
566
|
if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd].any?
|
@@ -627,8 +663,12 @@ class FPM::Package::Deb < FPM::Package
|
|
627
663
|
end
|
628
664
|
|
629
665
|
attributes.fetch(:deb_systemd_list, []).each do |systemd|
|
630
|
-
name = File.basename(systemd
|
631
|
-
|
666
|
+
name = File.basename(systemd)
|
667
|
+
extname = File.extname(systemd)
|
668
|
+
name_with_extension = extname.empty? ? "#{name}.service" : name
|
669
|
+
|
670
|
+
dest_systemd = staging_path(File.join(attributes[:deb_systemd_path], "#{name_with_extension}"))
|
671
|
+
|
632
672
|
mkdir_p(File.dirname(dest_systemd))
|
633
673
|
FileUtils.cp(systemd, dest_systemd)
|
634
674
|
File.chmod(0644, dest_systemd)
|
@@ -642,18 +682,29 @@ class FPM::Package::Deb < FPM::Package
|
|
642
682
|
datatar = build_path("data.tar.gz")
|
643
683
|
controltar = build_path("control.tar.gz")
|
644
684
|
compression_flags = ["-z"]
|
685
|
+
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
|
686
|
+
compressor_options = {"GZIP" => "-#{self.attributes[:deb_compression_level] || 9}" +
|
687
|
+
"#{'n' if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?}"}
|
645
688
|
when "bzip2"
|
646
689
|
datatar = build_path("data.tar.bz2")
|
647
690
|
controltar = build_path("control.tar.gz")
|
648
691
|
compression_flags = ["-j"]
|
692
|
+
compressor_options = {"BZIP" => "-#{self.attributes[:deb_compression_level] || 9}"}
|
649
693
|
when "xz"
|
650
694
|
datatar = build_path("data.tar.xz")
|
651
695
|
controltar = build_path("control.tar.xz")
|
652
696
|
compression_flags = ["-J"]
|
697
|
+
compressor_options = {"XZ_OPT" => "-#{self.attributes[:deb_compression_level] || 3}"}
|
698
|
+
when "zst"
|
699
|
+
datatar = build_path("data.tar.zst")
|
700
|
+
controltar = build_path("control.tar.zst")
|
701
|
+
compression_flags = ["--use-compress-program", "zstd"]
|
702
|
+
compressor_options = {"ZSTD_CLEVEL" => "-#{self.attributes[:deb_compression_level] || 3}"}
|
653
703
|
when "none"
|
654
704
|
datatar = build_path("data.tar")
|
655
705
|
controltar = build_path("control.tar")
|
656
706
|
compression_flags = []
|
707
|
+
compressor_options = {}
|
657
708
|
else
|
658
709
|
raise FPM::InvalidPackageConfiguration,
|
659
710
|
"Unknown compression type '#{self.attributes[:deb_compression]}'"
|
@@ -662,9 +713,8 @@ class FPM::Package::Deb < FPM::Package
|
|
662
713
|
if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
|
663
714
|
# Use gnu tar options to force deterministic file order and timestamp
|
664
715
|
args += ["--sort=name", ("--mtime=@%s" % attributes[:source_date_epoch])]
|
665
|
-
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
|
666
|
-
args.unshift({"GZIP" => "-9n"})
|
667
716
|
end
|
717
|
+
args.unshift(compressor_options)
|
668
718
|
safesystem(*args)
|
669
719
|
|
670
720
|
# pack up the .deb, which is just an 'ar' archive with 3 files
|
@@ -704,9 +754,17 @@ class FPM::Package::Deb < FPM::Package
|
|
704
754
|
self.dependencies = self.dependencies.collect do |dep|
|
705
755
|
fix_dependency(dep)
|
706
756
|
end.flatten
|
757
|
+
|
758
|
+
# If an invalid depends field was found i.e. /bin.sh then fix_depends will blank it
|
759
|
+
# Make sure we remove this blank here
|
760
|
+
self.dependencies = self.dependencies.reject { |p| p.empty? }
|
761
|
+
|
707
762
|
self.provides = self.provides.collect do |provides|
|
708
763
|
fix_provides(provides)
|
709
764
|
end.flatten
|
765
|
+
# If an invalid provides field was found i.e. mypackage(arch) then fix_provides will blank it
|
766
|
+
# Make sure we remove this blank here
|
767
|
+
self.provides = self.provides.reject { |p| p.empty? }
|
710
768
|
|
711
769
|
if origin == FPM::Package::CPAN
|
712
770
|
# The fpm cpan code presents dependencies and provides fields as perl(ModuleName)
|
@@ -721,7 +779,7 @@ class FPM::Package::Deb < FPM::Package
|
|
721
779
|
else
|
722
780
|
# Also replace '::' in the perl module name with '-'
|
723
781
|
modulename = m["name"].gsub("::", "-")
|
724
|
-
|
782
|
+
|
725
783
|
# Fix any upper-casing or other naming concerns Debian has about packages
|
726
784
|
name = "#{attributes[:cpan_package_name_prefix]}-#{modulename}"
|
727
785
|
|
@@ -807,6 +865,18 @@ class FPM::Package::Deb < FPM::Package
|
|
807
865
|
end
|
808
866
|
end
|
809
867
|
|
868
|
+
if dep.start_with?("/")
|
869
|
+
logger.warn("Blanking 'dependency' field '#{dep}' because it's invalid")
|
870
|
+
dep = ""
|
871
|
+
return dep
|
872
|
+
end
|
873
|
+
|
874
|
+
if dep.include?("rpmlib")
|
875
|
+
logger.warn("Blanking 'dependency' field '#{dep}' because it's invalid")
|
876
|
+
dep = ""
|
877
|
+
return dep
|
878
|
+
end
|
879
|
+
|
810
880
|
name_re = /^[^ \(]+/
|
811
881
|
name = dep[name_re]
|
812
882
|
if name =~ /[A-Z]/
|
@@ -900,6 +970,11 @@ class FPM::Package::Deb < FPM::Package
|
|
900
970
|
provides = provides.gsub("_", "-")
|
901
971
|
end
|
902
972
|
|
973
|
+
if provides.include?("(") and !provides.include?("(=")
|
974
|
+
logger.warn("Blanking 'provides' field '#{provides}' because it's invalid")
|
975
|
+
provides = ""
|
976
|
+
end
|
977
|
+
|
903
978
|
if m = provides.match(/^([A-Za-z0-9_-]+)\s*=\s*(\d+.*$)/)
|
904
979
|
logger.warn("Replacing 'provides' entry #{provides} with syntax 'name (= version)'")
|
905
980
|
provides = "#{m[1]} (= #{m[2]})"
|
@@ -934,12 +1009,21 @@ class FPM::Package::Deb < FPM::Package
|
|
934
1009
|
when "gz", "bzip2", nil
|
935
1010
|
controltar = "control.tar.gz"
|
936
1011
|
compression_flags = ["-z"]
|
1012
|
+
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
|
1013
|
+
compressor_options = {"GZIP" => "-#{self.attributes[:deb_compression_level] || 9}" +
|
1014
|
+
"#{'n' if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?}"}
|
937
1015
|
when "xz"
|
938
1016
|
controltar = "control.tar.xz"
|
939
1017
|
compression_flags = ["-J"]
|
1018
|
+
compressor_options = {"XZ_OPT" => "-#{self.attributes[:deb_compression_level] || 3}"}
|
1019
|
+
when "zst"
|
1020
|
+
controltar = "control.tar.zst"
|
1021
|
+
compression_flags = ["--use-compress-program", "zstd"]
|
1022
|
+
compressor_options = {"ZSTD_CLEVEL" => "-#{self.attributes[:deb_compression_level] || 3}"}
|
940
1023
|
when "none"
|
941
1024
|
controltar = "control.tar"
|
942
1025
|
compression_flags = []
|
1026
|
+
compressor_options = {}
|
943
1027
|
else
|
944
1028
|
raise FPM::InvalidPackageConfiguration,
|
945
1029
|
"Unknown compression type '#{self.attributes[:deb_compression]}'"
|
@@ -954,9 +1038,8 @@ class FPM::Package::Deb < FPM::Package
|
|
954
1038
|
if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
|
955
1039
|
# Force deterministic file order and timestamp
|
956
1040
|
args += ["--sort=name", ("--mtime=@%s" % attributes[:source_date_epoch])]
|
957
|
-
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
|
958
|
-
args.unshift({"GZIP" => "-9n"})
|
959
1041
|
end
|
1042
|
+
args.unshift(compressor_options)
|
960
1043
|
safesystem(*args)
|
961
1044
|
end
|
962
1045
|
|
@@ -1068,6 +1151,7 @@ class FPM::Package::Deb < FPM::Package
|
|
1068
1151
|
logger.debug("Adding config file #{path} to Staging area #{staging_path}")
|
1069
1152
|
FileUtils.mkdir_p(File.dirname(dcl))
|
1070
1153
|
FileUtils.cp_r path, dcl
|
1154
|
+
add_path(path, allconfigs)
|
1071
1155
|
else
|
1072
1156
|
logger.debug("Config file aready exists in staging area.")
|
1073
1157
|
end
|
data/lib/fpm/package/dir.rb
CHANGED
@@ -197,10 +197,6 @@ class FPM::Package::Dir < FPM::Package
|
|
197
197
|
else
|
198
198
|
# Otherwise try copying the file.
|
199
199
|
begin
|
200
|
-
logger.debug("Linking", :source => source, :destination => destination)
|
201
|
-
File.link(source, destination)
|
202
|
-
rescue Errno::ENOENT, Errno::EXDEV, Errno::EPERM
|
203
|
-
# Hardlink attempt failed, copy it instead
|
204
200
|
logger.debug("Copying", :source => source, :destination => destination)
|
205
201
|
copy_entry(source, destination)
|
206
202
|
rescue Errno::EEXIST
|
data/lib/fpm/package/freebsd.rb
CHANGED
@@ -16,6 +16,10 @@ class FPM::Package::FreeBSD < FPM::Package
|
|
16
16
|
"Sets the FreeBSD 'origin' pkg field",
|
17
17
|
:default => "fpm/<name>"
|
18
18
|
|
19
|
+
option "--osversion", "VERSION",
|
20
|
+
"Sets the FreeBSD 'version' pkg field, ie 12 or 13, use '*' for all.",
|
21
|
+
:default => "13"
|
22
|
+
|
19
23
|
def output(output_path)
|
20
24
|
output_check(output_path)
|
21
25
|
|
@@ -90,28 +94,36 @@ class FPM::Package::FreeBSD < FPM::Package
|
|
90
94
|
end # def output
|
91
95
|
|
92
96
|
# Handle architecture naming conversion:
|
93
|
-
# <osname>:<osversion>:<arch
|
97
|
+
# <osname>:<osversion>:<arch>
|
94
98
|
def architecture
|
95
|
-
osname =
|
96
|
-
osversion = %x{uname -r}.chomp.split('.').first
|
97
|
-
|
98
|
-
# Essentially because no testing on other platforms
|
99
|
-
arch = 'x86'
|
99
|
+
osname = 'FreeBSD'
|
100
100
|
|
101
|
-
|
101
|
+
arch = case @architecture
|
102
102
|
when nil, 'native'
|
103
103
|
%x{getconf LONG_BIT}.chomp # 'native' is current arch
|
104
104
|
when 'arm64'
|
105
|
-
'
|
105
|
+
'arm64'
|
106
|
+
when 'aarch64'
|
107
|
+
'arm64'
|
106
108
|
when 'amd64'
|
107
|
-
'
|
109
|
+
'amd64'
|
110
|
+
when 'x86_64'
|
111
|
+
'amd64'
|
108
112
|
when 'i386'
|
109
|
-
'
|
113
|
+
'i386'
|
114
|
+
when 'i686'
|
115
|
+
'i386'
|
116
|
+
when 'any'
|
117
|
+
'*'
|
118
|
+
when 'all'
|
119
|
+
'*'
|
120
|
+
when 'noarch'
|
121
|
+
'*'
|
110
122
|
else
|
111
123
|
%x{getconf LONG_BIT}.chomp # default to native, the current arch
|
112
124
|
end
|
113
125
|
|
114
|
-
return [osname,
|
126
|
+
return [osname, attributes[:freebsd_osversion], arch].join(':')
|
115
127
|
end
|
116
128
|
|
117
129
|
def add_path(tar, tar_path, path)
|
data/lib/fpm/package/pacman.rb
CHANGED
@@ -37,11 +37,15 @@ class FPM::Package::Pacman < FPM::Package
|
|
37
37
|
def architecture
|
38
38
|
case @architecture
|
39
39
|
when nil
|
40
|
-
return %x{uname -m}.chomp
|
41
|
-
when "amd64"
|
42
|
-
return "x86_64"
|
40
|
+
return %x{uname -m}.chomp # default to current arch
|
41
|
+
when "amd64" # Debian uses amd64
|
42
|
+
return "x86_64" # Arch Linux uses x86_64
|
43
|
+
when "arm64" # Debian uses arm64
|
44
|
+
return "aarch64" # Arch Linux ARM uses aarch64
|
45
|
+
when "armhf" # Debian uses armhf
|
46
|
+
return "arm7hf" # Arch Linux ARM uses arm7hf
|
43
47
|
when "native"
|
44
|
-
return %x{uname -m}.chomp
|
48
|
+
return %x{uname -m}.chomp # 'native' is the current arch
|
45
49
|
when "all", "any", "noarch"
|
46
50
|
return "any"
|
47
51
|
else
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
#import pkg_resources
|
4
|
+
import packaging.requirements
|
5
|
+
import json
|
6
|
+
import sys
|
7
|
+
|
8
|
+
# Expect requirements lines via stdin.
|
9
|
+
#requirements = pkg_resources.parse_requirements(sys.stdin)
|
10
|
+
|
11
|
+
# Process environment markers, if any, and produce a list of requirements for the current environment.
|
12
|
+
def evaluate_requirements(fd):
|
13
|
+
all_requirements = [packaging.requirements.Requirement(line) for line in sys.stdin]
|
14
|
+
|
15
|
+
for req in all_requirements:
|
16
|
+
# XXX: Note: marker.evaluate() can be given a dict() containing environment values to overwrite
|
17
|
+
if req.marker is None or req.marker.evaluate():
|
18
|
+
if len(req.specifier) > 0:
|
19
|
+
for spec in req.specifier:
|
20
|
+
yield "%s%s" % (req.name, spec)
|
21
|
+
else:
|
22
|
+
yield str(req.name)
|
23
|
+
|
24
|
+
print(json.dumps(list(evaluate_requirements(sys.stdin))))
|