diff --git a/.gitignore b/.gitignore index d782c87a3..df6d8cea6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,9 @@ Thumbs.db node_modules/ wix/Workdir/ + + +lib/ +bin/ +.venv/ +adoptium_cache.sqlite diff --git a/linux/config/temurin.yml b/linux/config/temurin.yml new file mode 100644 index 000000000..1da6bed51 --- /dev/null +++ b/linux/config/temurin.yml @@ -0,0 +1,17 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +supported_distributions: + Distros: [alpine] + Versions: [8, 11, 17, 21, 22] diff --git a/linux/generate-linux-specs.py b/linux/generate-linux-specs.py new file mode 100644 index 000000000..153ed15e1 --- /dev/null +++ b/linux/generate-linux-specs.py @@ -0,0 +1,110 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os + +import requests +import requests_cache +import yaml +from jinja2 import Environment, FileSystemLoader + +requests_cache.install_cache("adoptium_cache", expire_after=3600) + +# Setup the Jinja2 environment +env = Environment(loader=FileSystemLoader("linux/templates")) + +headers = { + "User-Agent": "Adoptium Linux Specfile Updater", +} + + +def archHelper(arch): + if arch == "x64": + return "x86_64" + else: + return arch + + +# Load the YAML configuration +with open("linux/config/temurin.yml", "r") as file: + config = yaml.safe_load(file) + +for image_type in ["jdk", "jre"]: + # Iterate through supported_distributions + for distro in config["supported_distributions"]["Distros"]: + for version in config["supported_distributions"]["Versions"]: + + # Fetch latest release for version from Adoptium API + url = f"https://api.adoptium.net/v3/assets/feature_releases/{version}/ga?page=0&image_type={image_type}&os=alpine-linux&page_size=1&vendor=eclipse" + response = requests.get(url, headers=headers) + response.raise_for_status() + data = response.json() + + release = response.json()[0] + + # Extract the version number from the release name + openjdk_version = release["release_name"] + + # If version doesn't equal 8, get the more accurate version number + if version != 8: + openjdk_version = release["version_data"]["openjdk_version"] + # if openjdk_version contains -LTS remove it + if "-LTS" in openjdk_version: + openjdk_version = openjdk_version.replace("-LTS", "") + + # Convert version from 11.0.24+8 to 11.0.24_p8 + openjdk_version = openjdk_version.replace("jdk", "") + openjdk_version = openjdk_version.replace("+", "_p") + openjdk_version = openjdk_version.replace("u", ".") + openjdk_version = openjdk_version.replace("-b", ".") + + # Generate the data for each architecture + arch_data = {} + + for binary in release["binaries"]: + arch_data[archHelper(binary["architecture"])] = { + "download_url": binary["package"]["link"], + "checksum": binary["package"]["checksum"], + "filename": binary["package"]["name"], + } + + # Set path to the specfiles + path = f"linux/{image_type}/{distro}/src/main/packaging/temurin/{version}" + + # Check that the path exists + os.makedirs(path, exist_ok=True) + + # Load the template + template = env.get_template(f"{distro}.spec.j2") + + # Render the template + rendered = template.render( + arch_data=arch_data, + openjdk_version=openjdk_version, + release_name=release["release_name"], + version=version, + image_type=image_type, + ) + + # Set filename based on switch distro e.g APKBUILD for alpine, spec for others + match distro: + case "alpine": + filename = "APKBUILD" + case _: + print(f"Unsupported distro: {distro}") + exit(1) + + # Write the rendered template to the file + with open(f"{path}/{filename}", "w") as file: + file.write(rendered) + print(f"Generated {path}/{filename}") diff --git a/linux/jdk/alpine/src/main/packaging/temurin/11/APKBUILD b/linux/jdk/alpine/src/main/packaging/temurin/11/APKBUILD index a91991057..c9ee6e290 100644 --- a/linux/jdk/alpine/src/main/packaging/temurin/11/APKBUILD +++ b/linux/jdk/alpine/src/main/packaging/temurin/11/APKBUILD @@ -1,15 +1,11 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-11 pkgver=11.0.24_p8 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 11" provider_priority=11 url="https://adoptium.net" -arch="noarch" +arch="x86_64" license="GPL-2.0-with-classpath-exception" makedepends=" alsa-lib-dev @@ -25,8 +21,9 @@ makedepends=" " depends="" subpackages="$pkgname-src:_src:noarch - $pkgname-jdk:_jdk:x86_64" -source="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$_pkgvername/OpenJDK11U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz + $pkgname-jdk:_jdk" +source=" + https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_11.0.24_8.tar.gz HelloWorld.java TestECDSA.java @@ -43,7 +40,7 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus/bin" + local _java_bin="./jdk-11.0.24+8/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java @@ -60,7 +57,7 @@ check() { package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-11.0.24+8/* "$pkgdir/$_java_home" } _src() { @@ -94,8 +91,14 @@ _jdk() { "$_toroot/lib/security/cacerts" } +case "$CARCH" in + x86_64) + _arch_sum="ae988c72eeb2d78bb729a3387601ce0ea84305734ebdbe95d276f39952a8e019" + ;; +esac + sha256sums=" -ae988c72eeb2d78bb729a3387601ce0ea84305734ebdbe95d276f39952a8e019 OpenJDK11U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK11U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_11.0.24_8.tar.gz e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java 22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java 9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java diff --git a/linux/jdk/alpine/src/main/packaging/temurin/17/APKBUILD b/linux/jdk/alpine/src/main/packaging/temurin/17/APKBUILD index 5ed59592e..28536e2f1 100644 --- a/linux/jdk/alpine/src/main/packaging/temurin/17/APKBUILD +++ b/linux/jdk/alpine/src/main/packaging/temurin/17/APKBUILD @@ -1,15 +1,11 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-17 pkgver=17.0.12_p7 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 17" provider_priority=17 url="https://adoptium.net" -arch="noarch" +arch="x86_64" license="GPL-2.0-with-classpath-exception" makedepends=" alsa-lib-dev @@ -25,8 +21,9 @@ makedepends=" " depends="" subpackages="$pkgname-src:_src:noarch - $pkgname-jdk:_jdk:x86_64" -source="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-$_pkgvername/OpenJDK17U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz + $pkgname-jdk:_jdk" +source=" + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_17.0.12_7.tar.gz HelloWorld.java TestECDSA.java @@ -43,7 +40,7 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus/bin" + local _java_bin="./jdk-17.0.12+7/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java @@ -60,7 +57,7 @@ check() { package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-17.0.12+7/* "$pkgdir/$_java_home" } _src() { @@ -94,8 +91,14 @@ _jdk() { "$_toroot/lib/security/cacerts" } +case "$CARCH" in + x86_64) + _arch_sum="6d274a292a717a6f8d00a3ed0695497405c5c634c27fec1692dd13784f6ff6fa" + ;; +esac + sha256sums=" -6d274a292a717a6f8d00a3ed0695497405c5c634c27fec1692dd13784f6ff6fa OpenJDK17U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK17U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_17.0.12_7.tar.gz e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java 22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java 9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java diff --git a/linux/jdk/alpine/src/main/packaging/temurin/21/APKBUILD b/linux/jdk/alpine/src/main/packaging/temurin/21/APKBUILD index 9c5f9a077..9fcd1bc60 100644 --- a/linux/jdk/alpine/src/main/packaging/temurin/21/APKBUILD +++ b/linux/jdk/alpine/src/main/packaging/temurin/21/APKBUILD @@ -1,11 +1,7 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-21 pkgver=21.0.4_p7 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 21" provider_priority=21 url="https://adoptium.net" @@ -27,7 +23,7 @@ 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 + https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_21.0.4_7.tar.gz HelloWorld.java TestECDSA.java @@ -44,7 +40,7 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus/bin" + local _java_bin="./jdk-21.0.4+7/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java @@ -61,7 +57,7 @@ check() { package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-21.0.4+7/* "$pkgdir/$_java_home" } _src() { @@ -96,16 +92,16 @@ _jdk() { } case "$CARCH" in - x86_64) - _arch_sum="8fa232fc9de5a861c1a6b0cbdc861d0b0a2bdbdd27da53d991802a460a7f0973" - ;; aarch64) _arch_sum="849c6d5a62a1f3dc2a3d2d7be07ffda089d35b862f6160b2a288c0408c2d8be8" ;; + x86_64) + _arch_sum="8fa232fc9de5a861c1a6b0cbdc861d0b0a2bdbdd27da53d991802a460a7f0973" + ;; esac sha256sums=" -$_arch_sum OpenJDK21u-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK21U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_21.0.4_7.tar.gz e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java 22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java 9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java diff --git a/linux/jdk/alpine/src/main/packaging/temurin/22/APKBUILD b/linux/jdk/alpine/src/main/packaging/temurin/22/APKBUILD index 5464c30a8..c52f735a8 100644 --- a/linux/jdk/alpine/src/main/packaging/temurin/22/APKBUILD +++ b/linux/jdk/alpine/src/main/packaging/temurin/22/APKBUILD @@ -1,11 +1,7 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-22 pkgver=22.0.2_p9 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 22" provider_priority=22 url="https://adoptium.net" @@ -27,7 +23,7 @@ depends="" subpackages="$pkgname-src:_src:noarch $pkgname-jdk:_jdk" source=" - https://github.com/adoptium/temurin22-binaries/releases/download/jdk-$_pkgvername/OpenJDK22u-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz + https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_22.0.2_9.tar.gz HelloWorld.java TestECDSA.java @@ -44,7 +40,7 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus/bin" + local _java_bin="./jdk-22.0.2+9/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java @@ -61,7 +57,7 @@ check() { package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-22.0.2+9/* "$pkgdir/$_java_home" } _src() { @@ -96,16 +92,16 @@ _jdk() { } case "$CARCH" in - x86_64) - _arch_sum="49f73414824b1a7c268a611225fa4d7ce5e25600201e0f1cd59f94d1040b5264" - ;; aarch64) _arch_sum="8ac93a2d5a55aabbc0f7156c2f9032026e87c185689d628ef8a4184b6e9ab006" ;; + x86_64) + _arch_sum="49f73414824b1a7c268a611225fa4d7ce5e25600201e0f1cd59f94d1040b5264" + ;; esac sha256sums=" -$_arch_sum OpenJDK22u-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK22U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_22.0.2_9.tar.gz e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java 22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java 9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java diff --git a/linux/jdk/alpine/src/main/packaging/temurin/8/APKBUILD b/linux/jdk/alpine/src/main/packaging/temurin/8/APKBUILD index b440d3046..8519c8586 100644 --- a/linux/jdk/alpine/src/main/packaging/temurin/8/APKBUILD +++ b/linux/jdk/alpine/src/main/packaging/temurin/8/APKBUILD @@ -1,10 +1,6 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-8-jdk pkgver=8.422.05 -# replace 8. with 8u and .01 with b-01 -_pkgver=${pkgver/8./8u} -_pkgver=${_pkgver%.*}b${_pkgver#*.} -_pkgvername=${_pkgver%b*}-b${_pkgver#*b} pkgrel=0 pkgdesc="Eclipse Temurin 8 (JDK)" provider_priority=8 @@ -16,8 +12,8 @@ makedepends=" libpng-dev libxcomposite-dev libxinerama-dev - libxrender-dev libxslt + libxrender-dev libxt-dev libxtst-dev " @@ -26,9 +22,11 @@ depends=" java-cacerts ttf-dejavu " -source="https://github.com/adoptium/temurin8-binaries/releases/download/jdk$_pkgvername/OpenJDK8U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz +source=" + https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_8u422b05.tar.gz HelloWorld.java + " _java_home="/usr/lib/jvm/java-8-temurin" @@ -43,12 +41,13 @@ prepare() { } check() { - local _java_bin="./jdk$_pkgvername/bin" + local _java_bin="./jdk8u422-b05/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java $_java_bin/java HelloWorld + # 2) check that java -version and javac -version work $_java_bin/java -version $_java_bin/javac -version @@ -57,16 +56,24 @@ check() { package() { provides=java-jdk mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk"$_pkgvername"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk8u422-b05/* "$pkgdir/$_java_home" rm "$pkgdir"/$_java_home/src.zip - + # symlink to shared java cacerts store rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts ln -sf /etc/ssl/certs/java/cacerts \ "$pkgdir"/$_java_home/jre/lib/security/cacerts } + + +case "$CARCH" in + x86_64) + _arch_sum="525a7731331cad502b9293ccb4ac2b13e85516736e98a57cb27c2767005188e1" + ;; +esac + sha256sums=" -525a7731331cad502b9293ccb4ac2b13e85516736e98a57cb27c2767005188e1 OpenJDK8U-jdk_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK8U-jdk_${CARCH/x86_64/x64}_alpine-linux_hotspot_8u422b05.tar.gz e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java " diff --git a/linux/jre/alpine/src/main/packaging/temurin/11/APKBUILD b/linux/jre/alpine/src/main/packaging/temurin/11/APKBUILD index 50a775879..dd35ed0a8 100644 --- a/linux/jre/alpine/src/main/packaging/temurin/11/APKBUILD +++ b/linux/jre/alpine/src/main/packaging/temurin/11/APKBUILD @@ -1,15 +1,11 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-11 pkgver=11.0.24_p8 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 11" provider_priority=11 url="https://adoptium.net" -arch="noarch" +arch="x86_64" license="GPL-2.0-with-classpath-exception" makedepends=" alsa-lib-dev @@ -24,8 +20,9 @@ makedepends=" libxtst-dev " depends="" -subpackages="$pkgname-jre:_jre:x86_64" -source="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$_pkgvername/OpenJDK11U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +subpackages="$pkgname-jre:_jre" +source=" + https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_11.0.24_8.tar.gz " _java_home="/usr/lib/jvm/java-11-temurin-jre" @@ -38,17 +35,20 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus-jre/bin" + local _java_bin="./jdk-11.0.24+8-jre/bin" + # 1) check that java -version works $_java_bin/java -version } package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus-jre"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-11.0.24+8-jre/* "$pkgdir/$_java_home" } + + _jre() { pkgdesc="Eclipse Temurin 11 (JRE)" provides="java-jre" @@ -71,6 +71,12 @@ _jre() { "$_toroot/lib/security/cacerts" } +case "$CARCH" in + x86_64) + _arch_sum="0ac795729cc11f47323a71713eac2a5b22d4615fd9b66c8766f964c03fb6e160" + ;; +esac + sha256sums=" -0ac795729cc11f47323a71713eac2a5b22d4615fd9b66c8766f964c03fb6e160 OpenJDK11U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK11U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_11.0.24_8.tar.gz " diff --git a/linux/jre/alpine/src/main/packaging/temurin/17/APKBUILD b/linux/jre/alpine/src/main/packaging/temurin/17/APKBUILD index f64cdc5c6..cbcd30ba0 100644 --- a/linux/jre/alpine/src/main/packaging/temurin/17/APKBUILD +++ b/linux/jre/alpine/src/main/packaging/temurin/17/APKBUILD @@ -1,15 +1,11 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-17 pkgver=17.0.12_p7 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 17" provider_priority=17 url="https://adoptium.net" -arch="noarch" +arch="x86_64" license="GPL-2.0-with-classpath-exception" makedepends=" alsa-lib-dev @@ -24,8 +20,9 @@ makedepends=" libxtst-dev " depends="" -subpackages="$pkgname-jre:_jre:x86_64" -source="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-$_pkgvername/OpenJDK17U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +subpackages="$pkgname-jre:_jre" +source=" + https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_17.0.12_7.tar.gz " _java_home="/usr/lib/jvm/java-17-temurin-jre" @@ -38,17 +35,20 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus-jre/bin" + local _java_bin="./jdk-17.0.12+7-jre/bin" + # 1) check that java -version works $_java_bin/java -version } package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus-jre"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-17.0.12+7-jre/* "$pkgdir/$_java_home" } + + _jre() { pkgdesc="Eclipse Temurin 17 (JRE)" provides="java-jre" @@ -61,6 +61,7 @@ _jre() { mv "$_fromroot/conf" "$_toroot" mv "$_fromroot/legal" "$_toroot" mv "$_fromroot/lib" "$_toroot" + mv "$_fromroot/man" "$_toroot" mv "$_fromroot/release" "$_toroot" mv "$_fromroot/NOTICE" "$_toroot" @@ -70,6 +71,12 @@ _jre() { "$_toroot/lib/security/cacerts" } +case "$CARCH" in + x86_64) + _arch_sum="63bae276cc322532b451ae7473127c92a75db16cc95473577f133cd09349822a" + ;; +esac + sha256sums=" -63bae276cc322532b451ae7473127c92a75db16cc95473577f133cd09349822a OpenJDK17U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK17U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_17.0.12_7.tar.gz " diff --git a/linux/jre/alpine/src/main/packaging/temurin/21/APKBUILD b/linux/jre/alpine/src/main/packaging/temurin/21/APKBUILD index ce61b65a7..f7414943e 100644 --- a/linux/jre/alpine/src/main/packaging/temurin/21/APKBUILD +++ b/linux/jre/alpine/src/main/packaging/temurin/21/APKBUILD @@ -1,11 +1,7 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-21 pkgver=21.0.4_p7 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 21" provider_priority=21 url="https://adoptium.net" @@ -25,7 +21,9 @@ makedepends=" " depends="" subpackages="$pkgname-jre:_jre" -source="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-$_pkgvername/OpenJDK21u-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz" +source=" + https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_21.0.4_7.tar.gz +" _java_home="/usr/lib/jvm/java-21-temurin-jre" @@ -37,17 +35,20 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus-jre/bin" + local _java_bin="./jdk-21.0.4+7-jre/bin" + # 1) check that java -version works $_java_bin/java -version } package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus-jre"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-21.0.4+7-jre/* "$pkgdir/$_java_home" } + + _jre() { pkgdesc="Eclipse Temurin 21 (JRE)" provides="java-jre" @@ -60,6 +61,7 @@ _jre() { mv "$_fromroot/conf" "$_toroot" mv "$_fromroot/legal" "$_toroot" mv "$_fromroot/lib" "$_toroot" + mv "$_fromroot/man" "$_toroot" mv "$_fromroot/release" "$_toroot" mv "$_fromroot/NOTICE" "$_toroot" @@ -70,14 +72,14 @@ _jre() { } case "$CARCH" in - x86_64) - _arch_sum="0dfd0ebab44d777f65bceaff7f79e8e0b9deb74a5eb166922483f1864bcf2052" - ;; aarch64) _arch_sum="f9410264235861deaf30f97bec80870cf3bc38b1d8e57d897d8bb1f706ae6705" ;; + x86_64) + _arch_sum="0dfd0ebab44d777f65bceaff7f79e8e0b9deb74a5eb166922483f1864bcf2052" + ;; esac sha256sums=" -$_arch_sum OpenJDK21u-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK21U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_21.0.4_7.tar.gz " diff --git a/linux/jre/alpine/src/main/packaging/temurin/22/APKBUILD b/linux/jre/alpine/src/main/packaging/temurin/22/APKBUILD index f9b298ea1..aac826594 100644 --- a/linux/jre/alpine/src/main/packaging/temurin/22/APKBUILD +++ b/linux/jre/alpine/src/main/packaging/temurin/22/APKBUILD @@ -1,11 +1,7 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-22 pkgver=22.0.2_p9 -# replace _p1 with _1 -_pkgver=${pkgver/_p/_} -_pkgverplus=${pkgver/_p/+} -_pkgvername=${_pkgverplus/+/%2B} -pkgrel=1 +pkgrel=0 pkgdesc="Eclipse Temurin 22" provider_priority=22 url="https://adoptium.net" @@ -25,7 +21,9 @@ makedepends=" " depends="" subpackages="$pkgname-jre:_jre" -source="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-$_pkgvername/OpenJDK22u-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz" +source=" + https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_22.0.2_9.tar.gz +" _java_home="/usr/lib/jvm/java-22-temurin-jre" @@ -37,17 +35,20 @@ prepare() { } check() { - local _java_bin="./jdk-$_pkgverplus-jre/bin" + local _java_bin="./jdk-22.0.2+9-jre/bin" + # 1) check that java -version works $_java_bin/java -version } package() { mkdir -p "$pkgdir/$_java_home" - cp -r "$srcdir"/jdk-"$_pkgverplus-jre"/* "$pkgdir/$_java_home" + cp -r "$srcdir"/jdk-22.0.2+9-jre/* "$pkgdir/$_java_home" } + + _jre() { pkgdesc="Eclipse Temurin 22 (JRE)" provides="java-jre" @@ -60,6 +61,7 @@ _jre() { mv "$_fromroot/conf" "$_toroot" mv "$_fromroot/legal" "$_toroot" mv "$_fromroot/lib" "$_toroot" + mv "$_fromroot/man" "$_toroot" mv "$_fromroot/release" "$_toroot" mv "$_fromroot/NOTICE" "$_toroot" @@ -70,14 +72,14 @@ _jre() { } case "$CARCH" in - x86_64) - _arch_sum="459342f5210cfd185aeed05abdc052fcd61cf6ff066541919b786236d69c5737" - ;; aarch64) _arch_sum="749e7372a7dba0de632592fe55a0e387d96922c84dcdc039e0efc1f7ecfcd70e" ;; + x86_64) + _arch_sum="459342f5210cfd185aeed05abdc052fcd61cf6ff066541919b786236d69c5737" + ;; esac sha256sums=" -$_arch_sum OpenJDK22u-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK22U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_22.0.2_9.tar.gz " diff --git a/linux/jre/alpine/src/main/packaging/temurin/8/APKBUILD b/linux/jre/alpine/src/main/packaging/temurin/8/APKBUILD index 22fbcca9e..05ed39ae9 100644 --- a/linux/jre/alpine/src/main/packaging/temurin/8/APKBUILD +++ b/linux/jre/alpine/src/main/packaging/temurin/8/APKBUILD @@ -1,10 +1,6 @@ # Maintainer: Eclipse Adoptium Package Maintainers pkgname=temurin-8-jre pkgver=8.422.05 -# replace 8. with 8u and .01 with b-01 -_pkgver=${pkgver/8./8u} -_pkgver=${_pkgver%.*}b${_pkgver#*.} -_pkgvername=${_pkgver%b*}-b${_pkgver#*b} pkgrel=0 pkgdesc="Eclipse Temurin 8 (JRE)" provider_priority=8 @@ -16,8 +12,8 @@ makedepends=" libpng-dev libxcomposite-dev libxinerama-dev - libxrender-dev libxslt + libxrender-dev libxt-dev libxtst-dev " @@ -26,7 +22,8 @@ depends=" java-cacerts ttf-dejavu " -source="https://github.com/adoptium/temurin8-binaries/releases/download/jdk$_pkgvername/OpenJDK8U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +source=" + https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_8u422b05.tar.gz " _java_home="/usr/lib/jvm/java-8-temurin-jre" @@ -41,8 +38,9 @@ prepare() { } check() { - local _java_bin="./jdk$_pkgvername-jre/bin" + local _java_bin="./jdk8u422-b05-jre/bin" + # 1) check that java -version works $_java_bin/java -version } @@ -50,15 +48,22 @@ check() { package() { provides=java-jre mkdir -p "$pkgdir/$_java_home" -ls ${srcdir} - cp -r "$srcdir"/jdk"$_pkgvername-jre"/* "$pkgdir/$_java_home" - + cp -r "$srcdir"/jdk8u422-b05-jre/* "$pkgdir/$_java_home" + # symlink to shared java cacerts store rm -f "$pkgdir"/$_java_home/lib/security/cacerts ln -sf /etc/ssl/certs/java/cacerts \ "$pkgdir"/$_java_home/lib/security/cacerts } + + +case "$CARCH" in + x86_64) + _arch_sum="9a7a939638b9cdaa8e1a119b8f21bfdd4cb2390b8a47cc27ccf9effc90f4b437" + ;; +esac + sha256sums=" -9a7a939638b9cdaa8e1a119b8f21bfdd4cb2390b8a47cc27ccf9effc90f4b437 OpenJDK8U-jre_x64_alpine-linux_hotspot_$_pkgver.tar.gz +$_arch_sum OpenJDK8U-jre_${CARCH/x86_64/x64}_alpine-linux_hotspot_8u422b05.tar.gz " diff --git a/linux/templates/alpine.spec.j2 b/linux/templates/alpine.spec.j2 new file mode 100644 index 000000000..f2cf35b73 --- /dev/null +++ b/linux/templates/alpine.spec.j2 @@ -0,0 +1,182 @@ +# Maintainer: Eclipse Adoptium Package Maintainers +pkgname=temurin-{{ version }}{% if image_type == 'jre' and version|int == 8 %}-jre{% elif image_type == 'jdk' and version|int == 8 %}-jdk{% endif %} +pkgver={{ openjdk_version }} +pkgrel=0 +pkgdesc="Eclipse Temurin {{ version }}{% if version|int == 8 %} ({{ image_type | upper }}){% endif %}" +provider_priority={{ version }} +url="https://adoptium.net" +arch="{% if version != '8' %}{{ arch_data.keys() | join(' ') }}{% endif %}" +license="GPL-2.0-with-classpath-exception" +makedepends=" + alsa-lib-dev + {%- if version|int == 8 %} + libpng-dev + libxcomposite-dev + libxinerama-dev + libxslt + {%- else %} + freetype-dev + libffi-dev + libjpeg-turbo-dev + libx11-dev + libxext-dev + libxrandr-dev + {%- endif %} + libxrender-dev + libxt-dev + libxtst-dev +" +{% if version|int == 8 -%} +depends=" + java-common + java-cacerts + ttf-dejavu +" +{%- else -%} +depends="" +subpackages=" +{%- if image_type == 'jdk' -%} +$pkgname-src:_src:noarch + $pkgname-jdk:_jdk" +{%- else -%} +$pkgname-jre:_jre" +{%- endif %} +{%- endif %} +source=" + {{ arch_data['x86_64']['download_url'] | replace("x64", "${CARCH/x86_64/x64}") }} + {%- if image_type == 'jdk' %} + + HelloWorld.java + {% if version|int >= 11 -%} + TestECDSA.java + TestCryptoLevel.java + {%- endif %} + {%- endif %} +" + +_java_home="/usr/lib/jvm/java-{{ version }}-temurin{% if image_type == 'jre' %}-jre{% endif %}" + +{% if version|int == 8 -%} +# Exclude xawt from ldpath to avoid duplicate provides for libmawt.so +# (also in headless). in future this should be a virtual provides. +ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli" +{%- elif version|int == 11 -%} +ldpath="$_java_home/lib:$_java_home/lib/jli:$_java_home/lib/server" +{%- else -%} +ldpath="$_java_home/lib:$_java_home/lib/server" +{%- endif %} +sonameprefix="$pkgname:" + +prepare() { + default_prepare +} + +check() { + {%- if version|int == 8 %} + local _java_bin="./{{ release_name }}{{ '-jre' if image_type == 'jre' }}/bin" + {%- else %} + local _java_bin="./jdk-{{ openjdk_version | replace("_p", "+") }}{{ '-jre' if image_type == 'jre' }}/bin" + {%- endif %} + + {% if image_type == 'jdk' -%} + # 1) compile and run a simple hello world + $_java_bin/javac -d . "$srcdir"/HelloWorld.java + $_java_bin/java HelloWorld + + {% if version|int >= 11 -%} + # 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 + {%- else %} + # 2) check that java -version and javac -version work + $_java_bin/java -version + $_java_bin/javac -version + {%- endif %} + {%- else %} + # 1) check that java -version works + $_java_bin/java -version + {%- endif %} +} + +package() { + {%- if version|int == 8 %} + provides=java-{{ image_type }} + {%- endif %} + mkdir -p "$pkgdir/$_java_home" + {% if version|int == 8 -%} + cp -r "$srcdir"/{{ release_name }}{{ '-jre' if image_type == 'jre' }}/* "$pkgdir/$_java_home" + {%- if image_type == 'jdk' %} + rm "$pkgdir"/$_java_home/src.zip + {%- endif %} + {% else -%} + cp -r "$srcdir"/jdk-{{ openjdk_version | replace("_p", "+") }}{{ '-jre' if image_type == 'jre' }}/* "$pkgdir/$_java_home" + {%- endif %} + + {%- if version|int == 8 %} + # symlink to shared java cacerts store + rm -f "$pkgdir"/$_java_home/{{ 'jre/' if image_type == 'jdk' }}lib/security/cacerts + ln -sf /etc/ssl/certs/java/cacerts \ + "$pkgdir"/$_java_home/{{ 'jre/' if image_type == 'jdk' }}lib/security/cacerts + {%- endif %} +} + +{% if version|int >= 11 -%} +{% if image_type == 'jdk' -%} +_src() { + pkgdesc="Eclipse Temurin {{ version }} (sources)" + mkdir -p "$subpkgdir/$_java_home"/lib + mv "$pkgdir"/$_java_home/lib/src.zip \ + "$subpkgdir"/$_java_home/lib/ +} +{%- endif %} + +_{{ image_type }}() { + pkgdesc="Eclipse Temurin {{ version }} ({{ image_type | upper }})" + provides="{{ 'java-jdk ' if image_type == '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" + {%- if image_type == 'jdk' %} + mv "$_fromroot/include" "$_toroot" + mv "$_fromroot/jmods" "$_toroot" + {%- endif %} + 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" +} +{%- endif %} + +case "$CARCH" in + {%- for architecture, details in arch_data.items() %} + {{ architecture }}) + _arch_sum="{{ details.checksum }}" + ;; + {%- endfor %} +esac + +sha256sums=" +$_arch_sum {{ arch_data['x86_64']['filename'] | replace("x64", "${CARCH/x86_64/x64}") }} +{%- if image_type == 'jdk' %} +e9185736dde99a4dc570a645a20407bdb41c1f48dfc34d9c3eb246cf0435a378 HelloWorld.java +{%- if version|int >= 11 %} +22d2ff9757549ebc64e09afd3423f84b5690dcf972cd6535211c07c66d38fab0 TestCryptoLevel.java +9fb00c7b0220de8f3ee2aa398459a37d119f43fd63321530a00b3bb9217dd933 TestECDSA.java +{%- endif %} +{%- endif %} +" +