omnibus 6.1.9 → 8.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -4
  3. data/README.md +54 -13
  4. data/bin/omnibus +1 -1
  5. data/lib/omnibus.rb +2 -2
  6. data/lib/omnibus/build_version.rb +1 -1
  7. data/lib/omnibus/build_version_dsl.rb +5 -7
  8. data/lib/omnibus/builder.rb +4 -4
  9. data/lib/omnibus/cleaner.rb +1 -1
  10. data/lib/omnibus/cli.rb +2 -2
  11. data/lib/omnibus/cli/changelog.rb +1 -1
  12. data/lib/omnibus/compressor.rb +2 -2
  13. data/lib/omnibus/compressors/base.rb +2 -2
  14. data/lib/omnibus/compressors/dmg.rb +5 -2
  15. data/lib/omnibus/compressors/tgz.rb +2 -2
  16. data/lib/omnibus/config.rb +13 -3
  17. data/lib/omnibus/core_extensions/open_uri.rb +1 -1
  18. data/lib/omnibus/digestable.rb +2 -2
  19. data/lib/omnibus/download_helpers.rb +6 -2
  20. data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
  21. data/lib/omnibus/fetchers/net_fetcher.rb +1 -1
  22. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  23. data/lib/omnibus/file_syncer.rb +1 -1
  24. data/lib/omnibus/generator.rb +2 -2
  25. data/lib/omnibus/generator_files/README.md.erb +20 -16
  26. data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
  27. data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
  28. data/lib/omnibus/git_cache.rb +2 -2
  29. data/lib/omnibus/health_check.rb +2 -0
  30. data/lib/omnibus/licensing.rb +3 -3
  31. data/lib/omnibus/logger.rb +1 -1
  32. data/lib/omnibus/manifest.rb +1 -1
  33. data/lib/omnibus/metadata.rb +3 -3
  34. data/lib/omnibus/ohai.rb +1 -1
  35. data/lib/omnibus/package.rb +1 -1
  36. data/lib/omnibus/packager.rb +6 -14
  37. data/lib/omnibus/packagers/base.rb +1 -1
  38. data/lib/omnibus/packagers/msi.rb +1 -1
  39. data/lib/omnibus/packagers/pkg.rb +122 -3
  40. data/lib/omnibus/packagers/solaris.rb +1 -1
  41. data/lib/omnibus/project.rb +2 -2
  42. data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
  43. data/lib/omnibus/publishers/s3_publisher.rb +6 -4
  44. data/lib/omnibus/s3_cache.rb +4 -2
  45. data/lib/omnibus/s3_helpers.rb +7 -7
  46. data/lib/omnibus/software.rb +52 -34
  47. data/lib/omnibus/sugarable.rb +5 -14
  48. data/lib/omnibus/templating.rb +1 -1
  49. data/lib/omnibus/thread_pool.rb +0 -2
  50. data/lib/omnibus/util.rb +1 -1
  51. data/lib/omnibus/version.rb +1 -1
  52. data/lib/omnibus/whitelist.rb +24 -1
  53. data/omnibus.gemspec +7 -8
  54. data/resources/ips/doc-transform.erb +1 -0
  55. data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
  56. data/resources/msi/source.wxs.erb +2 -10
  57. data/resources/rpm/signing.erb +7 -10
  58. data/spec/support/path_helpers.rb +2 -2
  59. data/spec/unit/compressor_spec.rb +1 -1
  60. data/spec/unit/compressors/dmg_spec.rb +5 -2
  61. data/spec/unit/metadata_spec.rb +6 -6
  62. data/spec/unit/packager_spec.rb +6 -13
  63. data/spec/unit/packagers/ips_spec.rb +1 -0
  64. data/spec/unit/packagers/pkg_spec.rb +354 -0
  65. data/spec/unit/packagers/rpm_spec.rb +5 -5
  66. data/spec/unit/project_spec.rb +5 -5
  67. data/spec/unit/s3_cacher_spec.rb +17 -0
  68. data/spec/unit/s3_helpers_spec.rb +20 -1
  69. data/spec/unit/software_spec.rb +58 -119
  70. metadata +22 -22
