Commit 98a4bd03 authored by Tim Smith's avatar Tim Smith
Browse files

Merge pull request #35 from chef-cookbooks/lcg/no-computed-attributes

remove computed attributes
parents ed72f11f 14cb3891
......@@ -19,7 +19,6 @@ default['erlang']['gui_tools'] = false
default['erlang']['install_method'] = 'package'
default['erlang']['source']['version'] = 'R15B01'
default['erlang']['source']['url'] = "http://erlang.org/download/otp_src_#{node['erlang']['source']['version']}.tar.gz"
default['erlang']['source']['checksum'] = 'f94f7de7328af3c0cdc42089c1a4ecd03bf98ec680f47eb5e6cddc50261cabde'
default['erlang']['source']['build_flags'] = ''
default['erlang']['source']['cflags'] = ''
......
......@@ -37,21 +37,27 @@ erlang_deps.each do |pkg|
end
end
erlang_version = node['erlang']['source']['version']
erlang_url = node['erlang']['source']['url'] || "http://erlang.org/download/otp_src_#{erlang_version}.tar.gz"
erlang_checksum = node['erlang']['source']['checksum']
erlang_build_flags = node['erlang']['source']['build_flags']
erlang_cflags = node['erlang']['source']['cflags']
bash 'install-erlang' do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar -xzf otp_src_#{node['erlang']['source']['version']}.tar.gz
(cd otp_src_#{node['erlang']['source']['version']} && ./configure #{node['erlang']['source']['build_flags']} && make && make install)
tar -xzf otp_src_#{erlang_version}.tar.gz
(cd otp_src_#{erlang_version} && ./configure #{erlang_build_flags} && make && make install)
EOH
environment('CFLAGS' => node['erlang']['source']['cflags'])
environment('CFLAGS' => erlang_cflags)
action :nothing
not_if "erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell | grep #{node['erlang']['source']['version']}"
not_if "erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell | grep #{erlang_version}"
end
remote_file File.join(Chef::Config[:file_cache_path], "otp_src_#{node['erlang']['source']['version']}.tar.gz") do
source node['erlang']['source']['url']
remote_file File.join(Chef::Config[:file_cache_path], "otp_src_#{erlang_version}.tar.gz") do
source erlang_url
owner 'root'
mode 0644
checksum node['erlang']['source']['checksum']
checksum erlang_checksum
notifies :run, 'bash[install-erlang]', :immediately
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment