omnibus 6.0.1 → 6.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/lib/omnibus/build_version.rb +1 -1
  4. data/lib/omnibus/builder.rb +1 -1
  5. data/lib/omnibus/changelog.rb +1 -1
  6. data/lib/omnibus/compressors/dmg.rb +18 -6
  7. data/lib/omnibus/core_extensions/open_uri.rb +1 -1
  8. data/lib/omnibus/exceptions.rb +103 -103
  9. data/lib/omnibus/fetchers/net_fetcher.rb +8 -6
  10. data/lib/omnibus/generator_files/.kitchen.local.yml.erb +10 -0
  11. data/lib/omnibus/generator_files/.kitchen.yml.erb +41 -0
  12. data/lib/omnibus/generator_files/Gemfile.erb +3 -3
  13. data/lib/omnibus/git_repository.rb +1 -1
  14. data/lib/omnibus/licensing.rb +1 -0
  15. data/lib/omnibus/metadata.rb +15 -15
  16. data/lib/omnibus/packager.rb +11 -10
  17. data/lib/omnibus/packagers/appx.rb +4 -4
  18. data/lib/omnibus/packagers/base.rb +19 -0
  19. data/lib/omnibus/packagers/bff.rb +13 -13
  20. data/lib/omnibus/packagers/deb.rb +14 -14
  21. data/lib/omnibus/packagers/ips.rb +7 -7
  22. data/lib/omnibus/packagers/msi.rb +73 -25
  23. data/lib/omnibus/packagers/pkg.rb +10 -10
  24. data/lib/omnibus/packagers/pkgsrc.rb +5 -5
  25. data/lib/omnibus/packagers/rpm.rb +31 -31
  26. data/lib/omnibus/packagers/solaris.rb +2 -2
  27. data/lib/omnibus/packagers/windows_base.rb +2 -2
  28. data/lib/omnibus/project.rb +4 -0
  29. data/lib/omnibus/publishers/artifactory_publisher.rb +17 -17
  30. data/lib/omnibus/publishers/s3_publisher.rb +20 -6
  31. data/lib/omnibus/s3_cache.rb +5 -5
  32. data/lib/omnibus/s3_helpers.rb +6 -4
  33. data/lib/omnibus/software.rb +7 -12
  34. data/lib/omnibus/version.rb +1 -1
  35. data/lib/omnibus/whitelist.rb +1 -0
  36. data/omnibus.gemspec +6 -7
  37. data/spec/functional/builder_spec.rb +1 -1
  38. data/spec/functional/licensing_spec.rb +49 -49
  39. data/spec/functional/templating_spec.rb +3 -3
  40. data/spec/support/git_helpers.rb +5 -5
  41. data/spec/unit/changelog_spec.rb +7 -7
  42. data/spec/unit/changelogprinter_spec.rb +5 -5
  43. data/spec/unit/compressors/dmg_spec.rb +7 -2
  44. data/spec/unit/generator_spec.rb +6 -34
  45. data/spec/unit/manifest_diff_spec.rb +18 -18
  46. data/spec/unit/metadata_spec.rb +10 -19
  47. data/spec/unit/packager_spec.rb +7 -7
  48. data/spec/unit/packagers/base_spec.rb +17 -0
  49. data/spec/unit/packagers/deb_spec.rb +1 -1
  50. data/spec/unit/packagers/ips_spec.rb +1 -1
  51. data/spec/unit/packagers/msi_spec.rb +45 -0
  52. data/spec/unit/packagers/pkg_spec.rb +1 -1
  53. data/spec/unit/packagers/rpm_spec.rb +1 -46
  54. data/spec/unit/packagers/solaris_spec.rb +3 -3
  55. data/spec/unit/software_spec.rb +2 -53
  56. data/spec/unit/util_spec.rb +1 -1
  57. metadata +21 -28
@@ -19,10 +19,10 @@ module Omnibus
19
19
  # @return [Hash]
