fpm 1.10.2 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b6cdc0fc9b8b38227b04610fd46c110032e0e831
4
- data.tar.gz: 22cf17403749f15725369b5b4dc4680da0cd9980
2
+ SHA256:
3
+ metadata.gz: 24a4dd08de1d4ad02888c110b88ab0d6fd590d4d913aba61ec459d126fb84d40
4
+ data.tar.gz: d8c7e7867cff9198ee1d170a17534946a8cb82c1217ddb09d316f061e3be86d2
5
5
  SHA512:
6
- metadata.gz: 2f21a3b4a088e2944607cb2a07ebfef3fcaeae56cca1b6dce90b3f2c405960d7459638e9301c542123db79a560fc405c2ad953f8b853e0d60064defceb6ed4c4
7
- data.tar.gz: 80a96d917176ea108c5afcf4e57ec7c22aa93625c9bb73e1868088a75b2d64774c8e048a817916ff4815b8b9998f5c69f5ac54c66e2c5d40ff6ab8c25787da76
6
+ metadata.gz: df2cbe11e18c252ef87d75f724abb3de218be2b9050e8d1918c6d323ab49e02b84793a4de327f522f04eca2fa56d90d5ba50a56f49fb36f6d5e976f10a6b4e56
7
+ data.tar.gz: 3b93a0208cb451ee13c4cdc65adec6e68c46e2619f2d54114cfa6e4745be52d28ba12223701fc496866c4878b914f896232a389b0f37f07667c80224f6724933
@@ -1,6 +1,12 @@
1
1
  Release Notes and Change Log
2
2
  ============================
3
3
 
