Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installers: Add Base Installer Files Ahead Of JDK21 release. #735

Merged
merged 23 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7358efc
Add JDK21 installer files
steelhead31 Sep 18, 2023
43da053
Add JDK21 to jenkinsfile
steelhead31 Sep 18, 2023
0ca368e
JDK21 version fixes
steelhead31 Sep 18, 2023
ba7a636
JDK21 timestamp fixes
steelhead31 Sep 18, 2023
ecb7d78
Add JRE21 installers
steelhead31 Sep 18, 2023
7b51b0b
Remove "U" fix java home for apks.
steelhead31 Sep 18, 2023
a8ce959
Fix java_homes for alpine
steelhead31 Sep 19, 2023
0182c1b
Remove JDK20 from jenkinsfile
steelhead31 Sep 19, 2023
0cde2ca
Update debian priority to match previous.
steelhead31 Sep 19, 2023
7cb733d
Restore Source Type 2 to jdk21 spec
steelhead31 Sep 19, 2023
203a50d
Update debian priority to align with previous jdks
steelhead31 Sep 19, 2023
4528eee
Merge branch 'master' into add_jdk_21
karianna Oct 4, 2023
716c901
add aarch64 support to alpine packages
gdams Oct 6, 2023
d79f160
fix spaces
gdams Oct 6, 2023
1462aed
add multiarch alpine support
gdams Oct 6, 2023
725d2f2
Merge branch 'adoptium:master' into add_jdk_21
steelhead31 Oct 6, 2023
6d79088
Update rpm versions with correct spec
steelhead31 Oct 6, 2023
fade3b3
Merge branch 'add_jdk_21' of https://github.com/steelhead31/installer…
steelhead31 Oct 6, 2023
735c87a
Merge branch 'master' into add_jdk_21
steelhead31 Oct 6, 2023
b518dd9
add shasums
gdams Oct 11, 2023
acdef3a
Update RHEL/SUSE Upstream versions
steelhead31 Oct 12, 2023
099ac3d
Update linux/jdk/debian/src/main/packaging/temurin/21/debian/control
steelhead31 Oct 12, 2023
2a33d0a
Update linux/jre/debian/src/main/packaging/temurin/21/debian/control
steelhead31 Oct 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions linux/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {
}
parameters {
choice(name: 'TYPE', choices: Types.ALL, description: 'Build JDK or JRE')
choice(name: 'VERSION', choices: ['8', '11', '17', '20'], description: 'Build for specific JDK VERSION')
choice(name: 'VERSION', choices: ['8', '11', '17', '21'], description: 'Build for specific JDK VERSION')
choice(name: 'ARCH', choices: ['x86_64', 'armv7hl', 'armv7l', 'aarch64', 'ppc64le', 's390x', 'all'], description: 'Build for specific platform\n s390x not for VERSION 8\n Use armv7l for DebARM32 armv7hl for RH/Suse')
choice(name: 'DISTRO', choices: ['all', 'Alpine', 'Debian', 'RedHat', 'Suse'], description: 'Build for specific Distro\n Select RPM builds for RedHat and Suse')
booleanParam(name: 'uploadPackage', defaultValue: false, description: 'Tick this box to upload the deb/rpm files (exclude src.rpm) to Artifactory for official release')
Expand Down Expand Up @@ -81,7 +81,7 @@ pipeline {
steps{
dir('linuxDebian') {
script {
jenkinsStepNonDeb("Alpine")
jenkinsStepAlpine()
}
}
}
Expand Down Expand Up @@ -237,7 +237,44 @@ def jenkinsStepDeb() {
}
}

// function handle both Alpine, RedHat and Suse as DISTRO
// Function to handle Alpine Distro
def jenkinsStepAlpine() {
def temurinVersion = "${TYPE.toLowerCase()} ${VERSION} - ${ARCH}"
echo "Installer Job for Temurin ${temurinVersion} - Alpine"
//make sure this is an array not a string
def apkArchAllList = []
// for one single ARCH add into array
apkArchAllList.add("${ARCH}")
// when ARCH = all, rewrite list
if ("${ARCH}" == 'all') {
apkArchAllList = ['x86_64', 'aarch64']
}
// remove aarch64 for JDK20 and below
if ("${VERSION}" != '21') {
apkArchAllList.remove('aarch64')
}
apkArchAllList.each { ApkARCH ->
// special handle: no label x86_64 only x64 for alpine agent
def apkLabel = "${ApkARCH}&&docker"
if ("${ApkARCH}" == 'x86_64') {
apkLabel = 'x64&&dockerBuild'
}

// reallocate jenkins agent per element in list
node("linux&&${apkLabel}") {
setup('Alpine', "${ApkARCH}")
tool name: 'jfrog-cli', type: 'jfrog'
unstash 'installercode'
buildAndTest('Alpine', "${ApkARCH}")
if (params.uploadPackage.toBoolean()) {
echo "Upload artifacts for ${VERSION} - ${ApkARCH} - Alpine"
uploadArtifacts('Alpine', "${ApkARCH}")
}
}
}
}

// function handle both RedHat and Suse as DISTRO
def jenkinsStepNonDeb(String DISTRO) {
echo "Installer Job for Temurin jdk ${VERSION} - ${ARCH} - ${DISTRO}"
setup("${DISTRO}", "${ARCH}")
Expand Down
4 changes: 3 additions & 1 deletion linux/jdk/alpine/src/main/packaging/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ cp -R /home/builder/build/generated/packaging /home/builder/workspace
cd /home/builder/workspace/packaging
abuild -r

arch=$(abuild -A)

# Copy resulting files into mounted directory where artifacts should be placed.
mv /home/builder/packages/workspace/x86_64/*.{apk,tar.gz} /home/builder/out
mv /home/builder/packages/workspace/$arch/*.{apk,tar.gz} /home/builder/out
4 changes: 3 additions & 1 deletion linux/jdk/alpine/src/main/packaging/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ sudo chown -R builder /home/builder/out
cd /home/builder/workspace/packaging
abuild -r

arch=$(abuild -A)

# Copy resulting files into mounted directory where artifacts should be placed.
mv /home/builder/packages/workspace/x86_64/*.{apk,tar.gz} /home/builder/out
mv /home/builder/packages/workspace/$arch/*.{apk,tar.gz} /home/builder/out
114 changes: 114 additions & 0 deletions linux/jdk/alpine/src/main/packaging/temurin/21/APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Maintainer: Eclipse Adoptium Package Maintainers <[email protected]>
pkgname=temurin-21
pkgver=21.0.0_p35
# replace _p1 with _1
# _pkgver=${pkgver/_p/_}
_pkgver=21_35 # remove this line and uncomment the above line when the next version is released
# _pkgverplus=${pkgver/_p/+}
_pkgverplus=21+35 # remove this line and uncomment the above line when the next version is released
_pkgvername=${_pkgverplus/+/%2B}
pkgrel=0
pkgdesc="Eclipse Temurin 21"
provider_priority=21
karianna marked this conversation as resolved.
Show resolved Hide resolved
url="https://adoptium.net"
arch="aarch64 x86_64"
license="GPL-2.0-with-classpath-exception"
makedepends="
alsa-lib-dev
freetype-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
"
depends=""
subpackages="$pkgname-src:_src:noarch
$pkgname-jdk:_jdk"
source="
https://github.com/adoptium/temurin21-binaries/releases/download/jdk-$_pkgvername/OpenJDK21u-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz

HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
"

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

ldpath="$_java_home/lib:$_java_home/lib/server"
sonameprefix="$pkgname:"

prepare() {
default_prepare
}

check() {
local _java_bin="./jdk-$_pkgverplus/bin"

# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld

# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel

# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
}

package() {
mkdir -p "$pkgdir/$_java_home"
cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home"
}

_src() {
pkgdesc="Eclipse Temurin 21 (sources)"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}

_jdk() {
pkgdesc="Eclipse Temurin 21 (JDK)"
provides="java-jdk java-jre"
depends="java-common java-cacerts"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"

mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/conf" "$_toroot"
mv "$_fromroot/include" "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
mv "$_fromroot/legal" "$_toroot"
mv "$_fromroot/lib" "$_toroot"
mv "$_fromroot/man" "$_toroot"
mv "$_fromroot/release" "$_toroot"
mv "$_fromroot/NOTICE" "$_toroot"

# symlink to shared cacerts store
rm "$_toroot/lib/security/cacerts"
ln -sf /etc/ssl/certs/java/cacerts \
"$_toroot/lib/security/cacerts"
}

case "$CARCH" in
x86_64)
_arch_sum="4fd74f93f0b1a94d8471e0ed801fe9d938f7471f6efe8791880c85e7716c943f"
;;
aarch64)
_arch_sum="3f8e5b0447d2dd711f12edda611ed1cf9aab4ca53c8fe32fca8fb1e6fee41c12"
;;
esac

sha256sums="
$_arch_sum OpenJDK21u-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz
e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java
22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java
9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
Copyright (C) 2012 Red Hat, Inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;

import java.security.Permission;
import java.security.PermissionCollection;

public class TestCryptoLevel
{
public static void main(String[] args)
throws NoSuchFieldException, ClassNotFoundException,
IllegalAccessException, InvocationTargetException
{
Class<?> cls = null;
Method def = null, exempt = null;

try
{
cls = Class.forName("javax.crypto.JceSecurity");
}
catch (ClassNotFoundException ex)
{
System.err.println("Running a non-Sun JDK.");
System.exit(0);
}
try
{
def = cls.getDeclaredMethod("getDefaultPolicy");
exempt = cls.getDeclaredMethod("getExemptPolicy");
}
catch (NoSuchMethodException ex)
{
System.err.println("Running IcedTea with the original crypto patch.");
System.exit(0);
}
def.setAccessible(true);
exempt.setAccessible(true);
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
Field apField = apCls.getDeclaredField("INSTANCE");
apField.setAccessible(true);
Permission allPerms = (Permission) apField.get(null);
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
{
System.err.println("Running with the unlimited policy.");
System.exit(0);
}
else
{
System.err.println("WARNING: Running with a restricted crypto policy.");
System.exit(-1);
}
}
}
49 changes: 49 additions & 0 deletions linux/jdk/alpine/src/main/packaging/temurin/21/TestECDSA.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* TestECDSA -- Ensure ECDSA signatures are working.
Copyright (C) 2016 Red Hat, Inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;

/**
* @test
*/
public class TestECDSA {

public static void main(String[] args) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
KeyPair key = keyGen.generateKeyPair();

byte[] data = "This is a string to sign".getBytes("UTF-8");

Signature dsa = Signature.getInstance("NONEwithECDSA");
dsa.initSign(key.getPrivate());
dsa.update(data);
byte[] sig = dsa.sign();
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));

Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
dsaCheck.initVerify(key.getPublic());
dsaCheck.update(data);
boolean success = dsaCheck.verify(sig);
if (!success) {
throw new RuntimeException("Test failed. Signature verification error");
}
System.out.println("Test passed.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
temurin-21-jdk (21.0.0.0.0+35) STABLE; urgency=medium

* Eclipse Temurin 21.0.0.0.0+35 release.

-- Eclipse Adoptium Package Maintainers <[email protected]> Wed, 20 Sep 2023 09:00:00 +0000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
Loading
Loading