20
20
  SCRIPT_MAP = {
21
21
  # Default Omnibus naming
22
- preinst: "preinstall",
22
+ preinst: "preinstall",
23
23
  postinst: "postinstall",
24
24
  # Default PKG naming
25
- preinstall: "preinstall",
25
+ preinstall: "preinstall",
26
26
  postinstall: "postinstall",
27
27
  }.freeze
28
28
 
@@ -39,11 +39,11 @@ module Omnibus
39
39
  render_template(resource_path("license.html.erb"),
40
40
  destination: "#{resources_dir}/license.html",
41
41
  variables: {
42
- name: project.name,
42
+ name: project.name,
43
43
  friendly_name: project.friendly_name,
44
- maintainer: project.maintainer,
44
+ maintainer: project.maintainer,
45
45
  build_version: project.build_version,
46
- package_name: project.package_name,
46
+ package_name: project.package_name,
47
47
  }
48
48
  )
49
49
 
@@ -51,11 +51,11 @@ module Omnibus
51
51
  render_template(resource_path("welcome.html.erb"),
52
52
  destination: "#{resources_dir}/welcome.html",
53
53
  variables: {
54
- name: project.name,
54
+ name: project.name,
55
55
  friendly_name: project.friendly_name,
56
- maintainer: project.maintainer,
56
+ maintainer: project.maintainer,
57
57
  build_version: project.build_version,
58
- package_name: project.package_name,
58
+ package_name: project.package_name,
59
59
  }
60
60
  )
61
61
 
@@ -218,8 +218,8 @@ module Omnibus
218
218
  mode: 0600,
219
219
  variables: {
220
220
  friendly_name: project.friendly_name,
221
- identifier: safe_identifier,
222
- version: safe_version,
221
+ identifier: safe_identifier,
222
+ version: safe_version,
223
223
  component_pkg: component_pkg,
224
224
  }
225
225
  )
@@ -62,11 +62,11 @@ module Omnibus
62
62
  end
63
63
 
64
64
  def write_buildinfo
65
- buildinfo_content = <<-EOF
66
- MACHINE_ARCH=#{safe_architecture}
67
- OPSYS=#{opsys}
68
- OS_VERSION=#{os_version}
69
- PKGTOOLS_VERSION=#{PKGTOOLS_VERSION}
65
+ buildinfo_content = <<~EOF
66
+ MACHINE_ARCH=#{safe_architecture}
67
+ OPSYS=#{opsys}
68
+ OS_VERSION=#{os_version}
69
+ PKGTOOLS_VERSION=#{PKGTOOLS_VERSION}
70
70
  EOF
71
71
 
72
72
  File.open(build_info, "w+") do |f|
@@ -21,18 +21,18 @@ module Omnibus
21
21
  # @return [Hash]
22
22
  SCRIPT_MAP = {
23
23
  # Default Omnibus naming
24
- preinst: "pre",
24
+ preinst: "pre",
25
25
  postinst: "post",
26
- prerm: "preun",
27
- postrm: "postun",
26
+ prerm: "preun",
27
+ postrm: "postun",
28
28
  # Default RPM naming
29
- pre: "pre",
30
- post: "post",
31
- preun: "preun",
32
- postun: "postun",
29
+ pre: "pre",
30
+ post: "post",
31
+ preun: "preun",
32
+ postun: "postun",
33
33
  verifyscript: "verifyscript",
34
- pretans: "pretans",
35
- posttrans: "posttrans",
34
+ pretrans: "pretrans",
35
+ posttrans: "posttrans",
36
36
  }.freeze
37
37
 
38
38
  id :rpm