@@ -35,7 +35,7 @@ module Omnibus
35
35
  create_directory("#{staging_dir}/SOURCES")
36
36
  create_directory("#{staging_dir}/SPECS")
37
37
 
38
- stub_ohai(platform: "redhat", version: "6.9") do |data|
38
+ stub_ohai(platform: "redhat", version: "6") do |data|
39
39
  data["kernel"]["machine"] = architecture
40
40
  end
41
41
  end
@@ -488,7 +488,7 @@ module Omnibus
488
488
 
489
489
  describe "#safe_architecture" do
490
490
  before do
491
- stub_ohai(platform: "redhat", version: "6.9") do |data|
491
+ stub_ohai(platform: "redhat", version: "6") do |data|
492
492
  data["kernel"]["machine"] = "i386"
493
493
  end
494
494
  end
@@ -499,7 +499,7 @@ module Omnibus
499
499
 
500
500
  context "when i686" do
501
501
  before do
502
- stub_ohai(platform: "redhat", version: "6.9") do |data|
502
+ stub_ohai(platform: "redhat", version: "6") do |data|
503
503
  data["kernel"]["machine"] = "i686"
504
504
  end
505
505
  end
@@ -512,9 +512,9 @@ module Omnibus
512
512
  context "on Pidora" do
513
513
  before do
514
514
  # There's no Pidora in Fauxhai :(
515
- stub_ohai(platform: "fedora", version: "27") do |data|
515
+ stub_ohai(platform: "fedora", version: "32") do |data|
516
516
  data["platform"] = "pidora"
517
- data["platform_version"] = "27"
517
+ data["platform_version"] = "32"
518
518
  data["kernel"]["machine"] = "armv6l"
519
519
  end
520
520
  end
@@ -207,28 +207,28 @@ module Omnibus
207
207
  before { stub_ohai(fauxhai_options) }
208
208
 
209
209
  context "when on RHEL" do
210
- let(:fauxhai_options) { { platform: "redhat", version: "6.9" } }
210
+ let(:fauxhai_options) { { platform: "redhat", version: "8" } }
211
211
  it "returns a RHEL iteration" do
212
212
  expect(subject.build_iteration).to eq(1)
213
213
  end
214
214
  end
215
215
 
216
216
  context "when on Debian" do
217
- let(:fauxhai_options) { { platform: "debian", version: "8.11" } }
217
+ let(:fauxhai_options) { { platform: "debian", version: "10" } }
218
218
  it "returns a Debian iteration" do
219
219
  expect(subject.build_iteration).to eq(1)
220
220
  end
221
221
  end
222
222
 
223
223
  context "when on FreeBSD" do
224
- let(:fauxhai_options) { { platform: "freebsd", version: "10.4" } }
224
+ let(:fauxhai_options) { { platform: "freebsd", version: "12" } }
225
225
  it "returns a FreeBSD iteration" do
226
226
  expect(subject.build_iteration).to eq(1)
227
227
  end
228
228
  end
229
229
 
230
230
  context "when on Windows" do
231
- before { stub_ohai(platform: "windows", version: "2008R2") }
231
+ before { stub_ohai(platform: "windows", version: "2019") }
232
232
  before { stub_const("File::ALT_SEPARATOR", '\\') }
233
233
  it "returns a Windows iteration" do
234
234
  expect(subject.build_iteration).to eq(1)
@@ -236,7 +236,7 @@ module Omnibus
236
236
  end
237
237
 
238
238
  context "when on OS X" do
239
- let(:fauxhai_options) { { platform: "mac_os_x", version: "10.13" } }
239
+ let(:fauxhai_options) { { platform: "mac_os_x", version: "10.15" } }
240
240
  it "returns a generic iteration" do
241
241
  expect(subject.build_iteration).to eq(1)
242
242
  end
@@ -109,10 +109,12 @@ module Omnibus
109
109
  let (:s3_access_key) { nil }
110
110
  let (:s3_secret_key) { nil }
111
111
  let (:s3_profile) { nil }
112
+ let (:s3_iam_role_arn) { nil }
112
113
 
113
114
  before do
114
115
  Config.s3_bucket s3_bucket
