Skip to content

Commit

Permalink
[COOK-3537] Add OpenSSL and ZLib to source configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Vargo <sethvargo@gmail.com>
  • Loading branch information
Darrin Eden authored and sethvargo committed Sep 12, 2013
1 parent 2d87947 commit ac2c9e7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions attributes/default.rb
Expand Up @@ -61,3 +61,5 @@
default['haproxy']['source']['target_cpu'] = ''
default['haproxy']['source']['target_arch'] = ''
default['haproxy']['source']['use_pcre'] = false
default['haproxy']['source']['use_openssl'] = false
default['haproxy']['source']['use_zlib'] = false
14 changes: 14 additions & 0 deletions recipes/install_source.rb
Expand Up @@ -19,6 +19,18 @@

include_recipe 'build-essential'

package 'libpcre3-dev' do
only_if { node['haproxy']['source']['use_pcre'] }
end

package 'libssl-dev' do
only_if { node['haproxy']['source']['use_openssl'] }
end

package 'zlib1g-dev' do
only_if { node['haproxy']['source']['use_zlib'] }
end

node.set['haproxy']['conf_dir'] = "#{node['haproxy']['source']['prefix']}/etc"

remote_file "#{Chef::Config[:file_cache_path]}/haproxy-#{node['haproxy']['source']['version']}.tar.gz" do
Expand All @@ -31,6 +43,8 @@
make_cmd << " CPU=#{node['haproxy']['source']['target_cpu' ]}" unless node['haproxy']['source']['target_cpu'].empty?
make_cmd << " ARCH=#{node['haproxy']['source']['target_arch']}" unless node['haproxy']['source']['target_arch'].empty?
make_cmd << " USE_PCRE=1" if node['haproxy']['source']['use_pcre']
make_cmd << " USE_OPENSSL=1" if node['haproxy']['source']['use_openssl']
make_cmd << " USE_ZLIB=1" if node['haproxy']['source']['use_zlib']

bash "compile_haproxy" do
cwd Chef::Config[:file_cache_path]
Expand Down

0 comments on commit ac2c9e7

Please sign in to comment.