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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d5615d2c9718bda8c319b0bcb73a2dd78ad6a27d
4
- data.tar.gz: 4de9f492b1362ff219e8fd7fb66c8e383f234500
2
+ SHA256:
3
+ metadata.gz: 28f939bd20768768cb05026a39c8a270596368c654ec5606a43a0e75afa845ad
4
+ data.tar.gz: 0d7eea7108832e79994ba3ee9511c3715b384906f7ef3a2ab5e907cfc764609a
5
5
  SHA512:
6
- metadata.gz: 94a52dec3c70f4e49389d136a9922b315534bbbbb9728eee1eb97d5a60813d8664ae718eb464c4164df11011ef9634d0a1f878416d4d6bbcd3bfefe653c733c6
7
- data.tar.gz: ca134fd3b9321671862de426002f8b924727fac05f8124a0be831fc69595b2d66a0abdaebb4a279f5c645612ab74cb636680825b17e332a9aea1bcd6c88fb2cf
6
+ metadata.gz: 555edd6cd5d4b0098e075011e48db96e52c454b8557735a51202307dcaeb4920a5efe93bb6d99cedf9d3ff95ff445c37059e1fc308e0602482977587d532e4b1
7
+ data.tar.gz: 2803ea8cb3af495d5fd20e75bee0eba11dc262ac59b86e63b75ef3cef7417440e88e1fec9172f7a1ea5cf0705e2ce36bc65e7b9c1c5469eb0e78b292ac822716
@@ -1,6 +1,58 @@
1
1
  Release Notes and Change Log
2
2
  ============================
3
3
 