115
116
  Config.s3_region s3_region
117
+ Config.s3_iam_role_arn s3_iam_role_arn
116
118
  Config.s3_profile s3_profile
117
119
  Config.s3_access_key s3_access_key
118
120
  Config.s3_secret_key s3_secret_key
@@ -148,6 +150,21 @@ module Omnibus
148
150
  expect(config[:secret_access_key]).to eq(nil)
149
151
  end
150
152
  end
153
+
154
+ context "s3_iam_role_arn is configured" do
155
+ let(:s3_iam_role_arn) { "S3_IAM_ROLE_ARN" }
156
+ let(:s3_profile) { "SHAREDPROFILE" }
157
+ let(:s3_access_key) { "ACCESS_KEY_ID" }
158
+ let(:s3_secret_key) { "SECRET_ACCESS_KEY" }
159
+
160
+ it "sets s3_iam_role_arn only" do
161
+ config = S3Cache.send(:s3_configuration)
162
+ expect(config[:iam_role_arn]).to eq(s3_iam_role_arn)
163
+ expect(config[:profile]).to eq(nil)
164
+ expect(config[:access_key_id]).to eq(nil)
165
+ expect(config[:secret_access_key]).to eq(nil)
166
+ end
167
+ end
151
168
  end
152
169
  end
153
170
  end
@@ -40,6 +40,8 @@ module Omnibus
40
40
  let(:instance) { klass.new }
41
41
  let(:key_pair) { { access_key_id: "key_id", secret_access_key: "access_key" } }
42
42
  let(:profile) { "my-profile" }
43
+ let(:iam_role_arn) { "my-iam-role-arn" }
44
+ let(:role_session_name) { "omnibus-assume-role-s3-access" }
43
45
  let(:config) { { bucket_name: "foo", region: "us-east-1" } }
44
46
 
45
47
  it "uses configured key pairs" do
@@ -52,19 +54,36 @@ module Omnibus
52
54
  instance.send(:get_credentials)
53
55
  end
54
56
 
55
- it "preferrs shared credentials profiles over key pairs" do
57
+ it "prefers shared credentials profiles over key pairs" do
56
58
  allow_any_instance_of(klass).to receive(:s3_configuration).and_return(
57
59
  {
58
60
  **config,
59
61
  **key_pair,
62
+ iam_role_arn: nil,
60
63
  profile: profile,
61
64
  }
62
65
  )
63
66
  expect(Aws::Credentials).to_not receive(:new)
67
+ expect(Aws::AssumeRoleCredentials).to_not receive(:new)
64
68
  allow(Aws::SharedCredentials).to receive(:new).with(profile_name: profile)
65
69
  instance.send(:get_credentials)
66
70
  end
67
71
 
72
+ it "prefers AWS IAM role arn over profiles and key pairs" do
73
+ allow_any_instance_of(klass).to receive(:s3_configuration).and_return(
74
+ {
75
+ **config,
76
+ **key_pair,
77
+ profile: profile,
78
+ iam_role_arn: iam_role_arn,
79
+ }
80
+ )
81
+ expect(Aws::Credentials).to_not receive(:new)
82
+ expect(Aws::SharedCredentials).to_not receive(:new)
83
+ allow(Aws::AssumeRoleCredentials).to receive(:new).with(role_arn: iam_role_arn, role_session_name: role_session_name)
84
+ instance.send(:get_credentials)
85
+ end
86
+
68
87
  end
69
88
  end
70
89
  end
@@ -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 -O2",
77
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
78
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
76
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
77
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
78
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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 -O2",
88
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
89
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
87
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
88
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
89
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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 -O2",
99
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
100
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
98
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
99
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
100
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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 -O2",
110
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
111
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
109
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
110
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
111
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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 -O2",
121
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
122
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
120
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
121
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
122
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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 -O2",
133
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
134
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
132
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
133
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
134
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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"
@@ -196,9 +196,9 @@ module Omnibus
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 -O2",
200
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
201
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
199
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
200
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
201
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -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"
@@ -207,12 +207,7 @@ module Omnibus
207
207
  end
208
208
 
209
209
  context "on aix" do
