Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2009 14:22
Show Gist options
  • Save anonymous/137628 to your computer and use it in GitHub Desktop.
Save anonymous/137628 to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------------------------
# Java installation
# ----------------------------------------------------------------------------------
package "debconf-utils" do
action :install
end
# Java requires you to accept licenses by hand. We can automate this with the following script
bash "accept_licenses" do
licenses = 'sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre sun-java6-jre/stopthread boolean true
sun-java6-jre sun-java6-jre/jcepolicy note
sun-java6-bin shared/present-sun-dlj-v1-1 note
sun-java6-jdk shared/present-sun-dlj-v1-1 note
sun-java6-jre shared/present-sun-dlj-v1-1 note'
licenses = licenses.to_a.collect { |l| l.strip }.join("\n")
code "echo #{licenses.inspect} | debconf-set-selections"
end
package "sun-java6-bin" do
name "sun-java6-bin"
action :install
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment