Skip to content

Commit 5677499

Browse files
authored
Add JDK25 Linux Installer Templates (#1240)
1 parent 42a88f9 commit 5677499

File tree

26 files changed

+1586
-5
lines changed

26 files changed

+1586
-5
lines changed

linux_new/Jenkinsfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ pipeline {
411411
}
412412

413413
// Construct the Filename
414-
def filennameFinal =""
414+
def filenameFinal =""
415415
def filenamePrefix = "Open"
416416
def filenameSuffix = "tar.gz"
417417
def filenameVersion = params.VERSION.toUpperCase() + "U"
@@ -988,10 +988,10 @@ post {
988988
echo "FileName : ${ArchiveFileName}"
989989

990990
if (!params.SKIP_SRC) {
991-
build job: 'publish_linux_pkg_src', parameters: [
992-
string(name: 'TAG', value: params.TAG),
993-
string(name: 'FILENAME', value: ArchiveFileName)
994-
]
991+
build job: 'publish_linux_pkg_src', parameters: [
992+
string(name: 'TAG', value: params.TAG),
993+
string(name: 'FILENAME', value: ArchiveFileName)
994+
]
995995
} else {
996996
echo 'SKIP_SRC parameter is set, skipping publish.'
997997
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class HelloWorld {
2+
public static void main(String[] args) { System.out.println("Hello World!"); }
3+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* TestCryptoLevel -- Ensure unlimited crypto policy is in use.
2+
Copyright (C) 2012 Red Hat, Inc.
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
import java.lang.reflect.Field;
19+
import java.lang.reflect.Method;
20+
import java.lang.reflect.InvocationTargetException;
21+
22+
import java.security.Permission;
23+
import java.security.PermissionCollection;
24+
25+
public class TestCryptoLevel
26+
{
27+
public static void main(String[] args)
28+
throws NoSuchFieldException, ClassNotFoundException,
29+
IllegalAccessException, InvocationTargetException
30+
{
31+
Class<?> cls = null;
32+
Method def = null, exempt = null;
33+
34+
try
35+
{
36+
cls = Class.forName("javax.crypto.JceSecurity");
37+
}
38+
catch (ClassNotFoundException ex)
39+
{
40+
System.err.println("Running a non-Sun JDK.");
41+
System.exit(0);
42+
}
43+
try
44+
{
45+
def = cls.getDeclaredMethod("getDefaultPolicy");
46+
exempt = cls.getDeclaredMethod("getExemptPolicy");
47+
}
48+
catch (NoSuchMethodException ex)
49+
{
50+
System.err.println("Running IcedTea with the original crypto patch.");
51+
System.exit(0);
52+
}
53+
def.setAccessible(true);
54+
exempt.setAccessible(true);
55+
PermissionCollection defPerms = (PermissionCollection) def.invoke(null);
56+
PermissionCollection exemptPerms = (PermissionCollection) exempt.invoke(null);
57+
Class<?> apCls = Class.forName("javax.crypto.CryptoAllPermission");
58+
Field apField = apCls.getDeclaredField("INSTANCE");
59+
apField.setAccessible(true);
60+
Permission allPerms = (Permission) apField.get(null);
61+
if (defPerms.implies(allPerms) && (exemptPerms == null || exemptPerms.implies(allPerms)))
62+
{
63+
System.err.println("Running with the unlimited policy.");
64+
System.exit(0);
65+
}
66+
else
67+
{
68+
System.err.println("WARNING: Running with a restricted crypto policy.");
69+
System.exit(-1);
70+
}
71+
}
72+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* TestECDSA -- Ensure ECDSA signatures are working.
2+
Copyright (C) 2016 Red Hat, Inc.
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
import java.math.BigInteger;
19+
import java.security.KeyPair;
20+
import java.security.KeyPairGenerator;
21+
import java.security.Signature;
22+
23+
/**
24+
* @test
25+
*/
26+
public class TestECDSA {
27+
28+
public static void main(String[] args) throws Exception {
29+
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
30+
KeyPair key = keyGen.generateKeyPair();
31+
32+
byte[] data = "This is a string to sign".getBytes("UTF-8");
33+
34+
Signature dsa = Signature.getInstance("NONEwithECDSA");
35+
dsa.initSign(key.getPrivate());
36+
dsa.update(data);
37+
byte[] sig = dsa.sign();
38+
System.out.println("Signature: " + new BigInteger(1, sig).toString(16));
39+
40+
Signature dsaCheck = Signature.getInstance("NONEwithECDSA");
41+
dsaCheck.initVerify(key.getPublic());
42+
dsaCheck.update(data);
43+
boolean success = dsaCheck.verify(sig);
44+
if (!success) {
45+
throw new RuntimeException("Test failed. Signature verification error");
46+
}
47+
System.out.println("Test passed.");
48+
}
49+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Maintainer: Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org>
2+
pkgname=temurin-25
3+
pkgver={{ package_version }}
4+
# replace _p1 with _1
5+
_pkgver=${pkgver/_p/_}
6+
_pkgverplus=${pkgver/_p/+}
7+
_pkgvername=${_pkgverplus/+/%2B}
8+
pkgrel={{ package_release_version }}
9+
pkgdesc="Eclipse Temurin 25"
10+
provider_priority=25
11+
url="https://adoptium.net"
12+
arch="{{ hardware_architecture }}"
13+
license="GPL-2.0-with-classpath-exception"
14+
makedepends="
15+
alsa-lib-dev
16+
freetype-dev
17+
libffi-dev
18+
libjpeg-turbo-dev
19+
libx11-dev
20+
libxext-dev
21+
libxrandr-dev
22+
libxrender-dev
23+
libxt-dev
24+
libxtst-dev
25+
"
26+
depends=""
27+
subpackages="$pkgname-src:_src:noarch
28+
$pkgname-jdk:_jdk"
29+
source="{{ package_url }}
30+
31+
HelloWorld.java
32+
TestECDSA.java
33+
TestCryptoLevel.java
34+
"
35+
36+
_java_home="/usr/lib/jvm/java-25-temurin"
37+
38+
ldpath="$_java_home/lib:$_java_home/lib/server"
39+
sonameprefix="$pkgname:"
40+
41+
prepare() {
42+
default_prepare
43+
}
44+
45+
check() {
46+
local _java_bin="./jdk-$_pkgverplus/bin"
47+
48+
# 1) compile and run a simple hello world
49+
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
50+
$_java_bin/java HelloWorld
51+
52+
# 2) compile and run a testcase for unlimited policy
53+
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
54+
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
55+
56+
# 3) compile and run a testcase for ECDSA signatures
57+
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
58+
$_java_bin/java TestECDSA
59+
}
60+
61+
package() {
62+
mkdir -p "$pkgdir/$_java_home"
63+
cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home"
64+
}
65+
66+
_src() {
67+
pkgdesc="Eclipse Temurin 25 (sources)"
68+
mkdir -p "$subpkgdir/$_java_home"/lib
69+
mv "$pkgdir"/$_java_home/lib/src.zip \
70+
"$subpkgdir"/$_java_home/lib/
71+
}
72+
73+
_jdk() {
74+
pkgdesc="Eclipse Temurin 25 (JDK)"
75+
provides="java-jdk java-jre"
76+
depends="java-common java-cacerts"
77+
_fromroot="$pkgdir/$_java_home"
78+
_toroot="$subpkgdir/$_java_home"
79+
80+
mkdir -p "$_toroot"
81+
mv "$_fromroot/bin" "$_toroot"
82+
mv "$_fromroot/conf" "$_toroot"
83+
mv "$_fromroot/include" "$_toroot"
84+
mv "$_fromroot/legal" "$_toroot"
85+
mv "$_fromroot/lib" "$_toroot"
86+
mv "$_fromroot/release" "$_toroot"
87+
mv "$_fromroot/NOTICE" "$_toroot"
88+
89+
# symlink to shared cacerts store
90+
rm "$_toroot/lib/security/cacerts"
91+
ln -sf /etc/ssl/certs/java/cacerts \
92+
"$_toroot/lib/security/cacerts"
93+
}
94+
95+
sha256sums="
96+
{{ package_checksum }} {{ package_name }}
97+
e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java
98+
22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java
99+
9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java
100+
"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
temurin-25-jdk ({{ package_version }}-{{ package_release_version }}) STABLE; urgency=medium
2+
3+
* Eclipse Temurin {{ package_version }}-{{ package_release_version }} release.
4+
5+
-- Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org> {{ current_date }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
Source: temurin-25-jdk
2+
Section: java
3+
Priority: optional
4+
Maintainer: Eclipse Adoptium Package Maintainers <temurin-dev@eclipse.org>
5+
Build-Depends: debhelper (>= 11), lsb-release
6+
7+
Package: temurin-25-jdk
8+
Architecture: {{ hardware_architecture }}
9+
Depends: adoptium-ca-certificates,
10+
java-common,
11+
libasound2,
12+
libc6,
13+
libx11-6,
14+
libfontconfig1,
15+
libfreetype6,
16+
libxext6,
17+
libxi6,
18+
libxrender1,
19+
libxtst6,
20+
zlib1g
21+
Recommends: fonts-dejavu-core,
22+
fonts-dejavu-extra
23+
Provides: java-compiler,
24+
java-sdk,
25+
java-sdk-headless,
26+
java10-sdk,
27+
java11-sdk,
28+
java12-sdk,
29+
java13-sdk,
30+
java14-sdk,
31+
java15-sdk,
32+
java16-sdk,
33+
java17-sdk,
34+
java18-sdk,
35+
java19-sdk,
36+
java2-sdk,
37+
java20-sdk,
38+
java21-sdk,
39+
java22-sdk,
40+
java23-sdk,
41+
java24-sdk,
42+
java25-sdk,
43+
java5-sdk,
44+
java6-sdk,
45+
java7-sdk,
46+
java8-sdk,
47+
java9-sdk,
48+
java10-sdk-headless,
49+
java11-sdk-headless,
50+
java12-sdk-headless,
51+
java13-sdk-headless,
52+
java14-sdk-headless,
53+
java15-sdk-headless,
54+
java16-sdk-headless,
55+
java17-sdk-headless,
56+
java18-sdk-headless,
57+
java19-sdk-headless,
58+
java2-sdk-headless,
59+
java20-sdk-headless,
60+
java21-sdk-headless,
61+
java22-sdk-headless,
62+
java23-sdk-headless,
63+
java24-sdk-headless,
64+
java25-sdk-headless,
65+
java5-sdk-headless,
66+
java6-sdk-headless,
67+
java7-sdk-headless,
68+
java8-sdk-headless,
69+
java9-sdk-headless,
70+
java-runtime (= 25),
71+
java-runtime-headless (= 25),
72+
java10-runtime,
73+
java11-runtime,
74+
java12-runtime,
75+
java13-runtime,
76+
java14-runtime,
77+
java15-runtime,
78+
java16-runtime,
79+
java17-runtime,
80+
java18-runtime,
81+
java19-runtime,
82+
java2-runtime,
83+
java20-runtime,
84+
java21-runtime,
85+
java22-runtime,
86+
java23-runtime,
87+
java24-runtime,
88+
java25-runtime,
89+
java5-runtime,
90+
java6-runtime,
91+
java7-runtime,
92+
java8-runtime,
93+
java9-runtime,
94+
java10-runtime-headless,
95+
java11-runtime-headless,
96+
java12-runtime-headless,
97+
java13-runtime-headless,
98+
java14-runtime-headless,
99+
java15-runtime-headless,
100+
java16-runtime-headless,
101+
java17-runtime-headless,
102+
java18-runtime-headless,
103+
java19-runtime-headless,
104+
java2-runtime-headless,
105+
java20-runtime-headless,
106+
java21-runtime-headless,
107+
java22-runtime-headless,
108+
java23-runtime-headless,
109+
java24-runtime-headless,
110+
java25-runtime-headless,
111+
java5-runtime-headless,
112+
java6-runtime-headless,
113+
java7-runtime-headless,
114+
java8-runtime-headless,
115+
java9-runtime-headless
116+
Description: Eclipse Temurin 25 JDK
117+
Eclipse Temurin JDK is an OpenJDK-based development environment to create
118+
applications and components using the programming language Java.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
3+
Files: *
4+
Copyright: Oracle and/or its affiliates
5+
License: GPL-2.0+CE

0 commit comments

Comments
 (0)