@@ -361,28 +361,28 @@ module Omnibus
361
361
  render_template(resource_path("spec.erb"),
362
362
  destination: spec_file,
363
363
  variables: {
364
- name: safe_base_package_name,
365
- version: safe_version,
366
- iteration: safe_build_iteration,
367
- vendor: vendor,
368
- license: license,
369
- dist_tag: dist_tag,
370
- maintainer: project.maintainer,
371
- homepage: project.homepage,
372
- description: project.description,
373
- priority: priority,
374
- category: category,
375
- conflicts: project.conflicts,
376
- replaces: project.replaces,
377
- dependencies: project.runtime_dependencies,
378
- user: project.package_user,
379
- group: project.package_group,
380
- scripts: scripts,
381
- config_files: config_files,
382
- files: files,
383
- build_dir: build_dir,
364
+ name: safe_base_package_name,
365
+ version: safe_version,
366
+ iteration: safe_build_iteration,
367
+ vendor: vendor,
368
+ license: license,
369
+ dist_tag: dist_tag,
370
+ maintainer: project.maintainer,
371
+ homepage: project.homepage,
372
+ description: project.description,
373
+ priority: priority,
374
+ category: category,
375
+ conflicts: project.conflicts,
376
+ replaces: project.replaces,
377
+ dependencies: project.runtime_dependencies,
378
+ user: project.package_user,
379
+ group: project.package_group,
380
+ scripts: scripts,
381
+ config_files: config_files,
382
+ files: files,
383
+ build_dir: build_dir,
384
384
  platform_family: Ohai["platform_family"],
385
- compression: compression,
385
+ compression: compression,
386
386
  }
387
387
  )
388
388
  end
@@ -583,7 +583,7 @@ module Omnibus
583
583
  #
584
584
  if version =~ /\-/
585
585
  if Ohai["platform_family"] == "wrlinux"
586
- converted = version.tr("-", "_") #WRL has an elderly RPM version
586
+ converted = version.tr("-", "_") # WRL has an elderly RPM version
587
587
  log.warn(log_key) do
588
588
  "Omnibus replaces dashes (-) with tildes (~) so pre-release " \
589
589
  "versions get sorted earlier than final versions. However, the " \
@@ -21,10 +21,10 @@ module Omnibus
21
21
  # @return [Hash]
22
22
  SCRIPT_MAP = {
23
23
  # Default Omnibus naming
24
- postinst: "postinstall",
24
+ postinst: "postinstall",
25
25
  postrm: "postremove",
26
26
  # Default Solaris naming
27
- postinstall: "postinstall",
27
+ postinstall: "postinstall",
28
28
  postremove: "postremove",
29
29
  }.freeze
30
30
 
@@ -17,7 +17,7 @@
17
17
  module Omnibus
18
18
  class Packager::WindowsBase < Packager::Base
19
19
  DEFAULT_TIMESTAMP_SERVERS = ["http://timestamp.digicert.com",
20
- "http://timestamp.verisign.com/scripts/timestamp.dll"]
20
+ "http://timestamp.verisign.com/scripts/timestamp.dll"].freeze
21
21
 
22
22
  #
23
23
  # Set the signing certificate name
@@ -145,7 +145,7 @@ module Omnibus
145
145
  STDERR
146
146
  ------
147
147
  #{status.stderr}
148
- EOH
148
+ EOH
149
149
  end
150
150
  end
151
151
  status.exitstatus == 0
@@ -1141,6 +1141,10 @@ module Omnibus
1141
1141
  packager.evaluate(&block)
1142
1142
  end
1143
1143
 
1144
+ if packager.skip_packager
1145
+ log.info(log_key) { "Skipping #{packager.id} per project configuration." }
1146
+ next
1147
+ end
1144
1148
  # Run the actual packager
1145
1149
  packager.run!
1146
1150
 
@@ -95,7 +95,7 @@ module Omnibus
95
95
  local_path: artifact.path,
96
96
  client: client,
97
97
  checksums: {
98
- "md5" => md5,
98
+ "md5" => md5,
99
99
  "sha1" => sha1,
100
100
  }
101
101
  )
@@ -151,13 +151,13 @@ module Omnibus
151
151
  {
152
152
  type: File.extname(package.path).split(".").last,
153
153
  sha1: package.metadata[:sha1],
154
- md5: package.metadata[:md5],
154
+ md5: package.metadata[:md5],
155
155
  name: package.metadata[:basename],
156
156
  },
157
157
  {
158
158
  type: File.extname(package.metadata.path).split(".").last,
159
159
  sha1: digest(package.metadata.path, :sha1),
160
- md5: digest(package.metadata.path, :md5),
160
+ md5: digest(package.metadata.path, :md5),
161
161
  name: File.basename(package.metadata.path),
162
162
  },
