Skip to content

Commit

Permalink
Add JRE21 installers
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 committed Sep 18, 2023
1 parent ba7a636 commit ecb7d78
Show file tree
Hide file tree
Showing 11 changed files with 541 additions and 8 deletions.
16 changes: 8 additions & 8 deletions linux/jre/alpine/src/main/packaging/temurin/21/APKBUILD
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Maintainer: Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org>
pkgname=temurin-20
pkgver=20.0.2_p9
pkgname=temurin-21
pkgver=21.0.0_p35
# replace _p1 with _1
_pkgver=${pkgver/_p/_}
_pkgverplus=${pkgver/_p/+}
_pkgvername=${_pkgverplus/+/%2B}
pkgrel=0
pkgdesc="Eclipse Temurin 20"
provider_priority=20
pkgdesc="Eclipse Temurin 21"
provider_priority=21
url="https://adoptium.net"
arch="noarch"
license="GPL-2.0-with-classpath-exception"
Expand All @@ -25,10 +25,10 @@ makedepends="
"
depends=""
subpackages="$pkgname-jre:_jre:x86_64"
source="https://github.com/adoptium/temurin20-binaries/releases/download/jdk-$_pkgvername/OpenJDK20U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz
source="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-$_pkgvername/OpenJDK21U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz
"

_java_home="/usr/lib/jvm/java-20-temurin-jre"
_java_home="/usr/lib/jvm/java-21-temurin-jre"

ldpath="$_java_home/lib:$_java_home/lib/server"
sonameprefix="$pkgname:"
Expand All @@ -50,7 +50,7 @@ package() {
}

_jre() {
pkgdesc="Eclipse Temurin 20 (JRE)"
pkgdesc="Eclipse Temurin 21 (JRE)"
provides="java-jre"
depends="java-common java-cacerts"
_fromroot="$pkgdir/$_java_home"
Expand All @@ -71,5 +71,5 @@ _jre() {
}

sha256sums="
53b34747a3c042a4cccb2b8b78fba3330b105bc523f0861237baa9143dc39115 OpenJDK20U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz
53b34747a3c042a4cccb2b8b78fba3330b105bc523f0861237baa9143dc39115 OpenJDK21U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
temurin-21-jre (21.0.0.0.0+35) STABLE; urgency=medium

* Eclipse Temurin 21.0.0.0.0+35 release.

-- Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org> Wed, 20 Sep 2023 09:00:00 +0000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
63 changes: 63 additions & 0 deletions linux/jre/debian/src/main/packaging/temurin/21/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Source: temurin-21-jre
Section: java
Priority: optional
Maintainer: Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org>
Build-Depends: debhelper (>= 11), lsb-release

Package: temurin-21-jre
Architecture: amd64 armhf arm64 ppc64el s390x
Depends: adoptium-ca-certificates,
java-common,
libasound2,
libc6,
libfontconfig1,
libfreetype6,
libx11-6,
libxext6,
libxi6,
libxrender1,
libxtst6,
zlib1g
Recommends: fonts-dejavu-core,
fonts-dejavu-extra
Provides: java-runtime,
java-runtime-headless,
java10-runtime,
java11-runtime,
java12-runtime,
java13-runtime,
java14-runtime,
java15-runtime,
java16-runtime,
java17-runtime,
java18-runtime,
java19-runtime,
java2-runtime,
java20-runtime,
java21-runtime,
java5-runtime,
java6-runtime,
java7-runtime,
java8-runtime,
java9-runtime,
java10-runtime-headless,
java11-runtime-headless,
java12-runtime-headless,
java13-runtime-headless,
java14-runtime-headless,
java15-runtime-headless,
java16-runtime-headless,
java17-runtime-headless,
java18-runtime-headless,
java19-runtime-headless,
java2-runtime-headless,
java20-runtime-headless,
java21-runtime-headless,
java5-runtime-headless,
java6-runtime-headless,
java7-runtime-headless,
java8-runtime-headless,
java9-runtime-headless
Description: Eclipse Temurin 21 JRE
Eclipse Temurin JRE is an OpenJDK-based runtime environment to execute
Java applications and services.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Files: *
Copyright: Oracle and/or its affiliates
License: GPL-2.0+CE
11 changes: 11 additions & 0 deletions linux/jre/debian/src/main/packaging/temurin/21/debian/jinfo.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name=@pkg_alias@
alias=@pkg_alias@
priority=@priority@
section=contrib

hl java /usr/lib/jvm/@jvm_dir@/bin/java
hl jfr /usr/lib/jvm/@jvm_dir@/bin/jfr
hl jrunscript /usr/lib/jvm/@jvm_dir@/bin/jrunscript
jdkhl jwebserver /usr/lib/jvm/@jvm_dir@/bin/jwebserver
hl keytool /usr/lib/jvm/@jvm_dir@/bin/keytool
hl rmiregistry /usr/lib/jvm/@jvm_dir@/bin/rmiregistry
42 changes: 42 additions & 0 deletions linux/jre/debian/src/main/packaging/temurin/21/debian/postinst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh
set -eu

priority="@priority@"
jdk_base_dir="/usr/lib/jvm/@jvm_dir@"
tools="@jvm_tools@"

case "$1" in
configure)
for tool in $tools; do
for tool_path in "$jdk_base_dir/bin/$tool" "$jdk_base_dir/lib/$tool"; do
if [ ! -e "$tool_path" ]; then
continue
fi

