Skip to content

Commit

Permalink
(PDB-5622) Depend on Java 11 or 17 - prefer 17
Browse files Browse the repository at this point in the history
On Redhat 8 and Debian platforms, take advantage of boolean dependencies
to allow Java 11 or Java 17. Platform 8 will go into PE 2023, which uses
Java 17, so the dependencies prefer Java 17.

Redhat 7 may not understand the or dependencies, or have java 17, so
just depend on 11.
  • Loading branch information
austb committed Apr 5, 2023
1 parent 91349fa commit 58da4ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
Added:
* Add `puppet-platform-version` parameter, defaulting to 7, to allow EZBake
to pick newer java versions for newer platforms
* On Platform 8, Redhat 8 and Debian platforms will allow Java 11 or 17

Removed:
* (EZ-149) Removed debian 9 from build targets
Expand Down
19 changes: 9 additions & 10 deletions resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,14 @@
options.java =
case options.platform_version
when 8
'java-11-openjdk-headless'
# rpm on Redhat 7 may not support OR dependencies
if options.os_version == 7
'java-11-openjdk-headless'
elsif options.os_version == 8
'(java-17-openjdk-headless or java-11-openjdk-headless)'
end
when 6..7
'java-8-openjdk-headless'
else
fail "Unknown Puppet Platform Version #{options.platform_version}"
end
end

Expand Down Expand Up @@ -317,12 +320,8 @@
options.java =
case options.platform_version
when 8
# debian 10/11 and Ubuntu 18/20/22 use java11
if options.dist =~ /buster|bullseye|bionic|focal|jammy/
'openjdk-11-jre-headless'
elsif options.dist =~ /bookworm/
# Debian 12 uses java 17
'openjdk-17-jre-headless'
if options.dist =~ /buster|bullseye|bookworm|bionic|focal|jammy/
'openjdk-17-jre-headless | openjdk-11-jre-headless'
end
when 6..7
if options.dist =~ /buster|bullseye/ # debian 10+ uses java11
Expand Down Expand Up @@ -392,7 +391,7 @@
fpm_opts << "--depends pe-puppet-enterprise-release"
fpm_opts << "--depends pe-bouncy-castle-jars"
else
fpm_opts << "--depends #{options.java}"
fpm_opts << "--depends '#{options.java}'"
end

fpm_opts << "--depends bash"
Expand Down

0 comments on commit 58da4ff

Please sign in to comment.