4
+ 1.12.0 (January 19, 2021)
5
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
6
+
7
+ * 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)
8
+ * deb: New flag to add 'set -e' to all scripts. `--deb-maintainerscripts-force-errorchecks` which defaults to off. (`#1697`_; Andreas Ulm)
9
+ * 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)
10
+ * deb: Fix error 'uninitialized constant FPM::Package::Deb::Zlib' (`#1739`_, `#1740`_; Federico Lancerin)
11
+ * python: Prepend to PYTHONPATH instead of replacing it. This should help on platforms that rely heavily on PYTHONPATH, such as NixOSX (`#1711`_, `#1710`_; anarg)
12
+ * python: Add `--python-trusted-host` flag which passes `--trusted-host` flag to `pip` (`#1737`_; Vladimir Ponarevsky)
13
+ * Documentation improvements (`#1724`_, `#1738`_, `#1667`_, `#1636`_)
14
+ * Dockerfile updated to Alpine 3.12 (`#1745`_; Cameron Nemo)
15
+ * Remove the 'backports' deprecation warning (`#1727`_; Jose Galvez)
16
+ * sh: Performance improvement when printing package metadata (`#1729`_; James Logsdon, Ed Healy)
17
+ * rpm: Add support for `xzmt` compression (multithreaded xz compressor) to help when creating very large packages (several gigabytes). (`#1447`_, `#1419`_; amnobc)
18
+ * 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)
19
+ * deb: use correct control.tar filename (`#1668`_; Mike Perham)
20
+
21
+ 1.11.0 (January 30, 2019)
22
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
23
+
24
+ * snap: Snap packages can now be created! (`#1490`_; kyrofa)
25
+ * Fix an installation problem where a dependency (childprocess) fails to install correctly. (#1592; Jordan Sissel)
26
+
27
+ 1.10.2 (July 3, 2018)
28
+ ^^^^^^^^^^^^^^^^^^^^^
29
+
30
+ * cpan: Fix a crash where fpm would crash trying to parse a perl version string (`#1515`_, `#1514`; Jordan Sissel, William N. Braswell, Jr)
31
+
32
+ 1.10.1 (July 3, 2018)
33
+ ^^^^^^^^^^^^^^^^^^^^^
34
+
35
+ * cpan: Fixes some package building by setting PERL5LIB correctly (`#1509`_, `#1511`_; William N. Braswell, Jr)
36
+ * cpan: Adds `--[no-]cpan-verbose` flag which, when set, runs `cpanm` with the `--verbose` flag (`#1511`_; William N. Braswell, Jr)
37
+
38
+ 1.10.0 (May 21, 2018)
39
+ ^^^^^^^^^^^^^^^^^^^^
40
+
41
+ * Pin `ruby-xz` dependency to one which allows Ruby versions older than 2.3.0 (`#1494`_; Marat Sharafutdinov)
42
+ * Documentation improvements: `#1488`_; Arthur Burkart. `#1384`_; Justin Kolberg. `#1452`_; Anatoli Babenia.
43
+ * python: Improve support for the `~=` dependency comparison. (`#1482`_; Roman Vasilyev)
44
+ * deb: Add `--deb-generate-changes` flag to have fpm output a `.changes` file (`#1492`_; Spida)
45
+ * deb: Add `--deb-dist` flag to set the target distribution (similar to `--rpm-dist`). (`#1492`_; Spida)
46
+ * apk: Make --before-install, --before-upgrade, and --after-upgrade work correctly. (`#1422`_; Charles R. Portwood II)
47
+ * rpm: add `xzmt` for multithreaded xz compression (Amnon BC)
48
+ * rpm: fix shell function name `install` conflicting with `install` program. In
49
+ postinst (after-install), the function is now called `_install` to avoid
50
+ conflicting with `/usr/bin/install` (`#1434`_; Torsten Schmidt)
51
+ * rpm: Allow binary "arch dependent" files in noarch rpms (Jordan Sissel)
52
+ * - deb: --config-files ? (`#1440`_, `#1443`_; NoBodyCam)
53
+ * FPM source repo now contains a Brewfile for use with Homebrew.
54
+ * FPM source repo has a Dockerfile for invoking fpm with docker. (`#1484`_, ;Allan Lewis
55
+
4
56
  1.9.3 (September 11, 2017)
5
57
  ^^^^^^^^^^^^^^^^^^^^^^^^^^
6
58
 
@@ -19,7 +71,7 @@ Release Notes and Change Log
19
71
  * Fix bug so fpm can now copy symlinks correctly (`#1348`_; ServiusHack)
20
72
  * apk: Improve performance (`#1358`_; Jan Delgado)
21
73
  * cpan: Fix crash when CPAN query returns a version value that was a number and fpm was expecting a string. (`#1344`_, `#1343`_; liger1978)
22
- * cpan: Fix MetaCPAN searches to use v1 of MetaCPAN's API. The v0 API is no longer provided by MetaCPAN. (`#1341`_, `#1339`; Bob Bell)
74
+ * cpan: Fix MetaCPAN searches to use v1 of MetaCPAN's API. The v0 API is no longer provided by MetaCPAN. (`#1341`_, `#1339`_; Bob Bell)
23
75
  * cpan: Have perl modules implicitly "provide" (`--provides`) capabilities. (`#1340`_; Bob Bell. `#1345`_; liger1978)
24
76
  * cpan: Now transforms perl version values like "5.008001" to "5.8.1" (`#1342`_; Bob Bell)
25
77
  * cpan: Use `>=` ("this version or newer") for package dependencies instead of `=` ("exactly this version"). (`#1338`_; Bob Bell)
data/bin/fpm CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "rubygems"
4
3
  $: << File.join(File.dirname(__FILE__), "..", "lib")
5
4
  require "fpm"
6
5
  require "fpm/command"
data/lib/fpm.rb CHANGED
@@ -18,3 +18,4 @@ require "fpm/package/p5p"
18
18
  require "fpm/package/pkgin"
19
19
  require "fpm/package/freebsd"
20
20
  require "fpm/package/apk"
21
+ require "fpm/package/snap"
@@ -3,7 +3,8 @@ require "fpm/util" # local
3
3
  require "pathname" # stdlib
4
4
  require "find"
5
5
  require "tmpdir" # stdlib
6
- require "backports" # gem 'backports'
6
+ require "ostruct"
7
+ require "backports/latest"
7
8
  require "socket" # stdlib, for Socket.gethostname
8
9
  require "shellwords" # stdlib, for Shellwords.escape
9
10
  require "erb" # stdlib, for template processing
@@ -118,7 +119,10 @@ class FPM::Package
118
119
 
119
120
  def initialize
120
121
  # Attributes for this specific package
121
- @attributes = {}
122
+ @attributes = {
123
+ # Default work location
124
+ :workdir => ::Dir.tmpdir
125
+ }
122
126
 
123
127
  # Reference
124
128
  # http://www.debian.org/doc/manuals/maint-guide/first.en.html
@@ -312,7 +316,7 @@ class FPM::Package
312
316
  # the path before returning.
313
317
  #
314
318
  # Wrapping Find.find in an Enumerator is required for sane operation in ruby 1.8.7,
315
- # 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)
316
320
  return Enumerator.new { |y| Find.find(staging_path) { |path| y << path } } \
317
321
  .select { |path| path != staging_path } \
318
322
  .select { |path| is_leaf.call(path) } \
@@ -507,7 +511,7 @@ class FPM::Package
507
511
  end
508
512
  end
509
513
  end
510
-
514
+
511
515
  # Get the contents of the script by a given name.
512
516
  #
513
517
  # If template_scripts? is set in attributes (often by the --template-scripts
@@ -3,7 +3,7 @@ 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
9
  require 'digest/sha1'
@@ -144,9 +144,9 @@ class FPM::Package::APK< FPM::Package
144
144
  scripts = {}
145
145
 
146
146
  scripts = register_script('post-install', :after_install, scripts)
147
- scripts = register_script('post-install', :before_install, scripts)
148
- scripts = register_script('post-install', :before_upgrade, scripts)
149
- scripts = register_script('post-install', :after_upgrade, scripts)
147
+ scripts = register_script('pre-install', :before_install, scripts)
148
+ scripts = register_script('pre-upgrade', :before_upgrade, scripts)
149
+ scripts = register_script('post-upgrade', :after_upgrade, scripts)
150
150
  scripts = register_script('pre-deinstall', :before_remove, scripts)
151
151
  scripts = register_script('post-deinstall', :after_remove, scripts)
152
152
 
@@ -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
- if attributes[:cpan_test?]
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"]))
@@ -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 " \
@@ -50,6 +51,8 @@ class FPM::Package::Deb < FPM::Package
50
51
  value
51
52
  end
52
53
 
54
+ option "--dist", "DIST-TAG", "Set the deb distribution.", :default => "unstable"
55
+
53
56
  # Take care about the case when we want custom control file but still use fpm ...
54
57
  option "--custom-control", "FILEPATH",
55
58
  "Custom version of the Debian control file." do |control|
@@ -88,6 +91,10 @@ class FPM::Package::Deb < FPM::Package
88
91
  File.expand_path(file)
89
92
  end
90
93
 
94
+ option "--generate-changes", :flag,
95
+ "Generate PACKAGENAME.changes file.",
96
+ :default => false
97
+
91
98
  option "--upstream-changelog", "FILEPATH", "Add FILEPATH as upstream changelog" do |file|
92
99
  File.expand_path(file)
93
100
  end
@@ -175,6 +182,10 @@ class FPM::Package::Deb < FPM::Package
175
182
  next File.expand_path(file)
176
183
  end
177
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
+
178
189
  option "--systemd-restart-after-upgrade", :flag , "Restart service after upgrade", :default => true
179
190
 
180
191
  option "--after-purge", "FILE",
@@ -183,6 +194,11 @@ class FPM::Package::Deb < FPM::Package
183
194
  File.expand_path(val) # Get the full path to the script
184
195
  end # --after-purge
185
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
+
186
202
  def initialize(*args)
187
203
  super(*args)
188
204
  attributes[:deb_priority] = "extra"
@@ -259,10 +275,32 @@ class FPM::Package::Deb < FPM::Package
259
275
  end # def input
260
276
 
261
277
  def extract_info(package)
278
+ compression = `#{ar_cmd[0]} t #{package}`.split("\n").grep(/control.tar/).first.split(".").last
279
+ case compression
280
+ when "gz"
281
+ controltar = "control.tar.gz"
282
+ compression = "-z"
283
+ when "bzip2","bz2"
284
+ controltar = "control.tar.bz2"
285
+ compression = "-j"
286
+ when "xz"
287
+ controltar = "control.tar.xz"
288
+ compression = "-J"
289
+ when 'tar'
290
+ controltar = "control.tar"
291
+ compression = ""
292
+ when nil
293
+ raise FPM::InvalidPackageConfiguration, "Missing control.tar in deb source package #{package}"
294
+ else
295
+ raise FPM::InvalidPackageConfiguration,
296
+ "Unknown compression type '#{compression}' for control.tar in deb source package #{package}"
297
+ end
298
+
262
299
  build_path("control").tap do |path|
263
300
  FileUtils.mkdir(path) if !File.directory?(path)
301
+ # unpack the control.tar.{,gz,bz2,xz} from the deb package into staging_path
264
302
  # Unpack the control tarball
265
- safesystem(ar_cmd[0] + " p #{package} control.tar.gz | tar -zxf - -C #{path}")
303
+ safesystem(ar_cmd[0] + " p #{package} #{controltar} | tar #{compression} -xf - -C #{path}")
266
304
 
267
305
  control = File.read(File.join(path, "control"))
268
306
 
@@ -370,15 +408,18 @@ class FPM::Package::Deb < FPM::Package
370
408
  when "xz"
371
409
  datatar = "data.tar.xz"
372
410
  compression = "-J"
411
+ when 'tar'
412
+ datatar = "data.tar"
413
+ compression = ""
414
+ when nil
415
+ raise FPM::InvalidPackageConfiguration, "Missing data.tar in deb source package #{package}"
373
416
  else
374
417
  raise FPM::InvalidPackageConfiguration,
375
- "Unknown compression type '#{self.attributes[:deb_compression]}' "
376
- "in deb source package #{package}"
418
+ "Unknown compression type '#{compression}' for data.tar in deb source package #{package}"
377
419
  end
378
420
 
379
421
  # unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path
380
- safesystem(ar_cmd[0] + " p #{package} #{datatar} " \
381
- "| tar #{compression} -xf - -C #{staging_path}")
422
+ safesystem(ar_cmd[0] + " p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}")
382
423
  end # def extract_files
383
424
 
384
425
  def output(output_path)
@@ -422,6 +463,7 @@ class FPM::Package::Deb < FPM::Package
422
463
  raise "#{name}: tar is insufficient to support source_date_epoch."
423
464
  end
424
465
 
466
+ attributes[:deb_systemd] = []
425
467
  attributes.fetch(:deb_systemd_list, []).each do |systemd|
426
468
  name = File.basename(systemd, ".service")
427
469
  dest_systemd = staging_path("lib/systemd/system/#{name}.service")
@@ -429,19 +471,19 @@ class FPM::Package::Deb < FPM::Package
429
471
  FileUtils.cp(systemd, dest_systemd)
430
472
  File.chmod(0644, dest_systemd)
431
473
 
432
- # set the attribute with the systemd service name
433
- attributes[:deb_systemd] = name
474
+ # add systemd service name to attribute
475
+ attributes[:deb_systemd] << name
434
476
  end
435
477
 
436
- if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd]
478
+ if script?(:before_upgrade) or script?(:after_upgrade) or attributes[:deb_systemd].any?
437
479
  puts "Adding action files"
438
480
  if script?(:before_install) or script?(:before_upgrade)
439
481
  scripts[:before_install] = template("deb/preinst_upgrade.sh.erb").result(binding)
440
482
  end
441
- if script?(:before_remove) or attributes[:deb_systemd]
483
+ if script?(:before_remove) or not attributes[:deb_systemd].empty?
442
484
  scripts[:before_remove] = template("deb/prerm_upgrade.sh.erb").result(binding)
443
485
  end
444
- if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd]
486
+ if script?(:after_install) or script?(:after_upgrade) or attributes[:deb_systemd].any?
445
487
  scripts[:after_install] = template("deb/postinst_upgrade.sh.erb").result(binding)
