Files
puppetlabs-java/manifests/params.pp
Jinn Koriech feb669f203 Support recent java versions > 8u99 built with make-jpkg 0.53
The previous make-jpkg from java-package_0.50 doesn't support building java
versions with three digits in the release number.  Therefore it has been
necessary to upgrade java-packaages to the newer 0.53 version.

Building oracle packages using the java-package tools 0.53 results in package
with a new naming scheme as compared to 0.50.  In particular where the packages
were previously named oracle-j2re1.8 they are now named oracle-java8-jre, while
oracle-j2dk1.8 has become oracle-java8-jdk.  The alternatives naming has also
changed.

We also need to handle the system architecture naming on debian systems where
Debian names it's 64bit architecture 'amd64' and Oracle use 'x64'.  This results
in the java_home path using x64 rather than amd64.  We need to handle this
variation while also accommodating all architectures, and only for the recent
packages.

Given this has only been tested on Ubuntu, and the make-jpkg tooling is managed
in the Debian flavour, the changes are only applied to that code branch.

Jinn Koriech & Doug Neal
2016-09-08 15:43:38 +01:00

211 lines
8.4 KiB
Puppet

# Class: java::params
#
# This class builds a hash of JDK/JRE packages and (for Debian)
# alternatives. For wheezy/precise, we provide Oracle JDK/JRE
# options, even though those are not in the package repositories.
#
# For more info on how to package Oracle JDK/JRE, see the Debian wiki:
# http://wiki.debian.org/JavaPackage
#
# Because the alternatives system makes it very difficult to tell
# which Java alternative is enabled, we hard code the path to bin/java
# for the config class to test if it is enabled.
class java::params {
case $::osfamily {
'RedHat': {
case $::operatingsystem {
'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL': {
if (versioncmp($::operatingsystemrelease, '5.0') < 0) {
$jdk_package = 'java-1.6.0-sun-devel'
$jre_package = 'java-1.6.0-sun'
}
elsif (versioncmp($::operatingsystemrelease, '6.3') < 0) {
$jdk_package = 'java-1.6.0-openjdk-devel'
$jre_package = 'java-1.6.0-openjdk'
}
elsif (versioncmp($::operatingsystemrelease, '7.1') < 0) {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
else {
$jdk_package = 'java-1.8.0-openjdk-devel'
$jre_package = 'java-1.8.0-openjdk'
}
}
'Fedora': {
if (versioncmp($::operatingsystemrelease, '21') < 0) {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
else {
$jdk_package = 'java-1.8.0-openjdk-devel'
$jre_package = 'java-1.8.0-openjdk'
}
}
'Amazon': {
$jdk_package = 'java-1.7.0-openjdk-devel'
$jre_package = 'java-1.7.0-openjdk'
}
default: { fail("unsupported os ${::operatingsystem}") }
}
$java = {
'jdk' => { 'package' => $jdk_package, },
'jre' => { 'package' => $jre_package, },
}
}
'Debian': {
$oracle_architecture = $::architecture ? {
'amd64' => 'x64',
default => $::architecture
}
case $::lsbdistcodename {
'lenny', 'squeeze', 'lucid', 'natty': {
$java = {
'jdk' => {
'package' => 'openjdk-6-jdk',
'alternative' => "java-6-openjdk-${::architecture}",
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
},
'jre' => {
'package' => 'openjdk-6-jre-headless',
'alternative' => "java-6-openjdk-${::architecture}",
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
},
'sun-jre' => {
'package' => 'sun-java6-jre',
'alternative' => 'java-6-sun',
'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-sun/jre/',
},
'sun-jdk' => {
'package' => 'sun-java6-jdk',
'alternative' => 'java-6-sun',
'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-sun/jre/',
},
}
}
'wheezy', 'jessie', 'precise', 'quantal', 'raring', 'saucy', 'trusty', 'utopic': {
$java = {
'jdk' => {
'package' => 'openjdk-7-jdk',
'alternative' => "java-1.7.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/",
},
'jre' => {
'package' => 'openjdk-7-jre-headless',
'alternative' => "java-1.7.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/",
},
'oracle-jre' => {
'package' => 'oracle-j2re1.7',
'alternative' => 'j2re1.7-oracle',
'alternative_path' => '/usr/lib/jvm/j2re1.7-oracle/bin/java',
'java_home' => '/usr/lib/jvm/j2re1.7-oracle/',
},
'oracle-jdk' => {
'package' => 'oracle-j2sdk1.7',
'alternative' => 'j2sdk1.7-oracle',
'alternative_path' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/bin/java',
'java_home' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/',
},
'oracle-j2re' => {
'package' => 'oracle-j2re1.8',
'alternative' => 'j2re1.8-oracle',
'alternative_path' => '/usr/lib/jvm/j2re1.8-oracle/bin/java',
'java_home' => '/usr/lib/jvm/j2re1.8-oracle/',
},
'oracle-j2sdk' => {
'package' => 'oracle-j2sdk1.8',
'alternative' => 'j2sdk1.8-oracle',
'alternative_path' => '/usr/lib/jvm/j2sdk1.8-oracle/bin/java',
'java_home' => '/usr/lib/jvm/j2sdk1.8-oracle/',
},
'oracle-java8-jre' => {
'package' => 'oracle-java8-jre',
'alternative' => "jre-8-oracle-${oracle_architecture}",
'alternative_path' => "/usr/lib/jvm/jre-8-oracle-${oracle_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/jre-8-oracle-${oracle_architecture}/",
},
'oracle-java8-jdk' => {
'package' => 'oracle-java8-jdk',
'alternative' => "jdk-8-oracle-${oracle_architecture}",
'alternative_path' => "/usr/lib/jvm/jdk-8-oracle-${oracle_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/jdk-8-oracle-${oracle_architecture}/",
},
}
}
'vivid', 'wily', 'xenial': {
$java = {
'jdk' => {
'package' => 'openjdk-8-jdk',
'alternative' => "java-1.8.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/",
},
'jre' => {
'package' => 'openjdk-8-jre-headless',
'alternative' => "java-1.8.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/",
}
}
}
default: { fail("unsupported release ${::lsbdistcodename}") }
}
}
'OpenBSD': {
$java = {
'jdk' => { 'package' => 'jdk', },
'jre' => { 'package' => 'jre', },
}
}
'FreeBSD': {
$java = {
'jdk' => { 'package' => 'openjdk', },
'jre' => { 'package' => 'openjdk-jre', },
}
}
'Solaris': {
$java = {
'jdk' => { 'package' => 'developer/java/jdk-7', },
'jre' => { 'package' => 'runtime/java/jre-7', },
}
}
'Suse': {
case $::operatingsystem {
'SLES': {
if (versioncmp($::operatingsystemrelease, '12') >= 0) {
$jdk_package = 'java-1_7_0-openjdk-devel'
$jre_package = 'java-1_7_0-openjdk'
} elsif (versioncmp($::operatingsystemrelease, '11.4') >= 0) {
$jdk_package = 'java-1_7_0-ibm-devel'
$jre_package = 'java-1_7_0-ibm'
} else {
$jdk_package = 'java-1_6_0-ibm-devel'
$jre_package = 'java-1_6_0-ibm'
}
}
'OpenSuSE': {
$jdk_package = 'java-1_7_0-openjdk-devel'
$jre_package = 'java-1_7_0-openjdk'
}
default: {
$jdk_package = 'java-1_6_0-ibm-devel'
$jre_package = 'java-1_6_0-ibm'
}
}
$java = {
'jdk' => { 'package' => $jdk_package, },
'jre' => { 'package' => $jre_package, },
}
}
default: { fail("unsupported platform ${::osfamily}") }
}
}