4
+ 1.11.0 (January 30, 2019)
5
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
6
+
7
+ * snap: Snap packages can now be created! (`#1490`_; kyrofa)
8
+ * Fix an installation problem where a dependency (childprocess) fails to install correctly. (#1592; Jordan Sissel)
9
+
4
10
  1.10.2 (July 3, 2018)
5
11
  ^^^^^^^^^^^^^^^^^^^^^
6
12
 
@@ -25,6 +31,7 @@ Release Notes and Change Log
25
31
  * rpm: fix shell function name `install` conflicting with `install` program. In
26
32
  postinst (after-install), the function is now called `_install` to avoid
27
33
  conflicting with `/usr/bin/install` (`#1434`_; Torsten Schmidt)
34
+ * rpm: Allow binary "arch dependent" files in noarch rpms (Jordan Sissel)
28
35
  * - deb: --config-files ? (`#1440`_, `#1443`_; NoBodyCam)
29
36
  * FPM source repo now contains a Brewfile for use with Homebrew.
30
37
  * FPM source repo has a Dockerfile for invoking fpm with docker. (`#1484`_, ;Allan Lewis
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"
@@ -22,7 +22,7 @@ class FPM::Package::Deb < FPM::Package
22
22
  } unless defined?(SCRIPT_MAP)
23
23
 
24
24
  # The list of supported compression types. Default is gz (gzip)
25
- COMPRESSION_TYPES = [ "gz", "bzip2", "xz" ]
25
+ COMPRESSION_TYPES = [ "gz", "bzip2", "xz", "none" ]
26
26
 
27
27
  option "--ignore-iteration-in-dependencies", :flag,
28
28
  "For '=' (equal) dependencies, allow iterations on the specified " \
@@ -265,10 +265,32 @@ class FPM::Package::Deb < FPM::Package
265
265
  end # def input
266
266
 
267
267
  def extract_info(package)
268
+ compression = `#{ar_cmd[0]} t #{package}`.split("\n").grep(/control.tar/).first.split(".").last
269
+ case compression
270
+ when "gz"
271
+ controltar = "control.tar.gz"
272
+ compression = "-z"
273
+ when "bzip2","bz2"
274
+ controltar = "control.tar.bz2"
275
+ compression = "-j"
276
+ when "xz"
277
+ controltar = "control.tar.xz"
278
+ compression = "-J"
279
+ when 'tar'
280
+ controltar = "control.tar"
281
+ compression = ""
282
+ when nil
283
+ raise FPM::InvalidPackageConfiguration, "Missing control.tar in deb source package #{package}"
284
+ else
285
+ raise FPM::InvalidPackageConfiguration,
286
+ "Unknown compression type '#{compression}' for control.tar in deb source package #{package}"
287
+ end
288
+
268
289
  build_path("control").tap do |path|
269
290
  FileUtils.mkdir(path) if !File.directory?(path)
291
+ # unpack the control.tar.{,gz,bz2,xz} from the deb package into staging_path
270
292
  # Unpack the control tarball
271
- safesystem(ar_cmd[0] + " p #{package} control.tar.gz | tar -zxf - -C #{path}")
293
+ safesystem(ar_cmd[0] + " p #{package} #{controltar} | tar #{compression} -xf - -C #{path}")
272
294
 
273
295
  control = File.read(File.join(path, "control"))
274
296
 
@@ -376,15 +398,18 @@ class FPM::Package::Deb < FPM::Package
376
398
  when "xz"
377
399
  datatar = "data.tar.xz"
378
400
  compression = "-J"
401
+ when 'tar'
402
+ datatar = "data.tar"
403
+ compression = ""
404
+ when nil
405
+ raise FPM::InvalidPackageConfiguration, "Missing data.tar in deb source package #{package}"
379
406
  else
380
407
  raise FPM::InvalidPackageConfiguration,
381
- "Unknown compression type '#{self.attributes[:deb_compression]}' "
382
- "in deb source package #{package}"
408
+ "Unknown compression type '#{compression}' for data.tar in deb source package #{package}"
383
409
  end
384
410
 
385
411
  # 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}")
412
+ safesystem(ar_cmd[0] + " p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}")
388
413
  end # def extract_files
389
414
 
390
415
  def output(output_path)
@@ -559,6 +584,9 @@ class FPM::Package::Deb < FPM::Package
559
584
  when "xz"
560
585
  datatar = build_path("data.tar.xz")
561
586
  compression = "-J"
587
+ when "none"
588
+ datatar = build_path("data.tar")
589
+ compression = ""
562
590
  else
563
591
  raise FPM::InvalidPackageConfiguration,
564
592
  "Unknown compression type '#{self.attributes[:deb_compression]}'"
@@ -749,11 +777,30 @@ class FPM::Package::Deb < FPM::Package
749
777
  write_triggers # write trigger config to 'triggers' file
750
778
  write_md5sums # write the md5sums file
751
779
 
780
+ # Tar up the staging_path into control.tar.{compression type}
781
+ case self.attributes[:deb_compression]
782
+ when "gz", nil
783
+ controltar = build_path("control.tar.gz")
784
+ compression = "-z"
785
+ when "bzip2"
786
+ controltar = build_path("control.tar.bz2")
787
+ compression = "-j"
788
+ when "xz"
789
+ controltar = build_path("control.tar.xz")
790
+ compression = "-J"
791
+ when "none"
792
+ controltar = build_path("control.tar")
793
+ compression = ""
794
+ else
795
+ raise FPM::InvalidPackageConfiguration,
796
+ "Unknown compression type '#{self.attributes[:deb_compression]}'"
797
+ end
798
+
752
799
  # Make the control.tar.gz
753
800
  build_path("control.tar.gz").tap do |controltar|
754
801
  logger.info("Creating", :path => controltar, :from => control_path)
755
802
 
756
- args = [ tar_cmd, "-C", control_path, "-zcf", controltar,
803
+ args = [ tar_cmd, "-C", control_path, compression, "-cf", controltar,
757
804
  "--owner=0", "--group=0", "--numeric-owner", "." ]
758
805
  if tar_cmd_supports_sort_names_and_set_mtime? and not attributes[:source_date_epoch].nil?
759
806
  # Force deterministic file order and timestamp
@@ -931,7 +978,7 @@ class FPM::Package::Deb < FPM::Package
931
978
 
932
979
  if attributes[:deb_templates]
933
980
  FileUtils.cp(attributes[:deb_templates], control_path("templates"))
934
- File.chmod(0755, control_path("templates"))
981
+ File.chmod(0644, control_path("templates"))
935
982
  end
936
983
  end # def write_debconf
937
984
 
@@ -516,10 +516,11 @@ class FPM::Package::RPM < FPM::Package
516
516
  end
517
517
 
518
518
  # copy all files from staging to BUILD dir
519
+ # [#1538] Be sure to preserve the original timestamps.
519
520
  Find.find(staging_path) do |path|
520
521
  src = path.gsub(/^#{staging_path}/, '')
521
522
  dst = File.join(build_path, build_sub_dir, src)
522
- copy_entry(path, dst)
523
+ copy_entry(path, dst, preserve=true)
523
524
  end
524
525
 
525
526
  rpmspec = template("rpm.erb").result(binding)
@@ -0,0 +1,130 @@
1
+ require "yaml"
2
+
3
+ require "fpm/package"
4
+ require "fpm/util"
5
+ require "fileutils"
6
+ require "fpm/package/dir"
7
+
8
+ # Support for snaps (.snap files).
9
+ #
10
+ # This supports the input and output of snaps.
11
+ class FPM::Package::Snap < FPM::Package
12
+
13
+ option "--yaml", "FILEPATH",
14
+ "Custom version of the snap.yaml file." do | snap_yaml |
15
+ File.expand_path(snap_yaml)
16
+ end
17
+
18
+ option "--confinement", "CONFINEMENT",
19
+ "Type of confinement to use for this snap.",
20
+ default: "devmode" do | confinement |
21
+ if ['strict', 'devmode', 'classic'].include? confinement
22
+ confinement
23
+ else
24
+ raise "Unsupported confinement type '#{confinement}'"
25
+ end
26
+ end
27
+
28
+ option "--grade", "GRADE", "Grade of this snap.",
29
+ default: "devel" do | grade |
30
+ if ['stable', 'devel'].include? grade
31
+ grade
32
+ else
33
+ raise "Unsupported grade type '#{grade}'"
34
+ end
35
+ end
36
+
37
+ # Input a snap
38
+ def input(input_snap)
39
+ extract_snap_to_staging input_snap
40
+ extract_snap_metadata_from_staging
41
+ end # def input
42
+
43
+ # Output a snap.
44
+ def output(output_snap)
45
+ output_check(output_snap)
46
+
47
+ write_snap_yaml
48
+
49
+ # Create the snap from the staging path
50
+ safesystem("mksquashfs", staging_path, output_snap, "-noappend", "-comp",
51
+ "xz", "-no-xattrs", "-no-fragments", "-all-root")
52
+ end # def output
53
+
54
+ def to_s(format=nil)
55
+ # Default format if nil
56
+ # name_version_arch.snap
57
+ return super(format.nil? ? "NAME_FULLVERSION_ARCH.EXTENSION" : format)
58
+ end # def to_s
59
+
60
+ private
61
+
62
+ def extract_snap_to_staging(snap_path)
63
+ safesystem("unsquashfs", "-f", "-d", staging_path, snap_path)
64
+ end
65
+
66
+ def extract_snap_metadata_from_staging
67
+ metadata = YAML.safe_load(File.read(
68
+ staging_path(File.join("meta", "snap.yaml"))))
69
+
70
+ self.name = metadata["name"]
71
+ self.version = metadata["version"]
72
+ self.description = metadata["summary"] + "\n" + metadata["description"]
73
+ self.architecture = metadata["architectures"][0]
74
+ self.attributes[:snap_confinement] = metadata["confinement"]
75
+ self.attributes[:snap_grade] = metadata["grade"]
76
+
77
+ if metadata["apps"].nil?
78
+ attributes[:snap_apps] = []
79
+ else
80
+ attributes[:snap_apps] = metadata["apps"]
81
+ end
82
+
83
+ if metadata["hooks"].nil?
84
+ attributes[:snap_hooks] = []
85
+ else
86
+ attributes[:snap_hooks] = metadata["hooks"]
87
+ end
88
+ end
89
+
90
+ def write_snap_yaml
91
+ # Write the snap.yaml
92
+ if attributes[:snap_yaml]
93
+ logger.debug("Using '#{attributes[:snap_yaml]}' as the snap.yaml")
94
+ yaml_data = File.read(attributes[:snap_yaml])
95
+ else
96
+ summary, *remainder = (self.description or "no summary given").split("\n")
97
+ description = "no description given"
98
+ if remainder.any?
99
+ description = remainder.join("\n")
100
+ end
101
+
102
+ yaml_data = {
103
+ "name" => self.name,
104
+ "version" => self.version,
105
+ "summary" => summary,
106
+ "description" => description,
107
+ "architectures" => [self.architecture],
108
+ "confinement" => self.attributes[:snap_confinement],
109
+ "grade" => self.attributes[:snap_grade],
110
+ }
111
+
112
+ unless attributes[:snap_apps].nil? or attributes[:snap_apps].empty?
113
+ yaml_data["apps"] = attributes[:snap_apps]
114
+ end
115
+
116
+ unless attributes[:snap_hooks].nil? or attributes[:snap_hooks].empty?
117
+ yaml_data["hooks"] = attributes[:snap_hooks]
118
+ end
119
+
120
+ yaml_data = yaml_data.to_yaml
121
+ end
122
+
123
+ FileUtils.mkdir_p(staging_path("meta"))
124
+ snap_yaml_path = staging_path(File.join("meta", "snap.yaml"))
125
+ logger.debug("Writing snap.yaml", :path => snap_yaml_path)
126
+ File.write(snap_yaml_path, yaml_data)
127
+ File.chmod(0644, snap_yaml_path)
128
+ edit_file(snap_yaml_path) if attributes[:edit?]
129
+ end # def write_snap_yaml
130
+ end # class FPM::Package::Snap
@@ -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,3 +1,3 @@
1
1
  module FPM
2
- VERSION = "1.10.2"
2
+ VERSION = "1.11.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(", ") %>
@@ -14,9 +14,8 @@ Description: <%= firstline %>
14
14
  <%= remainder.collect { |l| l =~ /^ *$/ ? " ." : " #{l}" }.join("\n") %>
15
15
  <% end -%>
16
16
  Changes:
17
- <%= name %> (<%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>) whatever; urgency=medium
18
- .
19
- * Package created with FPM.
17
+ <%= name %> (<%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>) whatever; urgency=medium
18
+ * Package created with FPM.
20
19
  Checksums-Sha1:
21
20
  <% changes_files.each do |file| -%>
22
21
  <%= file[:sha1sum] %> <%= file[:size] %> <%= file[:name] %>
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.10.2
4
+ version: 1.11.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: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -90,16 +90,16 @@ 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: 0.9.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: 0.9.0
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: ffi
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -250,6 +250,7 @@ files:
250
250
  - lib/fpm/package/python.rb
251
251
  - lib/fpm/package/rpm.rb
252
252
  - lib/fpm/package/sh.rb
253
+ - lib/fpm/package/snap.rb
253
254
  - lib/fpm/package/solaris.rb
254
255
  - lib/fpm/package/tar.rb
255
256
  - lib/fpm/package/virtualenv.rb
@@ -301,8 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
302
  - !ruby/object:Gem::Version
302
303
  version: '0'
303
304
  requirements: []
304
- rubyforge_project:
305
- rubygems_version: 2.6.11
305
+ rubygems_version: 3.0.1
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: fpm - package building and mangling