446
488
  end
447
489
  if script?(:after_remove)
@@ -553,6 +595,9 @@ class FPM::Package::Deb < FPM::Package
553
595
  when "xz"
554
596
  datatar = build_path("data.tar.xz")
555
597
  compression = "-J"
598
+ when "none"
599
+ datatar = build_path("data.tar")
600
+ compression = ""
556
601
  else
557
602
  raise FPM::InvalidPackageConfiguration,
558
603
  "Unknown compression type '#{self.attributes[:deb_compression]}'"
@@ -574,6 +619,30 @@ class FPM::Package::Deb < FPM::Package
574
619
  safesystem(*ar_cmd, output_path, "debian-binary", "control.tar.gz", datatar)
575
620
  end
576
621
  end
622
+
623
+ # if a PACKAGENAME.changes file is to be created
624
+ if self.attributes[:deb_generate_changes?]
625
+ distribution = self.attributes[:deb_dist]
626
+
627
+ # gather information about the files to distribute
628
+ files = [ output_path ]
629
+ changes_files = []
630
+ files.each do |path|
631
+ changes_files.push({
632
+ :name => path,
633
+ :size => File.size?(path),
634
+ :md5sum => Digest::MD5.file(path).hexdigest,
635
+ :sha1sum => Digest::SHA1.file(path).hexdigest,
636
+ :sha256sum => Digest::SHA2.file(path).hexdigest,
637
+ })
638
+ end
639
+
640
+ # write change infos to .changes file
641
+ changes_path = File.basename(output_path, '.deb') + '.changes'
642
+ changes_data = template("deb/deb.changes.erb").result(binding)
643
+ File.write(changes_path, changes_data)
644
+ logger.log("Created changes", :path => changes_path)
645
+ end # if deb_generate_changes
577
646
  end # def output
