Commit 567461aa5b5a38cc1ff58ed30125c68311ddaf45

Authored by Jacob Vosmaer
2 parents b855ab5e 1ffe4e24

Merge branch 'openssl-6-7-stable' into '6-7-stable'

Update OpenSSL in 6-7-stable
Showing 1 changed file with 155 additions and 0 deletions   Show diff stats
config/software/openssl.rb 0 → 100644
... ... @@ -0,0 +1,155 @@
  1 +#
  2 +# Copyright:: Copyright (c) 2012 Opscode, Inc.
  3 +# Copyright:: Copyright (c) 2014 GitLab BV
  4 +# License:: Apache License, Version 2.0
  5 +#
  6 +# Licensed under the Apache License, Version 2.0 (the "License");
  7 +# you may not use this file except in compliance with the License.
  8 +# You may obtain a copy of the License at
  9 +#
  10 +# http://www.apache.org/licenses/LICENSE-2.0
  11 +#
  12 +# Unless required by applicable law or agreed to in writing, software
  13 +# distributed under the License is distributed on an "AS IS" BASIS,
  14 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 +# See the License for the specific language governing permissions and
  16 +# limitations under the License.
  17 +#
  18 +
  19 +name "openssl"
  20 +
  21 +dependency "zlib"
  22 +dependency "cacerts"
  23 +dependency "libgcc"
  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 + version "1.0.1c"
  30 + source :url => "http://www.openssl.org/source/openssl-1.0.1c.tar.gz",
  31 + :md5 => "ae412727c8c15b67880aef7bd2999b2e"
  32 +else
  33 + version "1.0.1g"
  34 + source :url => "http://www.openssl.org/source/openssl-1.0.1g.tar.gz",
  35 + :md5 => "de62b43dfcd858e66a74bee1c834e959"
  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 + # @todo: move into omnibus-ruby
  141 + has_gmake = system("gmake --version")
  142 +
  143 + if has_gmake
  144 + env.merge!({'MAKE' => 'gmake'})
  145 + make_binary = 'gmake'
  146 + else
  147 + make_binary = 'make'
  148 + end
  149 +
  150 + command configure_command, :env => env
  151 + command "#{make_binary} depend", :env => env
  152 + # make -j N on openssl is not reliable
  153 + command "#{make_binary}", :env => env
  154 + command "#{make_binary} install", :env => env
  155 +end
... ...