omnibus 8.0.15 → 8.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/omnibus/builder.rb +12 -7
- data/lib/omnibus/manifest_diff.rb +7 -13
- data/lib/omnibus/metadata.rb +6 -2
- data/lib/omnibus/packagers/pkg.rb +11 -1
- data/lib/omnibus/packagers/rpm.rb +23 -9
- data/lib/omnibus/software.rb +2 -2
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +1 -0
- data/omnibus.gemspec +4 -3
- data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
- data/resources/pkg/distribution.xml.erb +1 -1
- data/resources/rpm/spec.erb +2 -2
- data/spec/functional/fetchers/net_fetcher_spec.rb +2 -11
- data/spec/unit/compressor_spec.rb +2 -2
- data/spec/unit/compressors/dmg_spec.rb +7 -7
- data/spec/unit/compressors/tgz_spec.rb +4 -4
- data/spec/unit/fetchers/net_fetcher_spec.rb +5 -1
- data/spec/unit/metadata_spec.rb +2 -0
- data/spec/unit/packager_spec.rb +2 -2
- data/spec/unit/packagers/pkg_spec.rb +20 -4
- data/spec/unit/packagers/rpm_spec.rb +10 -0
- data/spec/unit/project_spec.rb +2 -2
- data/spec/unit/software_spec.rb +25 -25
- metadata +32 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af309d0053f4ea4f740cbf3268c4e4d0087e014ab9abfaca3899c279b41a7a88
|
4
|
+
data.tar.gz: f7c125f7f25811d2b74a7aa03b7065594e4b887f520ff7432e7409b7855ab898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1227ee4ad5223279042ed600811c2348f10d78abe08859b27a4552a4dd81bdd554842b007ed43ee7aa79403cc9512117733a5db50b9f16dd104d0033a63ef45b
|
7
|
+
data.tar.gz: 8683b174eeb40459b16bf337c7d1e0421b9642172e34e4a61d93348296d45b0fcf9d1272971ac43cdfeee4eb899659c8856ffc2fc0cbc84138b57f481e231107
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](http://img.shields.io/gem/v/omnibus.svg)][gem]
|
4
4
|
[![Build Status](https://badge.buildkite.com/446fd6049a9a5eeab50112aba117d3b7670ec085acb91f78dd.svg?branch=master)](https://buildkite.com/chef-oss/chef-omnibus-master-verify)
|
5
|
-
[![AppVeyor Build Status](http://img.shields.io/appveyor/ci/chef/omnibus.svg?label=AppVeyor)][appveyor]
|
6
5
|
|
7
6
|
**Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md)
|
8
7
|
|
data/lib/omnibus/builder.rb
CHANGED
@@ -373,11 +373,16 @@ module Omnibus
|
|
373
373
|
# @param (see #command)
|
374
374
|
# @return (see #command)
|
375
375
|
#
|
376
|
-
def appbundle(software_name,
|
376
|
+
def appbundle(software_name, options = {})
|
377
377
|
build_commands << BuildCommand.new("appbundle `#{software_name}'") do
|
378
378
|
bin_dir = "#{install_dir}/bin"
|
379
379
|
appbundler_bin = embedded_bin("appbundler")
|
380
380
|
|
381
|
+
lockdir = options.delete(:lockdir)
|
382
|
+
gem = options.delete(:gem)
|
383
|
+
without = options.delete(:without)
|
384
|
+
extra_bin_files = options.delete(:extra_bin_files)
|
385
|
+
|
381
386
|
lockdir ||=
|
382
387
|
begin
|
383
388
|
app_software = project.softwares.find do |p|
|
@@ -535,7 +540,7 @@ module Omnibus
|
|
535
540
|
def mkdir(directory, options = {})
|
536
541
|
build_commands << BuildCommand.new("mkdir `#{directory}'") do
|
537
542
|
Dir.chdir(software.project_dir) do
|
538
|
-
FileUtils.mkdir_p(directory, options)
|
543
|
+
FileUtils.mkdir_p(directory, **options)
|
539
544
|
end
|
540
545
|
end
|
541
546
|
end
|
@@ -557,7 +562,7 @@ module Omnibus
|
|
557
562
|
parent = File.dirname(file)
|
558
563
|
FileUtils.mkdir_p(parent) unless File.directory?(parent)
|
559
564
|
|
560
|
-
FileUtils.touch(file, options)
|
565
|
+
FileUtils.touch(file, **options)
|
561
566
|
end
|
562
567
|
end
|
563
568
|
end
|
@@ -578,7 +583,7 @@ module Omnibus
|
|
578
583
|
build_commands << BuildCommand.new("delete `#{path}'") do
|
579
584
|
Dir.chdir(software.project_dir) do
|
580
585
|
FileSyncer.glob(path).each do |file|
|
581
|
-
FileUtils.rm_rf(file, options)
|
586
|
+
FileUtils.rm_rf(file, **options)
|
582
587
|
end
|
583
588
|
end
|
584
589
|
end
|
@@ -629,7 +634,7 @@ module Omnibus
|
|
629
634
|
log.warn(log_key) { "no matched files for glob #{command}" }
|
630
635
|
else
|
631
636
|
files.each do |file|
|
632
|
-
FileUtils.cp_r(file, destination, options)
|
637
|
+
FileUtils.cp_r(file, destination, **options)
|
633
638
|
end
|
634
639
|
end
|
635
640
|
end
|
@@ -658,7 +663,7 @@ module Omnibus
|
|
658
663
|
log.warn(log_key) { "no matched files for glob #{command}" }
|
659
664
|
else
|
660
665
|
files.each do |file|
|
661
|
-
FileUtils.mv(file, destination, options)
|
666
|
+
FileUtils.mv(file, destination, **options)
|
662
667
|
end
|
663
668
|
end
|
664
669
|
end
|
@@ -690,7 +695,7 @@ module Omnibus
|
|
690
695
|
log.warn(log_key) { "no matched files for glob #{command}" }
|
691
696
|
else
|
692
697
|
files.each do |file|
|
693
|
-
FileUtils.ln_s(file, destination, options)
|
698
|
+
FileUtils.ln_s(file, destination, **options)
|
694
699
|
end
|
695
700
|
end
|
696
701
|
end
|
@@ -25,28 +25,22 @@ module Omnibus
|
|
25
25
|
|
26
26
|
def updated
|
27
27
|
@updated ||=
|
28
|
-
|
29
|
-
(first.
|
30
|
-
|
31
|
-
end.compact
|
32
|
-
end
|
28
|
+
(first.entry_names & second.entry_names).collect do |name|
|
29
|
+
diff(first.entry_for(name), second.entry_for(name))
|
30
|
+
end.compact
|
33
31
|
end
|
34
32
|
|
35
33
|
def removed
|
36
34
|
@removed ||=
|
37
|
-
|
38
|
-
(first.
|
39
|
-
removed_entry(first.entry_for(name))
|
40
|
-
end
|
35
|
+
(first.entry_names - second.entry_names).collect do |name|
|
36
|
+
removed_entry(first.entry_for(name))
|
41
37
|
end
|
42
38
|
end
|
43
39
|
|
44
40
|
def added
|
45
41
|
@added ||=
|
46
|
-
|
47
|
-
(second.
|
48
|
-
new_entry(second.entry_for(name))
|
49
|
-
end
|
42
|
+
(second.entry_names - first.entry_names).collect do |name|
|
43
|
+
new_entry(second.entry_for(name))
|
50
44
|
end
|
51
45
|
end
|
52
46
|
|
data/lib/omnibus/metadata.rb
CHANGED
@@ -173,9 +173,13 @@ module Omnibus
|
|
173
173
|
when "centos", "cumulus", "debian", "el", "fedora", "freebsd", "omnios", "pidora", "raspbian", "rhel", "sles", "suse", "smartos"
|
174
174
|
# Only want MAJOR (e.g. Debian 7, OmniOS r151006, SmartOS 20120809T221258Z)
|
175
175
|
platform_version.split(".").first
|
176
|
-
when "aix", "alpine", "
|
177
|
-
# Only want MAJOR.MINOR (e.g.
|
176
|
+
when "aix", "alpine", "openbsd", "slackware", "solaris2", "opensuse", "opensuseleap", "ubuntu", "amazon"
|
177
|
+
# Only want MAJOR.MINOR (e.g. Ubuntu 12.04)
|
178
178
|
platform_version.split(".")[0..1].join(".")
|
179
|
+
when "mac_os_x", "darwin", "macos"
|
180
|
+
# If running macOS >= 11, use only MAJOR version. Otherwise, use MAJOR.MINOR
|
181
|
+
pv_bits = platform_version.split(".")
|
182
|
+
pv_bits[0].to_i >= 11 ? pv_bits[0] : pv_bits[0..1].join(".")
|
179
183
|
when "arch", "gentoo", "kali"
|
180
184
|
# Arch Linux / Gentoo do not have a platform_version ohai attribute, they are rolling release (lsb_release -r)
|
181
185
|
"rolling"
|
@@ -125,7 +125,7 @@ module Omnibus
|
|
125
125
|
|
126
126
|
# @see Base#package_name
|
127
127
|
def package_name
|
128
|
-
"#{safe_base_package_name}-#{safe_version}-#{safe_build_iteration}.pkg"
|
128
|
+
"#{safe_base_package_name}-#{safe_version}-#{safe_build_iteration}.#{safe_architecture}.pkg"
|
129
129
|
end
|
130
130
|
|
131
131
|
#
|
@@ -286,6 +286,7 @@ module Omnibus
|
|
286
286
|
identifier: safe_identifier,
|
287
287
|
version: safe_version,
|
288
288
|
component_pkg: component_pkg,
|
289
|
+
host_architecture: safe_architecture,
|
289
290
|
})
|
290
291
|
end
|
291
292
|
|
@@ -320,6 +321,15 @@ module Omnibus
|
|
320
321
|
"#{safe_base_package_name}-core.pkg"
|
321
322
|
end
|
322
323
|
|
324
|
+
#
|
325
|
+
# Return the architecture
|
326
|
+
#
|
327
|
+
# @return [String]
|
328
|
+
#
|
329
|
+
def safe_architecture
|
330
|
+
@safe_architecture ||= Ohai["kernel"]["machine"]
|
331
|
+
end
|
332
|
+
|
323
333
|
#
|
324
334
|
# Return the PKG-ready base package name, removing any invalid characters.
|
325
335
|
#
|
@@ -417,6 +417,10 @@ module Omnibus
|
|
417
417
|
command << %{ -bb}
|
418
418
|
command << %{ --buildroot #{staging_dir}/BUILD}
|
419
419
|
command << %{ --define '_topdir #{staging_dir}'}
|
420
|
+
command << " #{spec_file}"
|
421
|
+
|
422
|
+
log.info(log_key) { "Creating .rpm file" }
|
423
|
+
shellout!("#{command}")
|
420
424
|
|
421
425
|
if signing_passphrase
|
422
426
|
log.info(log_key) { "Signing enabled for .rpm file" }
|
@@ -438,17 +442,18 @@ module Omnibus
|
|
438
442
|
})
|
439
443
|
end
|
440
444
|
|
441
|
-
|
442
|
-
command << " #{spec_file}"
|
443
|
-
|
445
|
+
sign_cmd = "rpmsign --addsign #{rpm_file}"
|
444
446
|
with_rpm_signing do |signing_script|
|
445
|
-
log.info(log_key) { "
|
446
|
-
|
447
|
+
log.info(log_key) { "Signing the built rpm file" }
|
448
|
+
|
449
|
+
# RHEL 8 has gpg-agent running so we can skip the expect script since the agent
|
450
|
+
# takes care of the passphrase entering on the signing
|
451
|
+
if dist_tag != ".el8"
|
452
|
+
sign_cmd.prepend("#{signing_script} \"").concat("\"")
|
453
|
+
end
|
454
|
+
|
455
|
+
shellout!("#{sign_cmd}", environment: { "HOME" => home })
|
447
456
|
end
|
448
|
-
else
|
449
|
-
log.info(log_key) { "Creating .rpm file" }
|
450
|
-
command << " #{spec_file}"
|
451
|
-
shellout!("#{command}")
|
452
457
|
end
|
453
458
|
|
454
459
|
FileSyncer.glob("#{staging_dir}/RPMS/**/*.rpm").each do |rpm|
|
@@ -483,6 +488,15 @@ module Omnibus
|
|
483
488
|
"#{staging_dir}/SPECS/#{package_name}.spec"
|
484
489
|
end
|
485
490
|
|
491
|
+
#
|
492
|
+
# The full path to the rpm file.
|
493
|
+
#
|
494
|
+
# @return [String]
|
495
|
+
#
|
496
|
+
def rpm_file
|
497
|
+
"#{staging_dir}/RPMS/#{safe_architecture}/#{package_name}"
|
498
|
+
end
|
499
|
+
|
486
500
|
#
|
487
501
|
# Render the rpm signing script with secure permissions, call the given
|
488
502
|
# block with the path to the script, and ensure deletion of the script from
|
data/lib/omnibus/software.rb
CHANGED
@@ -718,7 +718,7 @@ module Omnibus
|
|
718
718
|
"CC" => "clang",
|
719
719
|
"CXX" => "clang++",
|
720
720
|
"LDFLAGS" => "-L#{install_dir}/embedded/lib",
|
721
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -
|
721
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
722
722
|
}
|
723
723
|
when "windows"
|
724
724
|
arch_flag = windows_arch_i386? ? "-m32" : "-m64"
|
@@ -739,7 +739,7 @@ module Omnibus
|
|
739
739
|
else
|
740
740
|
{
|
741
741
|
"LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib",
|
742
|
-
"CFLAGS" => "-I#{install_dir}/embedded/include -
|
742
|
+
"CFLAGS" => "-I#{install_dir}/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
743
743
|
}
|
744
744
|
end
|
745
745
|
|
data/lib/omnibus/version.rb
CHANGED
data/lib/omnibus/whitelist.rb
CHANGED
data/omnibus.gemspec
CHANGED
@@ -25,17 +25,18 @@ Gem::Specification.new do |gem|
|
|
25
25
|
gem.add_dependency "chef-cleanroom", "~> 1.0"
|
26
26
|
gem.add_dependency "ffi-yajl", "~> 2.2"
|
27
27
|
gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
|
28
|
-
gem.add_dependency "ohai", ">= 15"
|
28
|
+
gem.add_dependency "ohai", ">= 15", "< 17"
|
29
29
|
gem.add_dependency "ruby-progressbar", "~> 1.7"
|
30
30
|
gem.add_dependency "thor", ">= 0.18", "< 2.0"
|
31
31
|
gem.add_dependency "license_scout", "~> 1.0"
|
32
|
+
gem.add_dependency "contracts", ">= 0.16.0", "< 0.17.0"
|
32
33
|
|
33
34
|
gem.add_dependency "mixlib-versioning"
|
34
35
|
gem.add_dependency "pedump"
|
35
36
|
|
36
37
|
gem.add_development_dependency "artifactory", "~> 3.0"
|
37
|
-
gem.add_development_dependency "aruba", "~>
|
38
|
-
gem.add_development_dependency "chefstyle", "= 1.
|
38
|
+
gem.add_development_dependency "aruba", "~> 1.1"
|
39
|
+
gem.add_development_dependency "chefstyle", "= 1.7.5"
|
39
40
|
gem.add_development_dependency "fauxhai-ng", ">= 7.5"
|
40
41
|
gem.add_development_dependency "rspec", "~> 3.0"
|
41
42
|
gem.add_development_dependency "rspec-json_expectations"
|
Binary file
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
<!-- Generated by productbuild - - synthesize -->
|
9
9
|
<pkg-ref id="<%= identifier %>"/>
|
10
|
-
<options customize="never" require-scripts="false"/>
|
10
|
+
<options customize="never" require-scripts="false" hostArchitectures="<%= host_architecture %>" />
|
11
11
|
<choices-outline>
|
12
12
|
<line choice="default">
|
13
13
|
<line choice="<%= identifier %>"/>
|
data/resources/rpm/spec.erb
CHANGED
@@ -127,17 +127,8 @@ module Omnibus
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
|
131
|
-
|
132
|
-
let(:source_md5) { "577dbe528415c6f178a9431fd0554df4" }
|
133
|
-
|
134
|
-
it "extracts the asset without crashing" do
|
135
|
-
subject.clean
|
136
|
-
expect(extracted).to_not be_a_file
|
137
|
-
subject.clean
|
138
|
-
expect(extracted).to_not be_a_file
|
139
|
-
end
|
140
|
-
end
|
130
|
+
# we need to find a new test fixture because this one no longer exists
|
131
|
+
# context "when the source has read-only files"
|
141
132
|
|
142
133
|
context "when the source has broken symlinks" do
|
143
134
|
let(:source_url) { "http://www.openssl.org/source/openssl-1.0.1q.tar.gz" }
|
@@ -3,8 +3,8 @@ require "spec_helper"
|
|
3
3
|
module Omnibus
|
4
4
|
describe Compressor do
|
5
5
|
describe ".for_current_system" do
|
6
|
-
context "on
|
7
|
-
before { stub_ohai(platform: "mac_os_x"
|
6
|
+
context "on macOS" do
|
7
|
+
before { stub_ohai(platform: "mac_os_x") }
|
8
8
|
|
9
9
|
context "when :dmg is activated" do
|
10
10
|
it "prefers dmg" do
|
@@ -190,7 +190,7 @@ module Omnibus
|
|
190
190
|
|
191
191
|
expect(contents).to include('set found_disk to do shell script "ls /Volumes/ | grep \'Project One*\'"')
|
192
192
|
expect(contents).to include(" set the bounds of Finder window 1 to {100, 100, 750, 600}")
|
193
|
-
expect(contents).to include(' set position of item "project-1.2.3-2.pkg" of container window to {535, 50}')
|
193
|
+
expect(contents).to include(' set position of item "project-1.2.3-2.x86_64.pkg" of container window to {535, 50}')
|
194
194
|
end
|
195
195
|
|
196
196
|
it "runs the apple script" do
|
@@ -229,7 +229,7 @@ module Omnibus
|
|
229
229
|
-format UDZO \\
|
230
230
|
-imagekey \\
|
231
231
|
zlib-level=9 \\
|
232
|
-
-o "#{package_dir}/project-1.2.3-2.dmg" \\
|
232
|
+
-o "#{package_dir}/project-1.2.3-2.x86_64.dmg" \\
|
233
233
|
-puppetstrings
|
234
234
|
EOH
|
235
235
|
|
@@ -247,7 +247,7 @@ module Omnibus
|
|
247
247
|
expect(subject).to receive(:shellout!)
|
248
248
|
.with <<-EOH.gsub(/^ {12}/, "")
|
249
249
|
hdiutil verify \\
|
250
|
-
"#{package_dir}/project-1.2.3-2.dmg" \\
|
250
|
+
"#{package_dir}/project-1.2.3-2.x86_64.dmg" \\
|
251
251
|
-puppetstrings
|
252
252
|
EOH
|
253
253
|
|
@@ -289,10 +289,10 @@ module Omnibus
|
|
289
289
|
DeRez -only icns "#{icon}" > tmp.rsrc
|
290
290
|
|
291
291
|
# Append the icon reosurce to the DMG
|
292
|
-
Rez -append tmp.rsrc -o "#{package_dir}/project-1.2.3-2.dmg"
|
292
|
+
Rez -append tmp.rsrc -o "#{package_dir}/project-1.2.3-2.x86_64.dmg"
|
293
293
|
|
294
294
|
# Source the icon
|
295
|
-
SetFile -a C "#{package_dir}/project-1.2.3-2.dmg"
|
295
|
+
SetFile -a C "#{package_dir}/project-1.2.3-2.x86_64.dmg"
|
296
296
|
EOH
|
297
297
|
|
298
298
|
subject.set_dmg_icon
|
@@ -301,11 +301,11 @@ module Omnibus
|
|
301
301
|
|
302
302
|
describe "#package_name" do
|
303
303
|
it "reflects the packager's unmodified package_name" do
|
304
|
-
expect(subject.package_name).to eq("project-1.2.3-2.dmg")
|
304
|
+
expect(subject.package_name).to eq("project-1.2.3-2.x86_64.dmg")
|
305
305
|
end
|
306
306
|
|
307
307
|
it "reflects the packager's modified package_name" do
|
308
|
-
package_basename = "projectsub-1.2.3-3"
|
308
|
+
package_basename = "projectsub-1.2.3-3.x86_64"
|
309
309
|
allow(project.packagers_for_system[0]).to receive(:package_name)
|
310
310
|
.and_return("#{package_basename}.pkg")
|
311
311
|
|
@@ -38,25 +38,25 @@ module Omnibus
|
|
38
38
|
|
39
39
|
describe "#package_name" do
|
40
40
|
it "returns the name of the packager" do
|
41
|
-
expect(subject.package_name).to eq("project-1.2.3-2.pkg.tar.gz")
|
41
|
+
expect(subject.package_name).to eq("project-1.2.3-2.x86_64.pkg.tar.gz")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
describe "#write_tgz" do
|
46
46
|
before do
|
47
|
-
File.open("#{staging_dir}/project-1.2.3-2.pkg", "wb") do |f|
|
47
|
+
File.open("#{staging_dir}/project-1.2.3-2.x86_64.pkg", "wb") do |f|
|
48
48
|
f.write " " * 1_000_000
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
it "generates the file" do
|
53
53
|
subject.write_tgz
|
54
|
-
expect("#{staging_dir}/project-1.2.3-2.pkg.tar.gz").to be_a_file
|
54
|
+
expect("#{staging_dir}/project-1.2.3-2.x86_64.pkg.tar.gz").to be_a_file
|
55
55
|
end
|
56
56
|
|
57
57
|
it "has the correct content" do
|
58
58
|
subject.write_tgz
|
59
|
-
file = File.open("#{staging_dir}/project-1.2.3-2.pkg.tar.gz", "rb")
|
59
|
+
file = File.open("#{staging_dir}/project-1.2.3-2.x86_64.pkg.tar.gz", "rb")
|
60
60
|
contents = file.read
|
61
61
|
file.close
|
62
62
|
|
@@ -278,6 +278,10 @@ module Omnibus
|
|
278
278
|
|
279
279
|
let(:cumulative_downloaded_length) { 100 }
|
280
280
|
|
281
|
+
let(:uri_open_target) do
|
282
|
+
RUBY_VERSION.to_f < 2.7 ? subject : URI
|
283
|
+
end
|
284
|
+
|
281
285
|
def capturing_stdout
|
282
286
|
old_stdout, $stdout = $stdout, progress_bar_output
|
283
287
|
yield
|
@@ -286,7 +290,7 @@ module Omnibus
|
|
286
290
|
end
|
287
291
|
|
288
292
|
before do
|
289
|
-
expect(
|
293
|
+
expect(uri_open_target).to receive(:open).with(source[:url], expected_open_opts) do |_url, open_uri_opts|
|
290
294
|
open_uri_opts[:content_length_proc].call(reported_content_length)
|
291
295
|
open_uri_opts[:progress_proc].call(cumulative_downloaded_length)
|
292
296
|
|
data/spec/unit/metadata_spec.rb
CHANGED
@@ -218,6 +218,8 @@ module Omnibus
|
|
218
218
|
it_behaves_like "a version manipulator", "gentoo", "4.9.95-gentoo", "rolling"
|
219
219
|
it_behaves_like "a version manipulator", "kali", "rolling", "rolling"
|
220
220
|
it_behaves_like "a version manipulator", "mac_os_x", "10.9.1", "10.9"
|
221
|
+
it_behaves_like "a version manipulator", "mac_os_x", "10.15.7", "10.15"
|
222
|
+
it_behaves_like "a version manipulator", "mac_os_x", "11.2.1", "11"
|
221
223
|
it_behaves_like "a version manipulator", "omnios", "r151010", "r151010"
|
222
224
|
it_behaves_like "a version manipulator", "openbsd", "5.4.4", "5.4"
|
223
225
|
it_behaves_like "a version manipulator", "opensuseleap", "42.3", "42.3"
|
data/spec/unit/packager_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require "spec_helper"
|
|
3
3
|
module Omnibus
|
4
4
|
describe Packager do
|
5
5
|
describe ".for_current_system" do
|
6
|
-
context "on
|
7
|
-
before { stub_ohai(platform: "mac_os_x"
|
6
|
+
context "on macOS" do
|
7
|
+
before { stub_ohai(platform: "mac_os_x") }
|
8
8
|
it "prefers PKG" do
|
9
9
|
expect(described_class.for_current_system).to eq([Packager::PKG])
|
10
10
|
end
|
@@ -47,8 +47,8 @@ module Omnibus
|
|
47
47
|
end
|
48
48
|
|
49
49
|
describe "#package_name" do
|
50
|
-
it "includes the name, version,
|
51
|
-
expect(subject.package_name).to eq("project-full-name-1.2.3-2.pkg")
|
50
|
+
it "includes the name, version, build iteration, and architecture" do
|
51
|
+
expect(subject.package_name).to eq("project-full-name-1.2.3-2.x86_64.pkg")
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -290,8 +290,24 @@ module Omnibus
|
|
290
290
|
|
291
291
|
expect(contents).to include('<pkg-ref id="com.getchef.project-full-name"/>')
|
292
292
|
expect(contents).to include('<line choice="com.getchef.project-full-name"/>')
|
293
|
+
expect(contents).to include('hostArchitectures="x86_64"')
|
293
294
|
expect(contents).to include("project-full-name-core.pkg")
|
294
295
|
end
|
296
|
+
|
297
|
+
context "for arm64 builds" do
|
298
|
+
before do
|
299
|
+
stub_ohai(platform: "mac_os_x", version: "11.0") do |data|
|
300
|
+
data["kernel"]["machine"] = "arm64"
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
it "sets the hostArchitectures to include arm64" do
|
305
|
+
subject.write_distribution_file
|
306
|
+
contents = File.read("#{staging_dir}/Distribution")
|
307
|
+
|
308
|
+
expect(contents).to include('hostArchitectures="arm64"')
|
309
|
+
end
|
310
|
+
end
|
295
311
|
end
|
296
312
|
|
297
313
|
describe "#build_product_pkg" do
|
@@ -301,7 +317,7 @@ module Omnibus
|
|
301
317
|
productbuild \\
|
302
318
|
--distribution "#{staging_dir}/Distribution" \\
|
303
319
|
--resources "#{staging_dir}/Resources" \\
|
304
|
-
"#{package_dir}/project-full-name-1.2.3-2.pkg"
|
320
|
+
"#{package_dir}/project-full-name-1.2.3-2.x86_64.pkg"
|
305
321
|
EOH
|
306
322
|
|
307
323
|
subject.build_product_pkg
|
@@ -319,7 +335,7 @@ module Omnibus
|
|
319
335
|
--distribution "#{staging_dir}/Distribution" \\
|
320
336
|
--resources "#{staging_dir}/Resources" \\
|
321
337
|
--sign "My Special Identity" \\
|
322
|
-
"#{package_dir}/project-full-name-1.2.3-2.pkg"
|
338
|
+
"#{package_dir}/project-full-name-1.2.3-2.x86_64.pkg"
|
323
339
|
EOH
|
324
340
|
subject.build_product_pkg
|
325
341
|
end
|
@@ -404,6 +404,16 @@ module Omnibus
|
|
404
404
|
end
|
405
405
|
end
|
406
406
|
|
407
|
+
describe "#rpm_file" do
|
408
|
+
before do
|
409
|
+
allow(subject).to receive(:package_name).and_return("package_name.rpm")
|
410
|
+
end
|
411
|
+
|
412
|
+
it "includes the package_name rpm" do
|
413
|
+
expect(subject.rpm_file).to eq("#{staging_dir}/RPMS/#{architecture}/package_name.rpm")
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
407
417
|
describe "#rpm_safe" do
|
408
418
|
it "adds quotes when required" do
|
409
419
|
expect(subject.rpm_safe("file path")).to eq('"file path"')
|
data/spec/unit/project_spec.rb
CHANGED
@@ -235,8 +235,8 @@ module Omnibus
|
|
235
235
|
end
|
236
236
|
end
|
237
237
|
|
238
|
-
context "when on
|
239
|
-
let(:fauxhai_options) { { platform: "mac_os_x"
|
238
|
+
context "when on macOS" do
|
239
|
+
let(:fauxhai_options) { { platform: "mac_os_x" } }
|
240
240
|
it "returns a generic iteration" do
|
241
241
|
expect(subject.build_iteration).to eq(1)
|
242
242
|
end
|
data/spec/unit/software_spec.rb
CHANGED
@@ -73,9 +73,9 @@ module Omnibus
|
|
73
73
|
it "sets the defaults" do
|
74
74
|
expect(subject.with_standard_compiler_flags).to eq(
|
75
75
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
76
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
77
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
78
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
76
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
77
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
78
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
79
79
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
80
80
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
81
81
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -84,9 +84,9 @@ module Omnibus
|
|
84
84
|
it "overrides LDFLAGS" do
|
85
85
|
expect(subject.with_standard_compiler_flags("LDFLAGS" => "foo")).to eq(
|
86
86
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
87
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
88
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
89
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
87
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
88
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
89
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
90
90
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
91
91
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
92
92
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -95,9 +95,9 @@ module Omnibus
|
|
95
95
|
it "overrides CFLAGS" do
|
96
96
|
expect(subject.with_standard_compiler_flags("CFLAGS" => "foo")).to eq(
|
97
97
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
98
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
99
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
100
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
98
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
99
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
100
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
101
101
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
102
102
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
103
103
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -106,9 +106,9 @@ module Omnibus
|
|
106
106
|
it "overrides CXXFLAGS" do
|
107
107
|
expect(subject.with_standard_compiler_flags("CXXFLAGS" => "foo")).to eq(
|
108
108
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
109
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
110
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
111
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
109
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
110
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
111
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
112
112
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
113
113
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
114
114
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -117,9 +117,9 @@ module Omnibus
|
|
117
117
|
it "overrides CPPFLAGS" do
|
118
118
|
expect(subject.with_standard_compiler_flags("CPPFLAGS" => "foo")).to eq(
|
119
119
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
120
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
121
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
122
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
120
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
121
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
122
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
123
123
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
124
124
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
125
125
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -129,9 +129,9 @@ module Omnibus
|
|
129
129
|
expect(subject.with_standard_compiler_flags("numberwang" => 4)).to eq(
|
130
130
|
"numberwang" => 4,
|
131
131
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
132
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
133
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
134
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
132
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
133
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
134
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
135
135
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
136
136
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
137
137
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -191,14 +191,14 @@ module Omnibus
|
|
191
191
|
end
|
192
192
|
|
193
193
|
context "on mac_os_x" do
|
194
|
-
before { stub_ohai(platform: "mac_os_x", version: "10.
|
194
|
+
before { stub_ohai(platform: "mac_os_x", version: "10.15") }
|
195
195
|
|
196
196
|
it "sets the defaults" do
|
197
197
|
expect(subject.with_standard_compiler_flags).to eq(
|
198
198
|
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
199
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
200
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
201
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
199
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
200
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
201
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
202
202
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
203
203
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
204
204
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -235,9 +235,9 @@ module Omnibus
|
|
235
235
|
it "sets the defaults" do
|
236
236
|
expect(subject.with_standard_compiler_flags).to eq(
|
237
237
|
"CC" => "clang",
|
238
|
-
"CFLAGS" => "-I/opt/project/embedded/include -
|
239
|
-
"CXXFLAGS" => "-I/opt/project/embedded/include -
|
240
|
-
"CPPFLAGS" => "-I/opt/project/embedded/include -
|
238
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
239
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
240
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
241
241
|
"CXX" => "clang++",
|
242
242
|
"LDFLAGS" => "-L/opt/project/embedded/lib",
|
243
243
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnibus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -93,6 +93,9 @@ dependencies:
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '15'
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '17'
|
96
99
|
type: :runtime
|
97
100
|
prerelease: false
|
98
101
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -100,6 +103,9 @@ dependencies:
|
|
100
103
|
- - ">="
|
101
104
|
- !ruby/object:Gem::Version
|
102
105
|
version: '15'
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '17'
|
103
109
|
- !ruby/object:Gem::Dependency
|
104
110
|
name: ruby-progressbar
|
105
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +154,26 @@ dependencies:
|
|
148
154
|
- - "~>"
|
149
155
|
- !ruby/object:Gem::Version
|
150
156
|
version: '1.0'
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: contracts
|
159
|
+
requirement: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: 0.16.0
|
164
|
+
- - "<"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.17.0
|
167
|
+
type: :runtime
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.16.0
|
174
|
+
- - "<"
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: 0.17.0
|
151
177
|
- !ruby/object:Gem::Dependency
|
152
178
|
name: mixlib-versioning
|
153
179
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,28 +222,28 @@ dependencies:
|
|
196
222
|
requirements:
|
197
223
|
- - "~>"
|
198
224
|
- !ruby/object:Gem::Version
|
199
|
-
version: '
|
225
|
+
version: '1.1'
|
200
226
|
type: :development
|
201
227
|
prerelease: false
|
202
228
|
version_requirements: !ruby/object:Gem::Requirement
|
203
229
|
requirements:
|
204
230
|
- - "~>"
|
205
231
|
- !ruby/object:Gem::Version
|
206
|
-
version: '
|
232
|
+
version: '1.1'
|
207
233
|
- !ruby/object:Gem::Dependency
|
208
234
|
name: chefstyle
|
209
235
|
requirement: !ruby/object:Gem::Requirement
|
210
236
|
requirements:
|
211
237
|
- - '='
|
212
238
|
- !ruby/object:Gem::Version
|
213
|
-
version: 1.
|
239
|
+
version: 1.7.5
|
214
240
|
type: :development
|
215
241
|
prerelease: false
|
216
242
|
version_requirements: !ruby/object:Gem::Requirement
|
217
243
|
requirements:
|
218
244
|
- - '='
|
219
245
|
- !ruby/object:Gem::Version
|
220
|
-
version: 1.
|
246
|
+
version: 1.7.5
|
221
247
|
- !ruby/object:Gem::Dependency
|
222
248
|
name: fauxhai-ng
|
223
249
|
requirement: !ruby/object:Gem::Requirement
|