578
647
 
579
648
  def converted_from(origin)
@@ -652,8 +721,13 @@ class FPM::Package::Deb < FPM::Package
652
721
  name, version = dep.gsub(/[()~>]/, "").split(/ +/)[0..1]
653
722
  nextversion = version.split(".").collect { |v| v.to_i }
654
723
  l = nextversion.length
655
- nextversion[l-2] += 1
656
- nextversion[l-1] = 0
724
+ if l > 1
725
+ nextversion[l-2] += 1
726
+ nextversion[l-1] = 0
727
+ else
728
+ # Single component versions ~> 1
729
+ nextversion[l-1] += 1
730
+ end
657
731
  nextversion = nextversion.join(".")
658
732
  return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
659
733
  elsif (m = dep.match(/(\S+)\s+\(!= (.+)\)/))
@@ -719,11 +793,30 @@ class FPM::Package::Deb < FPM::Package
719
793
  write_triggers # write trigger config to 'triggers' file
720
794
  write_md5sums # write the md5sums file
721
795
 
796
+ # Tar up the staging_path into control.tar.{compression type}
797
+ case self.attributes[:deb_compression]
798
+ when "gz", nil
799
+ controltar = "control.tar.gz"
800
+ compression = "-z"
801
+ when "bzip2"
802
+ controltar = "control.tar.bz2"
803
+ compression = "-j"
804
+ when "xz"
805
+ controltar = "control.tar.xz"
806
+ compression = "-J"
807
+ when "none"
808
+ controltar = "control.tar"
809
+ compression = ""
810
+ else
811
+ raise FPM::InvalidPackageConfiguration,
812
+ "Unknown compression type '#{self.attributes[:deb_compression]}'"
813
+ end
814
+
722
815
  # Make the control.tar.gz
