Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ General Options
- (deb only) Add FILEPATH as debian changelog

* ``--deb-compression COMPRESSION``
- (deb only) The compression type to use, must be one of gz, bzip2, xz, zst, none.
- (deb only) The compression type to use, must be one of gz, bzip2, pigz, xz, zst, none.

* ``--deb-compression-level [0-9]``
- (deb only) Select a compression level. 0 is none or minimal. 9 is max compression.
Expand Down
9 changes: 7 additions & 2 deletions lib/fpm/package/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FPM::Package::Deb < FPM::Package
} unless defined?(SCRIPT_MAP)

# The list of supported compression types. Default is gz (gzip)
COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "zst", "none" ]
COMPRESSION_TYPES = [ "gz", "bzip2", "pigz", "xz", "zst", "none" ]

# https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields
# Example value with version relationship: libc6 (>= 2.2.1)
Expand Down Expand Up @@ -700,6 +700,11 @@ def output(output_path)
controltar = build_path("control.tar.zst")
compression_flags = ["--use-compress-program", "zstd"]
compressor_options = {"ZSTD_CLEVEL" => "-#{self.attributes[:deb_compression_level] || 3}"}
when "pigz"
datatar = build_path("data.tar.gz")
controltar = build_path("control.tar.gz")
compression_flags = ["-I"]
compressor_options = {"PIGZ" => "-#{self.attributes[:deb_compression_level] || 9}"}
when "none"
datatar = build_path("data.tar")
controltar = build_path("control.tar")
Expand Down Expand Up @@ -1006,7 +1011,7 @@ def write_control_tarball

# Tar up the staging_path into control.tar.{compression type}
case self.attributes[:deb_compression]
when "gz", "bzip2", nil
when "gz", "bzip2", "pigz", nil
controltar = "control.tar.gz"
compression_flags = ["-z"]
# gnu tar obeys GZIP environment variable with options for gzip; -n = forget original filename and date
Expand Down