Unpacking and installing from archives, tarballs, and zipfiles with the Ark resource


#1

You can find the full blog post here

Here is my resource for unpacking and installing from archives, the ark
resource

replace this ugly mess

download the file

remote_file “Chef::Config[:file_cache_path]/jdk-7.2.tar.gz” do
url 'http://download.oracle.com/jdk-7u2-linux-x64.tar.gz
checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5’
end

unpack it

bash “unpack java” do
code <<-EOS
tar xzf #{Chef::Config[:file_cache_path]/jdk-7.2.tar.gz}
–strip-components=1 -C /usr/local/jdk-7.2
EOS
end

indicate that this is the latest jdk

yeah, I install multiple jdk’s on a single machine for some apps

which require the i386 arch
link “/usr/local/jvm” do
to "/usr/local/jdk-7.2"
end

put the java command in the PATH

link “/usr/local/jvm/bin/java” do
to "/usr/local/bin/java"
end

with this

ark ‘jdk’ do
url
http://download.oracle.com/jdk-7u2-linux-x64.tar.gz
version ‘7.2’

       checksum

'89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5’
has_binaries [ ‘bin/java’,
‘bin/javac’, ‘bin/javaws’ ]
end

you can find it on github.com at
https://github.com/bryanwb/chef-ark