723
- build_path("control.tar.gz").tap do |controltar|
816
+ build_path(controltar).tap do |controltar|
724
817
  logger.info("Creating", :path => controltar, :from => control_path)
725
818
 
726
- args = [ tar_cmd, "-C", control_path, "-zcf", controltar,
819
+ args = [ tar_cmd, "-C", control_path, compression, "-cf", controltar,
727
820
  "--owner=0", "--group=0", "--numeric-owner", "." ]
728
821
  if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
729
822
  # Force deterministic file order and timestamp
@@ -827,11 +920,25 @@ class FPM::Package::Deb < FPM::Package
827
920
 
828
921
  # scan all conf file paths for files and add them
829
922
  config_files.each do |path|
923
+ logger.debug("Checking if #{path} exists")
924
+ cfe = File.exist?("#{path}")
925
+ logger.debug("Check result #{cfe}")
830
926
  begin
831
927
  add_path(path, allconfigs)
832
928
  rescue Errno::ENOENT
833
- raise FPM::InvalidPackageConfiguration,
834
- "Error trying to use '#{path}' as a config file in the package. Does it exist?"
929
+ if !cfe
930
+ raise FPM::InvalidPackageConfiguration,
931
+ "Error trying to use '#{path}' as a config file in the package. Does it exist?"
932
+ else
933
+ dcl = File.join(staging_path, path)
934
+ if !File.exist?("#{dcl}")
935
+ logger.debug("Adding config file #{path} to Staging area #{staging_path}")
936
+ FileUtils.mkdir_p(File.dirname(dcl))
937
+ FileUtils.cp_r path, dcl
938
+ else
939
+ logger.debug("Config file aready exists in staging area.")
940
+ end
941
+ end
835
942
  end
836
943
  end
837
944
 
@@ -887,7 +994,7 @@ class FPM::Package::Deb < FPM::Package
887
994
 
888
995
  if attributes[:deb_templates]
889
996
  FileUtils.cp(attributes[:deb_templates], control_path("templates"))
890
- File.chmod(0755, control_path("templates"))
997
+ File.chmod(0644, control_path("templates"))
891
998
  end
892
999
  end # def write_debconf
893
1000