163
163
  ]
@@ -211,21 +211,21 @@ module Omnibus
211
211
  #
212
212
  def metadata_properties_for(package)
213
213
  metadata = {
214
- "omnibus.project" => package.metadata[:name],
215
- "omnibus.platform" => package.metadata[:platform],
214
+ "omnibus.project" => package.metadata[:name],
215
+ "omnibus.platform" => package.metadata[:platform],
216
216
  "omnibus.platform_version" => package.metadata[:platform_version],
217
- "omnibus.architecture" => package.metadata[:arch],
218
- "omnibus.version" => package.metadata[:version],
219
- "omnibus.iteration" => package.metadata[:iteration],
220
- "omnibus.license" => package.metadata[:license],
221
- "omnibus.md5" => package.metadata[:md5],
222
- "omnibus.sha1" => package.metadata[:sha1],
223
- "omnibus.sha256" => package.metadata[:sha256],
224
- "omnibus.sha512" => package.metadata[:sha512],
225
- "md5" => package.metadata[:md5],
226
- "sha1" => package.metadata[:sha1],
227
- "sha256" => package.metadata[:sha256],
228
- "sha512" => package.metadata[:sha512],
217
+ "omnibus.architecture" => package.metadata[:arch],
218
+ "omnibus.version" => package.metadata[:version],
219
+ "omnibus.iteration" => package.metadata[:iteration],
220
+ "omnibus.license" => package.metadata[:license],
221
+ "omnibus.md5" => package.metadata[:md5],
222
+ "omnibus.sha1" => package.metadata[:sha1],
223
+ "omnibus.sha256" => package.metadata[:sha256],
224
+ "omnibus.sha512" => package.metadata[:sha512],
225
+ "md5" => package.metadata[:md5],
226
+ "sha1" => package.metadata[:sha1],
227
+ "sha256" => package.metadata[:sha256],
228
+ "sha512" => package.metadata[:sha512],
229
229
  }.tap do |h|
230
230
  if build_record?
231
231
  h["build.name"] = package.metadata[:name]
@@ -30,13 +30,27 @@ module Omnibus
30
30
 
31
31
  # Upload the metadata first
32
32
  log.debug(log_key) { "Uploading '#{package.metadata.name}'" }
33
- store_object(key_for(package, package.metadata.name), FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
34
- nil, access_policy)
33
+
34
+ s3_metadata_object = store_object(
35
+ key_for(package, package.metadata.name),
36
+ FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
37
+ nil,
38
+ access_policy
39
+ )
40
+
41
+ log.debug(log_key) { "Uploading is completed. Download URL (#{access_policy}): #{s3_metadata_object.public_url}" }
35
42
 
36
43
  # Upload the actual package
37
44
  log.info(log_key) { "Uploading '#{package.name}'" }
38
- store_object(key_for(package, package.name), package.content,
39
- package.metadata[:md5], access_policy)
45
+
46
+ s3_object = store_object(
47
+ key_for(package, package.name),
48
+ package.content,
49
+ package.metadata[:md5],
50
+ access_policy
51
+ )
52
+
53
+ log.info(log_key) { "Uploading is completed. Download URL (#{access_policy}): #{s3_object.public_url}" }
40
54
 
41
55
  # If a block was given, "yield" the package to the caller
42
56
  yield(package) if block
@@ -47,8 +61,8 @@ module Omnibus
47
61
 
48
62
  def s3_configuration
49
63
  config = {
50
- region: @options[:region],
51
- bucket_name: @options[:bucket],
64
+ region: @options[:region],
65
+ bucket_name: @options[:bucket],
52
66
  }
53
67
 
54
68
  if Config.publish_s3_profile
@@ -140,11 +140,11 @@ module Omnibus
140
140
 
141
141
  def s3_configuration
142
142
  config = {
143
- region: Config.s3_region,
144
- bucket_name: Config.s3_bucket,
145
- endpoint: Config.s3_endpoint,
146
- use_accelerate_endpoint: Config.s3_accelerate,
147
- force_path_style: Config.s3_force_path_style,
143
+ region: Config.s3_region,
144
+ bucket_name: Config.s3_bucket,
145
+ endpoint: Config.s3_endpoint,
146
+ use_accelerate_endpoint: Config.s3_accelerate,
147
+ force_path_style: Config.s3_force_path_style,
148
148
  }
149
149
 
150
150
  if Config.s3_profile
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require "aws-sdk"
17
+ require "aws-sdk-s3"
18
18
  require "aws-sdk-core/credentials"
19
19
  require "aws-sdk-core/shared_credentials"
20
20
  require "base64"
@@ -68,7 +68,7 @@ module Omnibus
68
68
  #
69
69
  def resource_params
70
70
  params = {
71
- use_accelerate_endpoint: s3_configuration[:use_accelerate_endpoint],
71
+ use_accelerate_endpoint: s3_configuration[:use_accelerate_endpoint],
72
72
  force_path_style: s3_configuration[:force_path_style],
73
73
  }
74
74
 
@@ -93,6 +93,9 @@ module Omnibus
93
93
  Aws::SharedCredentials.new(profile_name: s3_configuration[:profile])
94
94
  elsif s3_configuration[:access_key_id] && s3_configuration[:secret_access_key]
95
95
  Aws::Credentials.new(s3_configuration[:access_key_id], s3_configuration[:secret_access_key])
96
+ else
97
+ # No credentials specified, only public data will be retrievable
98
+ Aws::Credentials.new(nil, nil)
96
99
  end
97
100
  end
98
101
 
@@ -126,7 +129,7 @@ module Omnibus
126
129
  # @param [String] content_md5
127
130
  # @param [String] acl
128
131
  #
129
- # @return [true]
132
+ # @return [Aws::S3::Object]
130
133
  #
131
134
  def store_object(key, content, content_md5, acl)
132
135
  bucket.put_object({
@@ -135,7 +138,6 @@ module Omnibus
135
138
  content_md5: to_base64_digest(content_md5),
136
139
  acl: acl,
137
140
  })
138
- true
139
141
  end
140
142
 
141
143
  #
@@ -294,7 +294,7 @@ module Omnibus
294
294
  extra_keys = val.keys - [
295
295
  :git, :file, :path, :url, # fetcher types
296
296
  :md5, :sha1, :sha256, :sha512, # hash type - common to all fetchers
297
- :cookie, :warning, :unsafe, :extract, # used by net_fetcher
297
+ :cookie, :warning, :unsafe, :extract, :cached_name, # used by net_fetcher
298
298
  :options, # used by path_fetcher
299
299
  :submodules # used by git_fetcher
300
300
  ]
@@ -665,11 +665,6 @@ module Omnibus
665
665
  "OBJECT_MODE" => "64",
666
666
  "ARFLAGS" => "-X64 cru",
667
667
  }
668
- when "mac_os_x"
669
- {
670
- "LDFLAGS" => "-L#{install_dir}/embedded/lib",
671
- "CFLAGS" => "-I#{install_dir}/embedded/include -O2",
672
- }
673
668
  when "solaris2"
674
669
  if platform_version.satisfies?("<= 5.10")
675
670
  solaris_flags = {
@@ -700,7 +695,7 @@ module Omnibus
700
695
  "CFLAGS" => "-I#{install_dir}/embedded/include -O2",
701
696
  }
702
697
  # Enable gcc version 4.8 if it is available
703
- if which("gcc-4.8")
698
+ if which("gcc-4.8") && platform_version.satisfies?("< 12")
704
699
  suse_flags["CC"] = "gcc-4.8"
705
700
  suse_flags["CXX"] = "g++-4.8"
706
701
  end
@@ -758,16 +753,16 @@ module Omnibus
758
753
  extra_linker_flags["LD_OPTIONS"] = ld_options
759
754
  end
760
755
 
761
- env.merge(compiler_flags).
762
- merge(extra_linker_flags).
756
+ env.merge(compiler_flags)
757
+ .merge(extra_linker_flags).
763
758
  # always want to favor pkg-config from embedded location to not hose
