Commit 7071990cba2ec93852105603c0dba296f473a9ff

Authored by Jacob Vosmaer
1 parent 582e1cdd

Vendor the OpenSSL 1.0.1h software definition

Source:
https://github.com/opscode/omnibus-software/blob/24c4e04033d07e148ac581441f646d1b7c446b14/config/software/openssl.rb
Showing 1 changed file with 158 additions and 0 deletions   Show diff stats
config/software/openssl.rb 0 → 100644
... ... @@ -0,0 +1,158 @@
  1 +#
  2 +# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.
  3 +# License:: Apache License, Version 2.0
  4 +#
  5 +# Licensed under the Apache License, Version 2.0 (the "License");
  6 +# you may not use this file except in compliance with the License.
  7 +# You may obtain a copy of the License at
  8 +#
  9 +# http://www.apache.org/licenses/LICENSE-2.0
  10 +#
  11 +# Unless required by applicable law or agreed to in writing, software
  12 +# distributed under the License is distributed on an "AS IS" BASIS,
  13 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 +# See the License for the specific language governing permissions and
  15 +# limitations under the License.
  16 +#
  17 +
  18 +name "openssl"
  19 +
  20 +dependency "zlib"
  21 +dependency "cacerts"
  22 +dependency "libgcc"
  23 +dependency "makedepend"
  24 +
  25 +
  26 +if platform == "aix"
  27 + # XXX: OpenSSL has an open bug on 1.0.1e where it fails to install on AIX
  28 + # http://rt.openssl.org/Ticket/Display.html?id=2986&user=guest&pass=guest
  29 + default_version "1.0.1c"
  30 + source :url => "http://www.openssl.org/source/openssl-1.0.1c.tar.gz",
  31 + :md5 => "ae412727c8c15b67880aef7bd2999b2e"
  32 +else
  33 + default_version "1.0.1h"
  34 + source :url => "http://www.openssl.org/source/openssl-1.0.1h.tar.gz",
  35 + :md5 => "8d6d684a9430d5cc98a62a5d8fbda8cf"
  36 +end
  37 +
  38 +relative_path "openssl-#{version}"
  39 +
  40 +build do
  41 + patch :source => "openssl-1.0.1f-do-not-build-docs.patch"
  42 +
  43 + env = case platform
  44 + when "mac_os_x"
  45 + {
  46 + "CFLAGS" => "-arch x86_64 -m64 -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -I#{install_dir}/embedded/include/ncurses",
  47 + "LDFLAGS" => "-arch x86_64 -R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -I#{install_dir}/embedded/include/ncurses"
  48 + }
  49 + when "aix"
  50 + {
  51 + "CC" => "xlc -q64",
  52 + "CXX" => "xlC -q64",
  53 + "LD" => "ld -b64",
  54 + "CFLAGS" => "-q64 -I#{install_dir}/embedded/include -O",
  55 + "CXXFLAGS" => "-q64 -I#{install_dir}/embedded/include -O",
  56 + "LDFLAGS" => "-q64 -L#{install_dir}/embedded/lib -Wl,-blibpath:#{install_dir}/embedded/lib:/usr/lib:/lib",
  57 + "OBJECT_MODE" => "64",
  58 + "AR" => "/usr/bin/ar",
  59 + "ARFLAGS" => "-X64 cru",
  60 + "M4" => "/opt/freeware/bin/m4",
  61 + }
  62 + when "solaris2"
  63 + {
  64 + "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
  65 + "LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -static-libgcc",
  66 + "LD_OPTIONS" => "-R#{install_dir}/embedded/lib"
  67 + }
  68 + else
  69 + {
  70 + "CFLAGS" => "-I#{install_dir}/embedded/include",
  71 + "LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib"
  72 + }
  73 + end
  74 +
  75 + common_args = [
  76 + "--prefix=#{install_dir}/embedded",
  77 + "--with-zlib-lib=#{install_dir}/embedded/lib",
  78 + "--with-zlib-include=#{install_dir}/embedded/include",
  79 + "no-idea",
  80 + "no-mdc2",
  81 + "no-rc5",
  82 + "zlib",
  83 + "shared",
  84 + ].join(" ")
  85 +
  86 + configure_command = case platform
  87 + when "aix"
  88 + ["perl", "./Configure",
  89 + "aix64-cc",
  90 + common_args,
  91 + "-L#{install_dir}/embedded/lib",
  92 + "-I#{install_dir}/embedded/include",
  93 + "-Wl,-blibpath:#{install_dir}/embedded/lib:/usr/lib:/lib"].join(" ")
  94 + when "mac_os_x"
  95 + ["./Configure",
  96 + "darwin64-x86_64-cc",
  97 + common_args,
  98 + ].join(" ")
  99 + when "smartos"
  100 + ["/bin/bash ./Configure",
  101 + "solaris64-x86_64-gcc",
  102 + common_args,
  103 + "-L#{install_dir}/embedded/lib",
  104 + "-I#{install_dir}/embedded/include",
  105 + "-R#{install_dir}/embedded/lib",
  106 + "-static-libgcc"].join(" ")
  107 + when "solaris2"
  108 + if Omnibus.config.solaris_compiler == "gcc"
  109 + if architecture == "sparc"
  110 + ["/bin/sh ./Configure",
  111 + "solaris-sparcv9-gcc",
  112 + common_args,
  113 + "-L#{install_dir}/embedded/lib",
  114 + "-I#{install_dir}/embedded/include",
  115 + "-R#{install_dir}/embedded/lib",
  116 + "-static-libgcc"].join(" ")
  117 + else
  118 + # This should not require a /bin/sh, but without it we get
  119 + # Errno::ENOEXEC: Exec format error
  120 + ["/bin/sh ./Configure",
  121 + "solaris-x86-gcc",
  122 + common_args,
  123 + "-L#{install_dir}/embedded/lib",
  124 + "-I#{install_dir}/embedded/include",
  125 + "-R#{install_dir}/embedded/lib",
  126 + "-static-libgcc"].join(" ")
  127 + end
  128 + else
  129 + raise "sorry, we don't support building openssl on non-gcc solaris builds right now."
  130 + end
  131 + else
  132 + ["./config",
  133 + common_args,
  134 + "disable-gost", # fixes build on linux, but breaks solaris
  135 + "-L#{install_dir}/embedded/lib",
  136 + "-I#{install_dir}/embedded/include",
  137 + "-Wl,-rpath,#{install_dir}/embedded/lib"].join(" ")
  138 + end
  139 +
  140 + # openssl build process uses a `makedepend` tool that we build inside the bundle.
  141 + env["PATH"] = "#{install_dir}/embedded/bin" + File::PATH_SEPARATOR + ENV["PATH"]
  142 +
  143 + # @todo: move into omnibus-ruby
  144 + has_gmake = system("gmake --version")
  145 +
  146 + if has_gmake
  147 + env.merge!({'MAKE' => 'gmake'})
  148 + make_binary = 'gmake'
  149 + else
  150 + make_binary = 'make'
  151 + end
  152 +
  153 + command configure_command, :env => env
  154 + command "#{make_binary} depend", :env => env
  155 + # make -j N on openssl is not reliable
  156 + command "#{make_binary}", :env => env
  157 + command "#{make_binary} install", :env => env
  158 +end
... ...