omnibus 6.1.4 → 7.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/README.md +54 -12
- data/Rakefile +1 -1
- data/bin/omnibus +1 -1
- data/lib/omnibus.rb +2 -2
- data/lib/omnibus/build_version.rb +1 -1
- data/lib/omnibus/build_version_dsl.rb +6 -7
- data/lib/omnibus/builder.rb +10 -9
- data/lib/omnibus/changelog_printer.rb +7 -4
- data/lib/omnibus/cleaner.rb +4 -1
- data/lib/omnibus/cli.rb +2 -2
- data/lib/omnibus/cli/changelog.rb +25 -25
- data/lib/omnibus/compressor.rb +2 -2
- data/lib/omnibus/compressors/base.rb +2 -2
- data/lib/omnibus/compressors/dmg.rb +3 -4
- data/lib/omnibus/compressors/tgz.rb +2 -2
- data/lib/omnibus/config.rb +13 -3
- data/lib/omnibus/core_extensions/open_uri.rb +1 -1
- data/lib/omnibus/digestable.rb +2 -2
- data/lib/omnibus/download_helpers.rb +6 -2
- data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
- data/lib/omnibus/fetchers/net_fetcher.rb +3 -4
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +1 -1
- data/lib/omnibus/generator.rb +2 -2
- data/lib/omnibus/generator_files/README.md.erb +20 -16
- data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
- data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
- data/lib/omnibus/git_cache.rb +2 -2
- data/lib/omnibus/health_check.rb +3 -1
- data/lib/omnibus/licensing.rb +5 -6
- data/lib/omnibus/logger.rb +3 -2
- data/lib/omnibus/manifest.rb +2 -2
- data/lib/omnibus/metadata.rb +3 -3
- data/lib/omnibus/ohai.rb +1 -1
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +1 -0
- data/lib/omnibus/packagers/appx.rb +1 -2
- data/lib/omnibus/packagers/base.rb +2 -1
- data/lib/omnibus/packagers/bff.rb +6 -8
- data/lib/omnibus/packagers/deb.rb +7 -10
- data/lib/omnibus/packagers/ips.rb +3 -6
- data/lib/omnibus/packagers/makeself.rb +1 -2
- data/lib/omnibus/packagers/msi.rb +13 -12
- data/lib/omnibus/packagers/pkg.rb +125 -9
- data/lib/omnibus/packagers/rpm.rb +11 -12
- data/lib/omnibus/packagers/solaris.rb +5 -5
- data/lib/omnibus/packagers/windows_base.rb +7 -6
- data/lib/omnibus/project.rb +3 -2
- data/lib/omnibus/publisher.rb +2 -2
- data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
- data/lib/omnibus/publishers/s3_publisher.rb +6 -4
- data/lib/omnibus/s3_cache.rb +4 -2
- data/lib/omnibus/s3_helpers.rb +7 -7
- data/lib/omnibus/software.rb +68 -32
- data/lib/omnibus/templating.rb +2 -2
- data/lib/omnibus/thread_pool.rb +0 -2
- data/lib/omnibus/util.rb +4 -3
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +27 -1
- data/omnibus.gemspec +8 -9
- data/resources/ips/doc-transform.erb +1 -0
- data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
- data/resources/rpm/signing.erb +7 -10
- data/spec/functional/builder_spec.rb +2 -1
- data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
- data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
- data/spec/functional/licensing_spec.rb +5 -5
- data/spec/support/examples.rb +3 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/unit/builder_spec.rb +9 -9
- data/spec/unit/changelogprinter_spec.rb +8 -6
- data/spec/unit/compressor_spec.rb +3 -3
- data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
- data/spec/unit/health_check_spec.rb +2 -6
- data/spec/unit/library_spec.rb +2 -1
- data/spec/unit/manifest_diff_spec.rb +2 -2
- data/spec/unit/manifest_spec.rb +1 -1
- data/spec/unit/metadata_spec.rb +9 -11
- data/spec/unit/omnibus_spec.rb +1 -1
- data/spec/unit/packagers/bff_spec.rb +2 -2
- data/spec/unit/packagers/ips_spec.rb +1 -0
- data/spec/unit/packagers/msi_spec.rb +2 -2
- data/spec/unit/packagers/pkg_spec.rb +354 -0
- data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
- data/spec/unit/packagers/solaris_spec.rb +7 -7
- data/spec/unit/project_spec.rb +2 -2
- data/spec/unit/publisher_spec.rb +1 -2
- data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
- data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
- data/spec/unit/s3_cacher_spec.rb +19 -6
- data/spec/unit/s3_helpers_spec.rb +22 -3
- data/spec/unit/software_spec.rb +72 -42
- data/spec/unit/util_spec.rb +1 -2
- metadata +18 -18
@@ -70,7 +70,7 @@ module Omnibus
|
|
70
70
|
expect(subject).to receive(:shellout!)
|
71
71
|
.with "cd #{project.install_dir} && find . -type l -or -type f | sort >> #{staging_dir}/packlist"
|
72
72
|
subject.write_packlist
|
73
|
-
expect(File.read("#{staging_dir}/packlist")).to match(
|
73
|
+
expect(File.read("#{staging_dir}/packlist")).to match(%r{@pkgdir /opt/project})
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -139,11 +139,11 @@ module Omnibus
|
|
139
139
|
|
140
140
|
it "uses the correct commands" do
|
141
141
|
expect(subject).to receive(:shellout!)
|
142
|
-
.with("cd /opt && find project -print > #{File.join(staging_dir,
|
142
|
+
.with("cd /opt && find project -print > #{File.join(staging_dir, "files")}")
|
143
143
|
expect(subject).to receive(:shellout!)
|
144
|
-
.with("cd /opt && pkgproto < #{File.join(staging_dir,
|
144
|
+
.with("cd /opt && pkgproto < #{File.join(staging_dir, "files.clean")} > #{File.join(staging_dir, "Prototype.files")}")
|
145
145
|
expect(subject).to receive(:shellout!)
|
146
|
-
.with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir,
|
146
|
+
.with("awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{File.join(staging_dir, "Prototype.files")} >> #{File.join(staging_dir, "Prototype")}")
|
147
147
|
subject.write_prototype_file
|
148
148
|
end
|
149
149
|
|
@@ -158,11 +158,11 @@ module Omnibus
|
|
158
158
|
describe "#create_solaris_file" do
|
159
159
|
it "uses the correct commands" do
|
160
160
|
expect(subject).to receive(:shellout!)
|
161
|
-
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir,
|
161
|
+
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
|
162
162
|
expect(subject).to receive(:shellout!)
|
163
163
|
.with("pkgchk -vd #{staging_dir} project")
|
164
164
|
expect(subject).to receive(:shellout!)
|
165
|
-
.with("pkgtrans #{staging_dir} #{File.join(package_dir,
|
165
|
+
.with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
|
166
166
|
|
167
167
|
subject.create_solaris_file
|
168
168
|
end
|
@@ -207,11 +207,11 @@ module Omnibus
|
|
207
207
|
|
208
208
|
it "uses the correct commands" do
|
209
209
|
expect(subject).to receive(:shellout!)
|
210
|
-
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir,
|
210
|
+
.with("pkgmk -o -r /opt -d #{staging_dir} -f #{File.join(staging_dir, "Prototype")}")
|
211
211
|
expect(subject).to receive(:shellout!)
|
212
212
|
.with("pkgchk -vd #{staging_dir} project")
|
213
213
|
expect(subject).to receive(:shellout!)
|
214
|
-
.with("pkgtrans #{staging_dir} #{File.join(package_dir,
|
214
|
+
.with("pkgtrans #{staging_dir} #{File.join(package_dir, "project-1.2.3-1.i386.solaris")} project")
|
215
215
|
|
216
216
|
subject.create_solaris_file
|
217
217
|
end
|
data/spec/unit/project_spec.rb
CHANGED
@@ -202,7 +202,7 @@ module Omnibus
|
|
202
202
|
end
|
203
203
|
|
204
204
|
describe "#build_iteration" do
|
205
|
-
let(:fauxhai_options) {
|
205
|
+
let(:fauxhai_options) { {} }
|
206
206
|
|
207
207
|
before { stub_ohai(fauxhai_options) }
|
208
208
|
|
@@ -340,7 +340,7 @@ module Omnibus
|
|
340
340
|
subject.compress(:tgz)
|
341
341
|
|
342
342
|
expect(Compressor).to receive(:for_current_system)
|
343
|
-
.with(
|
343
|
+
.with(%i{dmg tgz})
|
344
344
|
.and_call_original
|
345
345
|
|
346
346
|
subject.compressor
|
data/spec/unit/publisher_spec.rb
CHANGED
@@ -10,8 +10,7 @@ module Omnibus
|
|
10
10
|
path: "/path/to/files/chef.deb",
|
11
11
|
name: "chef.deb",
|
12
12
|
content: "BINARY",
|
13
|
-
validate!: true
|
14
|
-
)
|
13
|
+
validate!: true)
|
15
14
|
end
|
16
15
|
|
17
16
|
let(:metadata) do
|
@@ -90,8 +89,7 @@ module Omnibus
|
|
90
89
|
license: "Apache-2.0",
|
91
90
|
},
|
92
91
|
},
|
93
|
-
}
|
94
|
-
)
|
92
|
+
})
|
95
93
|
end
|
96
94
|
|
97
95
|
let(:packages) { [package] }
|
@@ -9,8 +9,7 @@ module Omnibus
|
|
9
9
|
path: "/path/to/files/chef.deb",
|
10
10
|
name: "chef.deb",
|
11
11
|
content: "BINARY",
|
12
|
-
validate!: true
|
13
|
-
)
|
12
|
+
validate!: true)
|
14
13
|
end
|
15
14
|
|
16
15
|
let(:metadata) do
|
@@ -24,8 +23,7 @@ module Omnibus
|
|
24
23
|
platform_version: "14.04",
|
25
24
|
arch: "x86_64",
|
26
25
|
sha1: "SHA1",
|
27
|
-
md5: "ABCDEF123456"
|
28
|
-
)
|
26
|
+
md5: "ABCDEF123456")
|
29
27
|
end
|
30
28
|
|
31
29
|
let(:packages) { [package] }
|
data/spec/unit/s3_cacher_spec.rb
CHANGED
@@ -7,9 +7,7 @@ module Omnibus
|
|
7
7
|
name: "ruby",
|
8
8
|
version: "1.9.3",
|
9
9
|
fetcher: double(Fetcher,
|
10
|
-
checksum: "abcd1234"
|
11
|
-
)
|
12
|
-
)
|
10
|
+
checksum: "abcd1234"))
|
13
11
|
end
|
14
12
|
|
15
13
|
let(:python_27) do
|
@@ -17,9 +15,7 @@ module Omnibus
|
|
17
15
|
name: "python",
|
18
16
|
version: "2.7",
|
19
17
|
fetcher: double(Fetcher,
|
20
|
-
checksum: "defg5678"
|
21
|
-
)
|
22
|
-
)
|
18
|
+
checksum: "defg5678"))
|
23
19
|
end
|
24
20
|
|
25
21
|
describe ".list" do
|
@@ -113,10 +109,12 @@ module Omnibus
|
|
113
109
|
let (:s3_access_key) { nil }
|
114
110
|
let (:s3_secret_key) { nil }
|
115
111
|
let (:s3_profile) { nil }
|
112
|
+
let (:s3_iam_role_arn) { nil }
|
116
113
|
|
117
114
|
before do
|
118
115
|
Config.s3_bucket s3_bucket
|
119
116
|
Config.s3_region s3_region
|
117
|
+
Config.s3_iam_role_arn s3_iam_role_arn
|
120
118
|
Config.s3_profile s3_profile
|
121
119
|
Config.s3_access_key s3_access_key
|
122
120
|
Config.s3_secret_key s3_secret_key
|
@@ -152,6 +150,21 @@ module Omnibus
|
|
152
150
|
expect(config[:secret_access_key]).to eq(nil)
|
153
151
|
end
|
154
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
|
155
168
|
end
|
156
169
|
end
|
157
170
|
end
|
@@ -9,12 +9,12 @@ module Omnibus
|
|
9
9
|
describe "#client" do
|
10
10
|
it "raises an error if it is not overridden" do
|
11
11
|
expect { s3_configuration }.to raise_error(RuntimeError,
|
12
|
-
|
12
|
+
"You must override s3_configuration")
|
13
13
|
end
|
14
14
|
|
15
15
|
it "raises an error stating that s3_configuration must be overriden" do
|
16
16
|
expect { client }.to raise_error(RuntimeError,
|
17
|
-
|
17
|
+
"You must override s3_configuration")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
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 "
|
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
|
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 -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"
|
@@ -240,9 +240,9 @@ module Omnibus
|
|
240
240
|
it "sets the defaults" do
|
241
241
|
expect(subject.with_standard_compiler_flags).to eq(
|
242
242
|
"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",
|
243
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
244
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
245
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
246
246
|
"CXX" => "clang++",
|
247
247
|
"LDFLAGS" => "-L/opt/project/embedded/lib",
|
248
248
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
@@ -267,9 +267,9 @@ module Omnibus
|
|
267
267
|
expect(subject.with_standard_compiler_flags).to eq(
|
268
268
|
"CC" => "clang",
|
269
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",
|
270
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
271
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
272
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
273
273
|
"LDFLAGS" => "-L/opt/project/embedded/lib",
|
274
274
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
275
275
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
@@ -286,13 +286,13 @@ module Omnibus
|
|
286
286
|
end
|
287
287
|
it "sets the defaults" do
|
288
288
|
expect(subject.with_standard_compiler_flags).to eq(
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
289
|
+
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
|
290
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
291
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
292
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
293
|
+
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
294
|
+
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
295
|
+
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
296
296
|
)
|
297
297
|
end
|
298
298
|
|
@@ -307,13 +307,13 @@ module Omnibus
|
|
307
307
|
"CC" => "gcc-4.8",
|
308
308
|
"CXX" => "g++-4.8",
|
309
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",
|
310
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
311
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
312
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
313
313
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
314
314
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
315
315
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
316
|
-
|
316
|
+
)
|
317
317
|
end
|
318
318
|
end
|
319
319
|
end
|
@@ -328,9 +328,9 @@ module Omnibus
|
|
328
328
|
it "sets the defaults" do
|
329
329
|
expect(subject.with_standard_compiler_flags).to eq(
|
330
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",
|
331
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
332
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
333
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
|
334
334
|
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
335
335
|
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
|
336
336
|
"OMNIBUS_INSTALL_DIR" => "/opt/project"
|
@@ -547,7 +547,7 @@ module Omnibus
|
|
547
547
|
describe "#whitelist_file" do
|
548
548
|
it "appends to the whitelist_files array" do
|
549
549
|
expect(subject.whitelist_files.size).to eq(0)
|
550
|
-
subject.whitelist_file(/
|
550
|
+
subject.whitelist_file(%r{foo/bar})
|
551
551
|
expect(subject.whitelist_files.size).to eq(1)
|
552
552
|
end
|
553
553
|
|
@@ -558,6 +558,36 @@ module Omnibus
|
|
558
558
|
end
|
559
559
|
end
|
560
560
|
|
561
|
+
describe "#bin_dirs" do
|
562
|
+
it "sets bin_dirs" do
|
563
|
+
subject.bin_dirs ["my_bin_dir"]
|
564
|
+
expect(subject.bin_dirs).to eq(["my_bin_dir"])
|
565
|
+
expect(subject.bin_dirs).to be_kind_of(Array)
|
566
|
+
end
|
567
|
+
|
568
|
+
context "bin_dirs is not set" do
|
569
|
+
it "returns default values" do
|
570
|
+
expect(subject.bin_dirs).to eq(["/opt/project/bin", "/opt/project/embedded/bin"])
|
571
|
+
expect(subject.bin_dirs).to be_kind_of(Array)
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
describe "#lib_dirs" do
|
577
|
+
it "sets lib_dirs" do
|
578
|
+
subject.lib_dirs ["my_lib_dir"]
|
579
|
+
expect(subject.lib_dirs).to eq(["my_lib_dir"])
|
580
|
+
expect(subject.lib_dirs).to be_kind_of(Array)
|
581
|
+
end
|
582
|
+
|
583
|
+
context "lib_dirs is not set" do
|
584
|
+
it "returns default values" do
|
585
|
+
expect(subject.lib_dirs).to eq(["/opt/project/embedded/lib"])
|
586
|
+
expect(subject.lib_dirs).to be_kind_of(Array)
|
587
|
+
end
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
561
591
|
context "testing repo-level version overrides" do
|
562
592
|
context "without overrides" do
|
563
593
|
it "returns the original values" do
|