codestrap 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +2 -2
- data/codestrap.gemspec +11 -2
- data/lib/codestrap.rb +96 -0
- data/lib/codestrap/cli.rb +11 -1
- data/lib/codestrap/config.rb +18 -8
- data/lib/codestrap/version.rb +1 -1
- metadata +47 -222
- data/.gitignore +0 -20
- data/.travis.yml +0 -4
- data/Gemfile +0 -6
- data/LICENSE.txt +0 -13
- data/Rakefile +0 -51
- data/config/projects/codestrap.rb +0 -22
- data/config/software/codestrap.rb +0 -20
- data/config/software/ruby.rb +0 -247
- data/config/software/zlib.rb +0 -86
- data/features/client.feature +0 -99
- data/features/fixtures/client/home/codestrap/bin/.empty +0 -0
- data/features/fixtures/client/home/codestrap/content/bash.erb +0 -3
- data/features/fixtures/client/home/codestrap/content/gem/dir/file +0 -0
- data/features/fixtures/client/home/codestrap/content/gem/dir/template +0 -3
- data/features/fixtures/client/home/codestrap/content/gem/file +0 -1
- data/features/fixtures/client/home/codestrap/content/gem/template +0 -3
- data/features/fixtures/client/home/codestrap/content/local_remote.erb +0 -1
- data/features/fixtures/client/home/codestrap/content/local_remote/dir/file +0 -0
- data/features/fixtures/client/home/codestrap/content/local_remote/dir/template +0 -3
- data/features/fixtures/client/home/codestrap/content/local_remote/file +0 -1
- data/features/fixtures/client/home/codestrap/content/local_remote/template +0 -3
- data/features/fixtures/client/home/codestrap/objects/local.json +0 -3
- data/features/fixtures/client/output/.empty +0 -0
- data/features/fixtures/client/var/lib/codestrap/bin/.empty +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/bashremote.erb +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/file +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/gemremote/file +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/gemremote/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/remote_local.erb +0 -1
- data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/file +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/remote_local/file +0 -1
- data/features/fixtures/client/var/lib/codestrap/content/remote_local/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/remote_remote.erb +0 -1
- data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/file +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/content/remote_remote/file +0 -0
- data/features/fixtures/client/var/lib/codestrap/content/remote_remote/template +0 -3
- data/features/fixtures/client/var/lib/codestrap/objects/remote.json +0 -3
- data/features/fixtures/logging/home/logging/codestrap/bin/stubdirectory/.empty +0 -0
- data/features/fixtures/logging/home/logging/codestrap/bin/stubnotlink +0 -0
- data/features/fixtures/logging/home/logging/codestrap/content/.empty +0 -0
- data/features/fixtures/logging/home/logging/codestrap/objects/.empty +0 -0
- data/features/fixtures/server/mixed/var/lib/stub/content/address.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/cell.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/email.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/mobile.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/name.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/phone.erb +0 -3
- data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/Modulefile +0 -12
- data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/README +0 -17
- data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/manifests/init.pp +0 -42
- data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/spec/spec_helper.rb +0 -18
- data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/tests/init.pp +0 -13
- data/features/fixtures/server/mixed/var/lib/stub/objects/contact.json +0 -8
- data/features/fixtures/server/mixed/var/lib/stub/objects/shadow/contact.json +0 -8
- data/features/fixtures/strap/projects/etc/.empty +0 -0
- data/features/fixtures/strap/projects/home/user/dir/bin/.empty +0 -0
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/Modulefile +0 -12
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/README +0 -17
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/:stub:project.name:/subclass.pp +0 -3
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/init.pp +0 -42
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/spec/spec_helper.rb +0 -18
- data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/tests/init.pp +0 -13
- data/features/fixtures/strap/projects/home/user/dir/objects/contact.json +0 -8
- data/features/fixtures/strap/projects/home/user/dir/objects/shadow/contact.json +0 -8
- data/features/fixtures/strap/projects/output/.empty +0 -0
- data/features/fixtures/stub/contact/etc/.empty +0 -0
- data/features/fixtures/stub/contact/home/user/dir/bin/.empty +0 -0
- data/features/fixtures/stub/contact/home/user/dir/content/address.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/content/cell.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/content/email.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/content/mobile.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/content/name.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/content/phone.erb +0 -3
- data/features/fixtures/stub/contact/home/user/dir/objects/contact.json +0 -8
- data/features/fixtures/stub/contact/home/user/dir/objects/shadow/contact.json +0 -8
- data/features/fixtures/stub/contact/output/.empty +0 -0
- data/features/fixtures/stub/date/etc/.empty +0 -0
- data/features/fixtures/stub/date/home/user/stub/bin/.empty +0 -0
- data/features/fixtures/stub/date/home/user/stub/content/day.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/content/hour.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/content/minute.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/content/month.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/content/second.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/content/year.erb +0 -3
- data/features/fixtures/stub/date/home/user/stub/objects/.empty +0 -0
- data/features/fixtures/stub/date/output/.empty +0 -0
- data/features/fixtures/stub/script/etc/.empty +0 -0
- data/features/fixtures/stub/script/home/user/stub/bin/.empty +0 -0
- data/features/fixtures/stub/script/home/user/stub/content/credentials.erb +0 -6
- data/features/fixtures/stub/script/home/user/stub/objects/credentials.rb +0 -11
- data/features/fixtures/stub/script/output/.empty +0 -0
- data/features/logging.feature +0 -39
- data/features/object_scripts.feature +0 -13
- data/features/server.feature +0 -36
- data/features/step_definitions/client_steps.rb +0 -99
- data/features/step_definitions/logging_steps.rb +0 -65
- data/features/step_definitions/object_scripts_steps.rb +0 -26
- data/features/step_definitions/server_steps.rb +0 -112
- data/features/step_definitions/strap_steps.rb +0 -69
- data/features/step_definitions/stub_option_simple_steps.rb +0 -31
- data/features/step_definitions/stub_steps.rb +0 -94
- data/features/strap.feature +0 -34
- data/features/stub.feature +0 -157
- data/features/stub_option_simple.feature +0 -14
- data/features/stub_packages.feature +0 -15
- data/features/support/env.rb +0 -197
- data/omnibus.rb +0 -53
- data/package-scripts/codestrap/postinst +0 -25
- data/package-scripts/codestrap/postrm +0 -17
- data/package-scripts/codestrap/preinst +0 -7
- data/package-scripts/codestrap/prerm +0 -15
- data/resources/codestrap/pkg/background.png +0 -0
- data/resources/codestrap/pkg/distribution.xml.erb +0 -22
- data/resources/codestrap/pkg/license.html.erb +0 -202
- data/resources/codestrap/pkg/welcome.html.erb +0 -7
data/.gitignore
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.idea/
|
3
|
-
/.yardoc
|
4
|
-
/Gemfile.lock
|
5
|
-
/_yardoc/
|
6
|
-
/coverage/
|
7
|
-
/doc/
|
8
|
-
/pkg/
|
9
|
-
/spec/reports/
|
10
|
-
/tmp/
|
11
|
-
Vagrantfile
|
12
|
-
.ruby-gemset
|
13
|
-
.ruby-version
|
14
|
-
/.vagrant/
|
15
|
-
atlassian-ide-plugin.xml
|
16
|
-
*.bundle
|
17
|
-
*.so
|
18
|
-
*.o
|
19
|
-
*.a
|
20
|
-
mkmf.log
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Dexter Plameras
|
2
|
-
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
you may not use this file except in compliance with the License.
|
5
|
-
You may obtain a copy of the License at
|
6
|
-
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
See the License for the specific language governing permissions and
|
13
|
-
limitations under the License.
|
data/Rakefile
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
ROOT = File.dirname(File.expand_path(__FILE__))
|
2
|
-
FEATURES_PATH = File.join(ROOT, 'features')
|
3
|
-
LIB_PATH = File.join(ROOT, 'lib')
|
4
|
-
TMP_PATH = File.join(ROOT, 'tmp')
|
5
|
-
TMP_FILES = Rake::FileList.new(File.join(ROOT, 'tmp','*'))
|
6
|
-
PACKAGES = Rake::FileList.new(File.join(ROOT, 'pkg', '*'))
|
7
|
-
DOCS = Rake::FileList.new(File.join(ROOT, 'doc', '*'))
|
8
|
-
$LOAD_PATH.unshift(LIB_PATH)
|
9
|
-
require 'codestrap'
|
10
|
-
require 'codestrap/version'
|
11
|
-
require 'bundler/gem_tasks'
|
12
|
-
require 'cucumber'
|
13
|
-
require 'cucumber/rake/task'
|
14
|
-
require 'rake'
|
15
|
-
require 'yard'
|
16
|
-
|
17
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
18
|
-
t.cucumber_opts = "#{FEATURES_PATH} -r #{FEATURES_PATH}/step_definitions -r #{FEATURES_PATH}/support --format pretty"
|
19
|
-
end
|
20
|
-
|
21
|
-
YARD::Rake::YardocTask.new do |t|
|
22
|
-
t.files = %w[ lib/**/*.rb ]
|
23
|
-
end
|
24
|
-
|
25
|
-
desc 'Clean files'
|
26
|
-
task :clean do
|
27
|
-
clean = []
|
28
|
-
clean += TMP_FILES
|
29
|
-
clean += PACKAGES
|
30
|
-
clean += DOCS
|
31
|
-
clean.each do |file|
|
32
|
-
rm_rf file
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
desc 'Uninstall'
|
37
|
-
task :uninstall do
|
38
|
-
sh 'gem uninstall codestrap -x'
|
39
|
-
end
|
40
|
-
|
41
|
-
desc 'Reinstall'
|
42
|
-
task :reinstall do
|
43
|
-
Rake::Task['uninstall'].invoke
|
44
|
-
Rake::Task['install'].invoke
|
45
|
-
end
|
46
|
-
|
47
|
-
desc 'Package using omnibus'
|
48
|
-
task :package do
|
49
|
-
Rake::Task['build'].invoke
|
50
|
-
sh 'omnibus build codestrap'
|
51
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2016 Dexter Plameras
|
3
|
-
#
|
4
|
-
# All Rights Reserved.
|
5
|
-
#
|
6
|
-
require File.absolute_path(File.join(File.dirname(__FILE__),'..','..','lib','codestrap','version'))
|
7
|
-
|
8
|
-
name 'codestrap'
|
9
|
-
maintainer 'Dexter Plameras'
|
10
|
-
homepage 'https://github.com/dexterp/codestrap'
|
11
|
-
|
12
|
-
# Defaults to C:/codestrap on Windows
|
13
|
-
# and /opt/codestrap on all other platforms
|
14
|
-
install_dir "#{default_root}/#{name}"
|
15
|
-
|
16
|
-
build_version Codestrap::VERSION
|
17
|
-
build_iteration 1
|
18
|
-
|
19
|
-
dependency 'codestrap'
|
20
|
-
|
21
|
-
exclude "**/.git"
|
22
|
-
exclude "**/bundler/git"
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require File.absolute_path(File.join(File.dirname(__FILE__),'..','..','lib','codestrap','version'))
|
2
|
-
|
3
|
-
name 'codestrap'
|
4
|
-
default_version Codestrap::VERSION
|
5
|
-
|
6
|
-
dependency 'ruby'
|
7
|
-
dependency 'rubygems'
|
8
|
-
|
9
|
-
build do
|
10
|
-
pkg = File.absolute_path(File.join(File.dirname(__FILE__),'..','..','pkg',"codestrap-#{version}.gem"))
|
11
|
-
gem "install #{pkg} -n #{install_dir}/bin --no-rdoc --no-ri -v #{version}"
|
12
|
-
command "rm -rf /opt/#{name}/embedded/docs"
|
13
|
-
command "rm -rf /opt/#{name}/embedded/share/man"
|
14
|
-
command "rm -rf /opt/#{name}/embedded/share/doc"
|
15
|
-
command "rm -rf /opt/#{name}/embedded/ssl/man"
|
16
|
-
command "rm -rf /opt/#{name}/embedded/info"
|
17
|
-
command "rm -rf /opt/#{name}/bin/upstrap"
|
18
|
-
command "rm -rf /opt/#{name}/bin/rackup"
|
19
|
-
command "rm -rf /opt/#{name}/bin/tilt"
|
20
|
-
end
|
data/config/software/ruby.rb
DELETED
@@ -1,247 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2012-2016 Chef Software, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
#
|
16
|
-
|
17
|
-
name "ruby"
|
18
|
-
|
19
|
-
license "BSD-2-Clause"
|
20
|
-
license_file "BSDL"
|
21
|
-
license_file "COPYING"
|
22
|
-
license_file "LEGAL"
|
23
|
-
|
24
|
-
# - chef-client cannot use 2.2.x yet due to a bug in IRB that affects chef-shell on linux:
|
25
|
-
# https://bugs.ruby-lang.org/issues/11869
|
26
|
-
# - the current status of 2.3.x is that it downloads but fails to compile.
|
27
|
-
# - verify that all ffi libs are available for your version on all platforms.
|
28
|
-
default_version "2.2.5"
|
29
|
-
|
30
|
-
fips_enabled = (project.overrides[:fips] && project.overrides[:fips][:enabled]) || false
|
31
|
-
|
32
|
-
dependency "patch" if solaris_10?
|
33
|
-
dependency "ncurses" unless windows? || version.satisfies?(">= 2.1")
|
34
|
-
dependency "zlib"
|
35
|
-
dependency "openssl"
|
36
|
-
dependency "libffi"
|
37
|
-
dependency "libyaml"
|
38
|
-
# Needed for chef_gem installs of (e.g.) nokogiri on upgrades -
|
39
|
-
# they expect to see our libiconv instead of a system version.
|
40
|
-
# Ignore on windows - TDM GCC comes with libiconv in the runtime
|
41
|
-
# and that's the only one we will ever use.
|
42
|
-
dependency "libiconv"
|
43
|
-
|
44
|
-
version("2.3.0") { source md5: "e81740ac7b14a9f837e9573601db3162" }
|
45
|
-
|
46
|
-
version("2.2.5") { source md5: "bd8e349d4fb2c75d90817649674f94be" }
|
47
|
-
version("2.2.4") { source md5: "9a5e15f9d5255ba37ace18771b0a8dd2" }
|
48
|
-
version("2.2.3") { source md5: "150a5efc5f5d8a8011f30aa2594a7654" }
|
49
|
-
version("2.2.2") { source md5: "326e99ddc75381c7b50c85f7089f3260" }
|
50
|
-
version("2.2.1") { source md5: "b49fc67a834e4f77249eb73eecffb1c9" }
|
51
|
-
version("2.2.0") { source md5: "cd03b28fd0b555970f5c4fd481700852" }
|
52
|
-
|
53
|
-
version("2.1.8") { source md5: "091b62f0a9796a3c55de2a228a0e6ef3" }
|
54
|
-
version("2.1.7") { source md5: "2e143b8e19b056df46479ae4412550c9" }
|
55
|
-
version("2.1.6") { source md5: "6e5564364be085c45576787b48eeb75f" }
|
56
|
-
version("2.1.5") { source md5: "df4c1b23f624a50513c7a78cb51a13dc" }
|
57
|
-
version("2.1.4") { source md5: "89b2f4a197621346f6724a3c35535b19" }
|
58
|
-
version("2.1.3") { source md5: "74a37b9ad90e4ea63c0eed32b9d5b18f" }
|
59
|
-
version("2.1.2") { source md5: "a5b5c83565f8bd954ee522bd287d2ca1" }
|
60
|
-
version("2.1.1") { source md5: "e57fdbb8ed56e70c43f39c79da1654b2" }
|
61
|
-
|
62
|
-
version("2.0.0-p645") { source md5: "49919bba0c855eaf8e247108c7933a62" }
|
63
|
-
version("2.0.0-p594") { source md5: "a9caa406da5d72f190e28344e747ee74" }
|
64
|
-
version("2.0.0-p576") { source md5: "2e1f4355981b754d92f7e2cc456f843d" }
|
65
|
-
|
66
|
-
version("1.9.3-p550") { source md5: "e05135be8f109b2845229c4f47f980fd" }
|
67
|
-
version("1.9.3-p547") { source md5: "7531f9b1b35b16f3eb3d7bea786babfd" }
|
68
|
-
version("1.9.3-p484") { source md5: "8ac0dee72fe12d75c8b2d0ef5d0c2968" }
|
69
|
-
|
70
|
-
source url: "https://cache.ruby-lang.org/pub/ruby/#{version.match(/^(\d+\.\d+)/)[0]}/ruby-#{version}.tar.gz"
|
71
|
-
|
72
|
-
relative_path "ruby-#{version}"
|
73
|
-
|
74
|
-
env = with_standard_compiler_flags(with_embedded_path)
|
75
|
-
|
76
|
-
if mac_os_x?
|
77
|
-
# -Qunused-arguments suppresses "argument unused during compilation"
|
78
|
-
# warnings. These can be produced if you compile a program that doesn't
|
79
|
-
# link to anything in a path given with -Lextra-libs. Normally these
|
80
|
-
# would be harmless, except that autoconf treats any output to stderr as
|
81
|
-
# a failure when it makes a test program to check your CFLAGS (regardless
|
82
|
-
# of the actual exit code from the compiler).
|
83
|
-
env["CFLAGS"] << " -I#{install_dir}/embedded/include/ncurses -arch x86_64 -m64 -O3 -g -pipe -Qunused-arguments"
|
84
|
-
env["LDFLAGS"] << " -arch x86_64"
|
85
|
-
elsif freebsd?
|
86
|
-
# Stops "libtinfo.so.5.9: could not read symbols: Bad value" error when
|
87
|
-
# compiling ext/readline. See the following for more info:
|
88
|
-
#
|
89
|
-
# https://lists.freebsd.org/pipermail/freebsd-current/2013-October/045425.html
|
90
|
-
# http://mailing.freebsd.ports-bugs.narkive.com/kCgK8sNQ/ports-183106-patch-sysutils-libcdio-does-not-build-on-10-0-and-head
|
91
|
-
#
|
92
|
-
env["LDFLAGS"] << " -ltinfow"
|
93
|
-
elsif aix?
|
94
|
-
# this magic per IBM
|
95
|
-
env["LDSHARED"] = "xlc -G"
|
96
|
-
env["CFLAGS"] = "-I#{install_dir}/embedded/include/ncurses -I#{install_dir}/embedded/include"
|
97
|
-
# this magic per IBM
|
98
|
-
env["XCFLAGS"] = "-DRUBY_EXPORT"
|
99
|
-
# need CPPFLAGS set so ruby doesn't try to be too clever
|
100
|
-
env["CPPFLAGS"] = "-I#{install_dir}/embedded/include/ncurses -I#{install_dir}/embedded/include"
|
101
|
-
env["SOLIBS"] = "-lm -lc"
|
102
|
-
# need to use GNU m4, default m4 doesn't work
|
103
|
-
env["M4"] = "/opt/freeware/bin/m4"
|
104
|
-
elsif solaris_10?
|
105
|
-
if sparc?
|
106
|
-
# Known issue with rubby where too much GCC optimization blows up miniruby on sparc
|
107
|
-
env["CFLAGS"] << " -std=c99 -O0 -g -pipe -mcpu=v9"
|
108
|
-
env["LDFLAGS"] << " -mcpu=v9"
|
109
|
-
else
|
110
|
-
env["CFLAGS"] << " -std=c99 -O3 -g -pipe"
|
111
|
-
end
|
112
|
-
elsif windows?
|
113
|
-
env["CPPFLAGS"] << " -DFD_SETSIZE=2048"
|
114
|
-
else # including linux
|
115
|
-
if version.satisfies?(">= 2.3.0") &&
|
116
|
-
rhel? && platform_version.satisfies?("< 6.0")
|
117
|
-
env["CFLAGS"] << " -O2 -g -pipe"
|
118
|
-
else
|
119
|
-
env["CFLAGS"] << " -O3 -g -pipe"
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
build do
|
124
|
-
# AIX needs /opt/freeware/bin only for patch
|
125
|
-
patch_env = env.dup
|
126
|
-
patch_env["PATH"] = "/opt/freeware/bin:#{env['PATH']}" if aix?
|
127
|
-
|
128
|
-
if solaris_10? && version.satisfies?(">= 2.1")
|
129
|
-
patch source: "ruby-no-stack-protector.patch", plevel: 1, env: patch_env
|
130
|
-
elsif solaris_10? && version =~ /^1.9/
|
131
|
-
patch source: "ruby-sparc-1.9.3-c99.patch", plevel: 1, env: patch_env
|
132
|
-
end
|
133
|
-
|
134
|
-
# wrlinux7/ios_xr build boxes from Cisco include libssp and there is no way to
|
135
|
-
# disable ruby from linking against it, but Cisco switches will not have the
|
136
|
-
# library. Disabling it as we do for Solaris.
|
137
|
-
if ios_xr? && version.satisfies?(">= 2.1")
|
138
|
-
patch source: "ruby-no-stack-protector.patch", plevel: 1, env: patch_env
|
139
|
-
end
|
140
|
-
|
141
|
-
# disable libpath in mkmf across all platforms, it trolls omnibus and
|
142
|
-
# breaks the postgresql cookbook. i'm not sure why ruby authors decided
|
143
|
-
# this was a good idea, but it breaks our use case hard. AIX cannot even
|
144
|
-
# compile without removing it, and it breaks some native gem installs on
|
145
|
-
# other platforms. generally you need to have a condition where the
|
146
|
-
# embedded and non-embedded libs get into a fight (libiconv, openssl, etc)
|
147
|
-
# and ruby trying to set LD_LIBRARY_PATH itself gets it wrong.
|
148
|
-
#
|
149
|
-
# Also, fix paths emitted in the makefile on windows on both msys and msys2.
|
150
|
-
if version.satisfies?(">= 2.1")
|
151
|
-
patch source: "ruby-mkmf.patch", plevel: 1, env: patch_env
|
152
|
-
# should intentionally break and fail to apply on 2.2, patch will need to
|
153
|
-
# be fixed.
|
154
|
-
end
|
155
|
-
|
156
|
-
# Fix reserve stack segmentation fault when building on RHEL5 or below
|
157
|
-
# Currently only affects 2.1.7 and 2.2.3. This patch taken from the fix
|
158
|
-
# in Ruby trunk and expected to be included in future point releases.
|
159
|
-
# https://redmine.ruby-lang.org/issues/11602
|
160
|
-
if rhel? &&
|
161
|
-
platform_version.satisfies?("< 6") &&
|
162
|
-
(version == "2.1.7" || version == "2.2.3")
|
163
|
-
|
164
|
-
patch source: "ruby-fix-reserve-stack-segfault.patch", plevel: 1, env: patch_env
|
165
|
-
end
|
166
|
-
|
167
|
-
configure_command = ["--with-out-ext=dbm,readline",
|
168
|
-
"--enable-shared",
|
169
|
-
"--disable-install-doc",
|
170
|
-
"--without-gmp",
|
171
|
-
"--without-gdbm",
|
172
|
-
"--without-tk",
|
173
|
-
"--disable-dtrace"]
|
174
|
-
configure_command << "--with-ext=psych" if version.satisfies?("< 2.3")
|
175
|
-
configure_command << "--with-bundled-md5" if fips_enabled
|
176
|
-
|
177
|
-
if aix?
|
178
|
-
# need to patch ruby's configure file so it knows how to find shared libraries
|
179
|
-
patch source: "ruby-aix-configure.patch", plevel: 1, env: patch_env
|
180
|
-
# have ruby use zlib on AIX correctly
|
181
|
-
patch source: "ruby_aix_openssl.patch", plevel: 1, env: patch_env
|
182
|
-
# AIX has issues with ssl retries, need to patch to have it retry
|
183
|
-
patch source: "ruby_aix_2_1_3_ssl_EAGAIN.patch", plevel: 1, env: patch_env
|
184
|
-
# the next two patches are because xlc doesn't deal with long vs int types well
|
185
|
-
patch source: "ruby-aix-atomic.patch", plevel: 1, env: patch_env
|
186
|
-
patch source: "ruby-aix-vm-core.patch", plevel: 1, env: patch_env
|
187
|
-
|
188
|
-
# per IBM, just help ruby along on what it's running on
|
189
|
-
configure_command << "--host=powerpc-ibm-aix6.1.0.0 --target=powerpc-ibm-aix6.1.0.0 --build=powerpc-ibm-aix6.1.0.0 --enable-pthread"
|
190
|
-
|
191
|
-
elsif freebsd?
|
192
|
-
# Disable optional support C level backtrace support. This requires the
|
193
|
-
# optional devel/libexecinfo port to be installed.
|
194
|
-
configure_command << "ac_cv_header_execinfo_h=no"
|
195
|
-
configure_command << "--with-opt-dir=#{install_dir}/embedded"
|
196
|
-
elsif smartos?
|
197
|
-
# Opscode patch - someara@opscode.com
|
198
|
-
# GCC 4.7.0 chokes on mismatched function types between OpenSSL 1.0.1c and Ruby 1.9.3-p286
|
199
|
-
patch source: "ruby-openssl-1.0.1c.patch", plevel: 1, env: patch_env
|
200
|
-
|
201
|
-
# Patches taken from RVM.
|
202
|
-
# http://bugs.ruby-lang.org/issues/5384
|
203
|
-
# https://www.illumos.org/issues/1587
|
204
|
-
# https://github.com/wayneeseguin/rvm/issues/719
|
205
|
-
patch source: "rvm-cflags.patch", plevel: 1, env: patch_env
|
206
|
-
|
207
|
-
# From RVM forum
|
208
|
-
# https://github.com/wayneeseguin/rvm/commit/86766534fcc26f4582f23842a4d3789707ce6b96
|
209
|
-
configure_command << "ac_cv_func_dl_iterate_phdr=no"
|
210
|
-
configure_command << "--with-opt-dir=#{install_dir}/embedded"
|
211
|
-
elsif windows?
|
212
|
-
configure_command << " debugflags=-g"
|
213
|
-
else
|
214
|
-
configure_command << "--with-opt-dir=#{install_dir}/embedded"
|
215
|
-
end
|
216
|
-
|
217
|
-
# FFS: works around a bug that infects AIX when it picks up our pkg-config
|
218
|
-
# AFAIK, ruby does not need or use this pkg-config it just causes the build to fail.
|
219
|
-
# The alternative would be to patch configure to remove all the pkg-config garbage entirely
|
220
|
-
env["PKG_CONFIG"] = "/bin/true" if aix?
|
221
|
-
|
222
|
-
configure(*configure_command, env: env)
|
223
|
-
make "-j #{workers}", env: env
|
224
|
-
make "-j #{workers} install", env: env
|
225
|
-
|
226
|
-
if windows?
|
227
|
-
# Needed now that we switched to msys2 and have not figured out how to tell
|
228
|
-
# it how to statically link yet
|
229
|
-
dlls = ["libwinpthread-1"]
|
230
|
-
if windows_arch_i386?
|
231
|
-
dlls << "libgcc_s_dw2-1"
|
232
|
-
else
|
233
|
-
dlls << "libgcc_s_seh-1"
|
234
|
-
end
|
235
|
-
dlls.each do |dll|
|
236
|
-
arch_suffix = windows_arch_i386? ? "32" : "64"
|
237
|
-
windows_path = "C:/msys2/mingw#{arch_suffix}/bin/#{dll}.dll"
|
238
|
-
if File.exist?(windows_path)
|
239
|
-
copy windows_path, "#{install_dir}/embedded/bin/#{dll}.dll"
|
240
|
-
else
|
241
|
-
raise "Cannot find required DLL needed for dynamic linking: #{windows_path}"
|
242
|
-
end
|
243
|
-
end
|
244
|
-
else
|
245
|
-
end
|
246
|
-
|
247
|
-
end
|
data/config/software/zlib.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2012-2015 Chef Software, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
#
|
16
|
-
|
17
|
-
name "zlib"
|
18
|
-
default_version "1.2.8"
|
19
|
-
|
20
|
-
version "1.2.8" do
|
21
|
-
source md5: "44d667c142d7cda120332623eab69f40"
|
22
|
-
end
|
23
|
-
version "1.2.6" do
|
24
|
-
source md5: "618e944d7c7cd6521551e30b32322f4a"
|
25
|
-
end
|
26
|
-
|
27
|
-
source url: "http://zlib.net/zlib-#{version}.tar.gz"
|
28
|
-
|
29
|
-
license "Zlib"
|
30
|
-
license_file "README"
|
31
|
-
|
32
|
-
relative_path "zlib-#{version}"
|
33
|
-
|
34
|
-
build do
|
35
|
-
if windows?
|
36
|
-
env = with_standard_compiler_flags(with_embedded_path)
|
37
|
-
|
38
|
-
patch source: "zlib-windows-relocate.patch", env: env
|
39
|
-
|
40
|
-
# We can't use the top-level Makefile. Instead, the developers have made
|
41
|
-
# an organic, artisanal, hand-crafted Makefile.gcc for us which takes a few
|
42
|
-
# variables.
|
43
|
-
env["BINARY_PATH"] = "/bin"
|
44
|
-
env["LIBRARY_PATH"] = "/lib"
|
45
|
-
env["INCLUDE_PATH"] = "/include"
|
46
|
-
env["DESTDIR"] = "#{install_dir}/embedded"
|
47
|
-
|
48
|
-
make_args = [
|
49
|
-
"-fwin32/Makefile.gcc",
|
50
|
-
"SHARED_MODE=1",
|
51
|
-
"CFLAGS=\"#{env['CFLAGS']} -Wall\"",
|
52
|
-
"ASFLAGS=\"#{env['CFLAGS']} -Wall\"",
|
53
|
-
"LDFLAGS=\"#{env['LDFLAGS']}\"",
|
54
|
-
# The win32 makefile for zlib does not handle parallel make correctly.
|
55
|
-
# In particular, see its rule for IMPLIB and SHAREDLIB. The ld step in
|
56
|
-
# SHAREDLIB will generate both the dll and the dll.a files. The step to
|
57
|
-
# strip the dll occurs next but since the dll.a file is already present,
|
58
|
-
# make will attempt to link example_d.exe and minigzip_d.exe in parallel
|
59
|
-
# with the strip step - causing gcc to freak out when a source file is
|
60
|
-
# rewritten part way through the linking stage.
|
61
|
-
#"-j #{workers}",
|
62
|
-
]
|
63
|
-
|
64
|
-
make(*make_args, env: env)
|
65
|
-
make("install", *make_args, env: env)
|
66
|
-
else
|
67
|
-
# We omit the omnibus path here because it breaks mac_os_x builds by picking
|
68
|
-
# up the embedded libtool instead of the system libtool which the zlib
|
69
|
-
# configure script cannot handle.
|
70
|
-
# TODO: Do other OSes need this? Is this strictly a mac thing?
|
71
|
-
env = with_standard_compiler_flags
|
72
|
-
if solaris_10?
|
73
|
-
# For some reason zlib needs this flag on solaris (cargocult warning?)
|
74
|
-
env["CFLAGS"] << " -DNO_VIZ"
|
75
|
-
elsif freebsd?
|
76
|
-
# FreeBSD 10+ gets cranky if zlib is not compiled in a
|
77
|
-
# position-independent way.
|
78
|
-
env["CFLAGS"] << " -fPIC"
|
79
|
-
end
|
80
|
-
|
81
|
-
configure env: env
|
82
|
-
|
83
|
-
make "-j #{workers}", env: env
|
84
|
-
make "-j #{workers} install", env: env
|
85
|
-
end
|
86
|
-
end
|