Skip to content

Commit

Permalink
Override OpenSSL version in nginx node and python recipes
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Thornton <dthornton@pivotal.io>
  • Loading branch information
Tilly Taylor and dwillist committed Jun 26, 2019
1 parent 8962cef commit ccff965
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
9 changes: 9 additions & 0 deletions recipe/nginx.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# encoding: utf-8
require_relative 'openssl_recipe'
require_relative 'base'

class NginxRecipe < BaseRecipe

def initialize(name, version, options = {})
super name, version, options
# override openssl in container
OpenSSLRecipe.new('openssl', 'OpenSSL_1_1_0g',
{ sha256: '8e9516b8635bb9113c51a7b5b27f9027692a56b104e75b709e588c3ffd6a0422' }).cook
end

def computed_options
[
'--prefix=/',
Expand Down
9 changes: 9 additions & 0 deletions recipe/node.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# encoding: utf-8
require 'mini_portile'
require 'fileutils'
require_relative 'openssl_recipe'
require_relative 'base'

class NodeRecipe < BaseRecipe

def initialize(name, version, options = {})
super name, version, options
# override openssl in container
OpenSSLRecipe.new('openssl', 'OpenSSL_1_1_0g',
{ sha256: '8e9516b8635bb9113c51a7b5b27f9027692a56b104e75b709e588c3ffd6a0422' }).cook
end

def computed_options
puts '----- computed_options ---------'
puts [ Gem::Version.new(version), '>=', Gem::Version.new('6.0.0') ]
Expand Down
32 changes: 32 additions & 0 deletions recipe/openssl_recipe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require_relative 'base'

class OpenSSLRecipe < BaseRecipe
def computed_options
%w(--prefix=/usr --libdir=/lib/x86_64-linux-gnu --openssldir=/include/x86_64-linux-gnu/openssl)
end

def install
return if installed?
execute('install', [make_cmd, 'install', "DESTDIR=#{path}"])
end

def configure
execute('configure', ['bash', '-c', "./config #{computed_options.join ' '}"])
end

def archive_files
["#{path}/*"]
end

def archive_path_name
'openssl'
end

def setup_tar
`rm -Rf #{path}/html/ #{path}/conf/*`
end

def url
"https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz"
end
end
8 changes: 8 additions & 0 deletions recipe/python.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# encoding: utf-8
require 'fileutils'
require 'mini_portile'
require_relative 'openssl_recipe'
require_relative 'base'

class PythonRecipe < BaseRecipe
def initialize(name, version, options = {})
super name, version, options
# override openssl in container
OpenSSLRecipe.new('openssl', 'OpenSSL_1_1_0g',
{ sha256: '8e9516b8635bb9113c51a7b5b27f9027692a56b104e75b709e588c3ffd6a0422'}).cook
end

def computed_options
[
'--enable-shared',
Expand Down

0 comments on commit ccff965

Please sign in to comment.