764
759
  # configure scripts which try to be too clever and ignore our explicit
765
760
  # CFLAGS and LDFLAGS in favor of pkg-config info
766
761
  merge({ "PKG_CONFIG_PATH" => "#{install_dir}/embedded/lib/pkgconfig" }).
767
762
  # Set default values for CXXFLAGS and CPPFLAGS.
768
- merge("CXXFLAGS" => compiler_flags["CFLAGS"]).
769
- merge("CPPFLAGS" => compiler_flags["CFLAGS"]).
770
- merge("OMNIBUS_INSTALL_DIR" => install_dir)
763
+ merge("CXXFLAGS" => compiler_flags["CFLAGS"])
764
+ .merge("CPPFLAGS" => compiler_flags["CFLAGS"])
765
+ .merge("OMNIBUS_INSTALL_DIR" => install_dir)
771
766
  end
772
767
  expose :with_standard_compiler_flags
773
768
 
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Omnibus
18
- VERSION = "6.0.1"
18
+ VERSION = "6.0.24".freeze
19
19
  end
@@ -135,6 +135,7 @@ MAC_WHITELIST_LIBS = [
135
135
  /libiconv/,
136
136
  /libstdc\+\+\.6\.dylib/,
137
137
  /libc\+\+\.1\.dylib/,
138
+ /Security/,
138
139
  ].freeze
139
140
 
140
141
  FREEBSD_WHITELIST_LIBS = [
@@ -6,7 +6,7 @@ require "omnibus/version"
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "omnibus"
8
8
  gem.version = Omnibus::VERSION
9
- gem.license = "Apache 2.0"
9
+ gem.license = "Apache-2.0"
10
10
  gem.author = "Chef Software, Inc."
11
11
  gem.email = "releng@chef.io"
12
12
  gem.summary = "Omnibus is a framework for building self-installing, full-stack software builds."
@@ -15,18 +15,18 @@ Gem::Specification.new do |gem|
15
15
 
16
16
  gem.required_ruby_version = ">= 2.4"
17
17
 
18
- gem.files = %w{ LICENSE README.md Rakefile Gemfile } + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,resources,spec}/**/*")
18
+ gem.files = %w{ LICENSE README.md Rakefile Gemfile } + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,resources,spec}/**/{*,.kitchen*}")
19
19
  gem.bindir = "bin"
20
20
  gem.executables = %w{omnibus}
21
21
  gem.test_files = gem.files.grep(/^(test|spec|features)\//)
22
22
  gem.require_paths = ["lib"]
23
23
 
24
- gem.add_dependency "aws-sdk", "~> 2"
24
+ gem.add_dependency "aws-sdk-s3", "~> 1"
25
25
  gem.add_dependency "chef-sugar", ">= 3.3"
26
26
  gem.add_dependency "cleanroom", "~> 1.0"
27
27
  gem.add_dependency "ffi-yajl", "~> 2.2"
28
- gem.add_dependency "mixlib-shellout", "~> 2.0"
29
- gem.add_dependency "ohai", ">= 13", "< 15"
28
+ gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
29
+ gem.add_dependency "ohai", ">= 13", "< 16"
30
30
  gem.add_dependency "ruby-progressbar", "~> 1.7"
31
31
  gem.add_dependency "thor", "~> 0.18"
32
32
  gem.add_dependency "license_scout", "~> 1.0"
@@ -34,10 +34,9 @@ Gem::Specification.new do |gem|
34
34
  gem.add_dependency "mixlib-versioning"
35
35
  gem.add_dependency "pedump"
36
36
 
37
- gem.add_development_dependency "bundler"
38
37
  gem.add_development_dependency "artifactory", "~> 2.0"
39
38
  gem.add_development_dependency "aruba", "~> 0.5"
40
- gem.add_development_dependency "chefstyle", "= 0.6"
39
+ gem.add_development_dependency "chefstyle", "= 0.12"
41
40
  gem.add_development_dependency "fauxhai", ">= 5.2"
42
41
  gem.add_development_dependency "rspec", "~> 3.0"
43
42
  gem.add_development_dependency "rspec-json_expectations"