From ef9eb32edac645622e01798c7d2cf0b2d1337f95 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Sat, 27 Apr 2013 13:38:49 -0400 Subject: [PATCH 1/8] modifying --- recipes/openjdk.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index 82f4a221..3c37a8a5 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -92,6 +92,6 @@ pkgs.each do |pkg| package pkg do action :install - notifies :create, "ruby_block[update-java-alternatives]", :immediately if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") + notifies :create, resources(:ruby_block => "update-java-alternatives"), :immediately if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") end end From ae0f0952e6730ebffd7e5bee977096dc1d6cc293 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Mon, 29 Apr 2013 14:37:00 -0400 Subject: [PATCH 2/8] maybe platform is not being triggered --- recipes/openjdk.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index 3c37a8a5..556d530a 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -50,8 +50,7 @@ mode 0755 end - -if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") +#if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") ruby_block "update-java-alternatives" do block do arch = node['kernel']['machine'] =~ /x86_64/ ? "x86_64" : "i386" @@ -87,11 +86,11 @@ end action :nothing end -end +#end pkgs.each do |pkg| package pkg do action :install - notifies :create, resources(:ruby_block => "update-java-alternatives"), :immediately if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") + notifies :create, resources(:ruby_block => "update-java-alternatives"), :immediately # if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon","oracle") end end From 229fbc5177b502b9dd55b97630bea2cce093f290 Mon Sep 17 00:00:00 2001 From: brianbianco Date: Wed, 10 Apr 2013 15:10:37 -0400 Subject: [PATCH 3/8] COOK-2728 Java cookbook does not properly set JAVA_HOME for ubuntu 12.04 when using openjdk --- attributes/default.rb | 6 ++++++ recipes/openjdk.rb | 1 + 2 files changed, 7 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index 3613d17a..d5dd2fdd 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -36,6 +36,12 @@ default['java']['install_flavor'] = "windows" default['java']['windows']['url'] = nil default['java']['windows']['package_name'] = "Java(TM) SE Development Kit 7 (64-bit)" +when "ubuntu" + if platform_version.to_f >= 12.04 && java['install_flavor'] == "openjdk" + default['java']['java_home'] = "/usr/lib/jvm/java-1.#{java['jdk_version']}.0-openjdk-#{kernel['machine'] =~ /x86_64/ ? "amd64" : "i386"}" + else + default['java']['java_home'] = "/usr/lib/jvm/default-java" + end else default['java']['java_home'] = "/usr/lib/jvm/default-java" end diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index 556d530a..78476a62 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -27,6 +27,7 @@ "default" => ["java-1.#{jdk_version}.0-openjdk","java-1.#{jdk_version}.0-openjdk-devel"] }, ["debian","ubuntu"] => { + "12.04" => ["openjdk-#{jdk_version}-jdk","openjdk-#{jdk_version}-jre-headless"], "default" => ["openjdk-#{jdk_version}-jdk","default-jre-headless"] }, ["arch","freebsd"] => { From b8f9064c4172c7b882c0cb92df17a57ac8d5ab8b Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Tue, 3 Sep 2013 11:51:29 -0400 Subject: [PATCH 4/8] updating for chef 11 syntax --- metadata.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/metadata.rb b/metadata.rb index 0cf992a4..640fce65 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,11 +6,10 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.10.0" -recipe "java", "Installs Java runtime" -recipe "java::openjdk", "Installs the OpenJDK flavor of Java" -recipe "java::oracle", "Installs the Oracle flavor of Java" -recipe "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default" - +provides "java", "Installs Java runtime" +provides "java::openjdk", "Installs the OpenJDK flavor of Java" +provides "java::oracle", "Installs the Oracle flavor of Java" +provides "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default" %w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows }.each do |os| supports os From 61f99c7be85c6fa6e42716492e3fe964b93ac8f5 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Tue, 3 Sep 2013 12:29:06 -0400 Subject: [PATCH 5/8] trying to update java so chef is aware of it --- metadata.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.rb b/metadata.rb index 640fce65..5e398ee2 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,10 +6,10 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.10.0" -provides "java", "Installs Java runtime" -provides "java::openjdk", "Installs the OpenJDK flavor of Java" -provides "java::oracle", "Installs the Oracle flavor of Java" -provides "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default" +provides "java"#, "Installs Java runtime" +provides "java::openjdk"#, "Installs the OpenJDK flavor of Java" +provides "java::oracle"#, "Installs the Oracle flavor of Java" +provides "java::oracle_i386"#, "Installs the 32-bit jvm without setting it as the default" %w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows }.each do |os| supports os From 4ec0c5bdc87d693c9fcfc1294ccff6bddd21f192 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Tue, 3 Sep 2013 12:44:28 -0400 Subject: [PATCH 6/8] apparently opsworks doesn't support 'provides' like opscode --- metadata.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.rb b/metadata.rb index 5e398ee2..28b94f13 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,10 +6,10 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.10.0" -provides "java"#, "Installs Java runtime" -provides "java::openjdk"#, "Installs the OpenJDK flavor of Java" -provides "java::oracle"#, "Installs the Oracle flavor of Java" -provides "java::oracle_i386"#, "Installs the 32-bit jvm without setting it as the default" +recipe "java" #, "Installs Java runtime" +recipe "java::openjdk" #, "Installs the OpenJDK flavor of Java" +#provides "java::oracle"#, "Installs the Oracle flavor of Java" +#provides "java::oracle_i386"#, "Installs the 32-bit jvm without setting it as the default" %w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows }.each do |os| supports os From be628c1f9849519e691f5fb03828e1f54a125bd4 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Tue, 3 Sep 2013 13:00:06 -0400 Subject: [PATCH 7/8] fool me four times, shame on me... need to update master cookbooks repo (or learn to upload via s3 zip) --- metadata.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.rb b/metadata.rb index 28b94f13..cdf18af4 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,10 +6,10 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.10.0" -recipe "java" #, "Installs Java runtime" -recipe "java::openjdk" #, "Installs the OpenJDK flavor of Java" -#provides "java::oracle"#, "Installs the Oracle flavor of Java" -#provides "java::oracle_i386"#, "Installs the 32-bit jvm without setting it as the default" +provides "java" #, "Installs Java runtime" +provides "java::openjdk" #, "Installs the OpenJDK flavor of Java" +provides "java::oracle"#, "Installs the Oracle flavor of Java" +provides "java::oracle_i386"#, "Installs the 32-bit jvm without setting it as the default" %w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows }.each do |os| supports os From 7510a4c9c8c21159256ea7b1ec0149ce460d3701 Mon Sep 17 00:00:00 2001 From: Darius Roberts Date: Tue, 3 Sep 2013 13:26:34 -0400 Subject: [PATCH 8/8] breaking this recipe for windows users --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index cdf18af4..dd582ae7 100644 --- a/metadata.rb +++ b/metadata.rb @@ -15,4 +15,4 @@ supports os end -depends "windows" +#depends "windows"