slave=""
tool_man_path="$jdk_base_dir/man/man1/$tool.1"
if [ -e "$tool_man_path" ]; then
slave="--slave /usr/share/man/man1/$tool.1 $tool.1 $tool_man_path"
fi

update-alternatives \
--install \
"/usr/bin/$tool" \
"$tool" \
"$tool_path" \
"$priority" \
$slave
done
done
;;

abort-upgrade | abort-remove | abort-deconfigure)
# Nothing to do
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0
28 changes: 28 additions & 0 deletions linux/jre/debian/src/main/packaging/temurin/21/debian/prerm.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
set -eu

jdk_base_dir="/usr/lib/jvm/@jvm_dir@"
tools="@jvm_tools@"

case "$1" in
purge)
# Nothing to do
;;
remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear | deconfigure)
for tool in $tools; do
for tool_path in "$jdk_base_dir/bin/$tool" "$jdk_base_dir/lib/$tool"; do
if [ ! -e "$tool_path" ]; then
continue
fi

update-alternatives --remove "$tool" "$tool_path"
done
done
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac

exit 0
65 changes: 65 additions & 0 deletions linux/jre/debian/src/main/packaging/temurin/21/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/make -f

pkg_name = temurin-21-jre
priority = 2100
jvm_tools = java jfr jrunscript jwebserver keytool rmiregistry
amd64_tarball_url = https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B35/OpenJDK21U-jre_x64_linux_hotspot_21.0.0_35.tar.gz
amd64_checksum = e3592e86290c192804d9c6b5035d42cc32cf04141d1c0b9d1ecb67739826c8c5
arm64_tarball_url = https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.0%2B35/OpenJDK21U-jre_aarch64_linux_hotspot_21.0.0_35.tar.gz
arm64_checksum = 63a730d5a3b6d21d31f7cba15dc44b019a8a4d8652e13acec45040f98584112c

d = debian/$(pkg_name)
jvm_home = usr/lib/jvm
jvm_dir = $(pkg_name)-$(DEB_HOST_ARCH)
pkg_alias = $(pkg_name)-$(DEB_HOST_ARCH)

%:
dh $@

override_dh_auto_clean:
override_dh_auto_test:
override_dh_auto_build:
override_dh_strip:
override_dh_auto_install:
# Download and verify checksum of JRE
wget --progress=dot:mega -O jre.tar.gz $($(DEB_HOST_ARCH)_tarball_url)
echo '$($(DEB_HOST_ARCH)_checksum) jre.tar.gz' > jre.tar.gz.sha256.txt
sha256sum -c jre.tar.gz.sha256.txt

# Substitute variables.
sed \
-e 's/@pkg_alias@/$(pkg_alias)/g' \
-e 's/@jvm_dir@/$(jvm_dir)/g' \
-e 's/@priority@/$(priority)/g' \
-e 's/@jvm_tools@/$(jvm_tools)/g' \
debian/jinfo.in > debian/jinfo

sed \
-e 's/@pkg_alias@/$(pkg_alias)/g' \
-e 's/@jvm_dir@/$(jvm_dir)/g' \
-e 's/@priority@/$(priority)/g' \
-e 's/@jvm_tools@/$(jvm_tools)/g' \
debian/postinst.in > debian/postinst

sed \
-e 's/@pkg_alias@/$(pkg_alias)/g' \
-e 's/@jvm_dir@/$(jvm_dir)/g' \
-e 's/@priority@/$(priority)/g' \
-e 's/@jvm_tools@/$(jvm_tools)/g' \
debian/prerm.in > debian/prerm

# Unpack JRE.
dh_installdirs \
$(jvm_home) \
$(jvm_home)/$(jvm_dir)
tar --strip-components=1 -C "$(d)/$(jvm_home)/$(jvm_dir)" -xf jre.tar.gz

# Add jinfo file (alternatives support).
cp debian/jinfo "$(d)/$(jvm_home)/.$(pkg_alias).jinfo"

# Replace bundled cacerts and redirect to adoptium-ca-certificates.
rm -f "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"
ln -s /etc/ssl/certs/adoptium/cacerts "$(d)/$(jvm_home)/$(jvm_dir)/lib/security/cacerts"

override_dh_gencontrol:
dh_gencontrol --
Loading

0 comments on commit ecb7d78

Please sign in to comment.