210
- before do
211
- # There's no AIX in Fauxhai :(
212
- stub_ohai(platform: "solaris2", version: "5.11") do |data|
213
- data["platform"] = "aix"
214
- end
215
- end
210
+ before { stub_ohai(platform: "aix") }
216
211
 
217
212
  it "sets the defaults" do
218
213
  expect(subject.with_standard_compiler_flags).to eq(
@@ -232,17 +227,17 @@ module Omnibus
232
227
  end
233
228
  end
234
229
 
235
- context "on freebsd 10" do
230
+ context "on freebsd" do
236
231
  before do
237
- stub_ohai(platform: "freebsd", version: "10.4")
232
+ stub_ohai(platform: "freebsd", version: "12.1")
238
233
  end
239
234
 
240
235
  it "sets the defaults" do
241
236
  expect(subject.with_standard_compiler_flags).to eq(
242
237
  "CC" => "clang",
243
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
244
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
245
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
238
+ "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
239
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
240
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
246
241
  "CXX" => "clang++",
247
242
  "LDFLAGS" => "-L/opt/project/embedded/lib",
248
243
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
@@ -250,95 +245,9 @@ module Omnibus
250
245
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
251
246
  )
252
247
  end
253
-
254
- context "with gcc 4.9 installed" do
255
- before do
256
- allow(subject).to receive(:which).and_return("/usr/local/bin/gcc49")
257
- end
258
- end
259
- end
260
-
261
- context "on freebsd 10" do
262
- before do
263
- stub_ohai(platform: "freebsd", version: "10.4")
264
- end
265
-
266
- it "Clang as the default compiler" do
267
- expect(subject.with_standard_compiler_flags).to eq(
268
- "CC" => "clang",
269
- "CXX" => "clang++",
270
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
271
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
272
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
273
- "LDFLAGS" => "-L/opt/project/embedded/lib",
274
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
275
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
276
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
277
- )
278
- end
279
- end
280
-
281
- context "on sles 11" do
282
- before do
283
- # sles identifies as suse
284
- stub_ohai(platform: "suse", version: "11.4")
285
- allow(subject).to receive(:which).with("gcc-4.8").and_return(false)
286
- end
287
- it "sets the defaults" do
288
- expect(subject.with_standard_compiler_flags).to eq(
289
- "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
290
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
291
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
292
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
293
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
294
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
295
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
296
- )
297
- end
298
-
299
- context "with gcc 4.8 installed" do
300
-
301
- before do
302
- allow(subject).to receive(:which).and_return("/usr/bin/gcc-4.8")
303
- end
304
-
305
- it "sets the compiler args" do
306
- expect(subject.with_standard_compiler_flags).to eq(
307
- "CC" => "gcc-4.8",
308
- "CXX" => "g++-4.8",
309
- "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
310
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
311
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
312
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
313
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
314
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
315
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
316
- )
317
- end
318
- end
319
248
  end
320
249
 
321
- context "on sles 12" do
322
- before do
323
- # sles identifies as suse
324
- stub_ohai(platform: "suse", version: "12.2")
325
- allow(subject).to receive(:which).with("gcc-4.8").and_return(true)
326
- end
327
-
328
- it "sets the defaults" do
329
- expect(subject.with_standard_compiler_flags).to eq(
330
- "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
331
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
332
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
333
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
334
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
335
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
336
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
337
- )
338
- end
339
- end
340
-
341
- context "on Windows" do
250
+ context "on windows" do
342
251
  let(:win_arch_i386) { true }
343
252
 
344
253
  before do
@@ -558,6 +467,36 @@ module Omnibus
558
467
  end
559
468
  end
560
469
 
470
+ describe "#bin_dirs" do
471
+ it "sets bin_dirs" do
472
+ subject.bin_dirs ["my_bin_dir"]
473
+ expect(subject.bin_dirs).to eq(["my_bin_dir"])
474
+ expect(subject.bin_dirs).to be_kind_of(Array)
475
+ end
476
+
477
+ context "bin_dirs is not set" do
478
+ it "returns default values" do
479
+ expect(subject.bin_dirs).to eq(["/opt/project/bin", "/opt/project/embedded/bin"])
480
+ expect(subject.bin_dirs).to be_kind_of(Array)
481
+ end
482
+ end
483
+ end
484
+
485
+ describe "#lib_dirs" do
486
+ it "sets lib_dirs" do
487
+ subject.lib_dirs ["my_lib_dir"]
488
+ expect(subject.lib_dirs).to eq(["my_lib_dir"])
489
+ expect(subject.lib_dirs).to be_kind_of(Array)
490
+ end
491
+
492
+ context "lib_dirs is not set" do
493
+ it "returns default values" do
494
+ expect(subject.lib_dirs).to eq(["/opt/project/embedded/lib"])
495
+ expect(subject.lib_dirs).to be_kind_of(Array)
496
+ end
497
+ end
498
+ end
499
+
561
500
  context "testing repo-level version overrides" do
562
501
  context "without overrides" do
563
502
  it "returns the original values" do
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: 6.1.9
4
+ version: 8.0.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: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: chef-sugar-ng
28
+ name: chef-utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.3'
33
+ version: '15.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.3'
40
+ version: '15.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: chef-cleanroom
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -92,20 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '13'
96
- - - "<"
97
- - !ruby/object:Gem::Version
98
- version: '16'
95
+ version: '15'
99
96
  type: :runtime
100
97
  prerelease: false
101
98
  version_requirements: !ruby/object:Gem::Requirement
102
99
  requirements:
103
100
  - - ">="
104
101
  - !ruby/object:Gem::Version
105
- version: '13'
106
- - - "<"
107
- - !ruby/object:Gem::Version
108
- version: '16'
102
+ version: '15'
109
103
  - !ruby/object:Gem::Dependency
110
104
  name: ruby-progressbar
111
105
  requirement: !ruby/object:Gem::Requirement
@@ -124,16 +118,22 @@ dependencies:
124
118
  name: thor
125
119
  requirement: !ruby/object:Gem::Requirement
126
120
  requirements:
127
- - - "~>"
121
+ - - ">="
128
122
  - !ruby/object:Gem::Version
129
123
  version: '0.18'
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: '2.0'
130
127
  type: :runtime
131
128
  prerelease: false
132
129
  version_requirements: !ruby/object:Gem::Requirement
133
130
  requirements:
134
- - - "~>"
131
+ - - ">="
135
132
  - !ruby/object:Gem::Version
136
133
  version: '0.18'
134
+ - - "<"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.0'
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: license_scout
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -210,28 +210,28 @@ dependencies:
210
210
  requirements:
211
211
  - - '='
212
212
  - !ruby/object:Gem::Version
213
- version: 0.13.3
213
+ version: 1.6.2
214
214
  type: :development
215
215
  prerelease: false
216
216
  version_requirements: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - '='
219
219
  - !ruby/object:Gem::Version
220
- version: 0.13.3
220
+ version: 1.6.2
221
221
  - !ruby/object:Gem::Dependency
222
- name: fauxhai
222
+ name: fauxhai-ng
223
223
  requirement: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - - ">="
226
226
  - !ruby/object:Gem::Version
227
- version: '5.2'
227
+ version: '7.5'
228
228
  type: :development
229
229
  prerelease: false
230
230
  version_requirements: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">="
233
233
  - !ruby/object:Gem::Version
234
- version: '5.2'
234
+ version: '7.5'
235
235
  - !ruby/object:Gem::Dependency
236
236
  name: rspec
237
237
  requirement: !ruby/object:Gem::Requirement
@@ -546,14 +546,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
546
546
  requirements:
547
547
  - - ">="
548
548
  - !ruby/object:Gem::Version
549
- version: '2.4'
549
+ version: '2.6'
550
550
  required_rubygems_version: !ruby/object:Gem::Requirement
551
551
  requirements:
552
552
  - - ">="
553
553
  - !ruby/object:Gem::Version
554
554
  version: '0'
555
555
  requirements: []
556
- rubygems_version: 3.0.3
556
+ rubygems_version: 3.1.4
557
557
  signing_key:
558
558
  specification_version: 4
559
559
  summary: Omnibus is a framework for building self-installing, full-stack software