Initial commit

jdk-temurin replaces jdk-adoptopenjdk. Apart from the name and the
corresponding install location, change the naming scheme of the conf dir
to match that of Arch's java packages.
This commit is contained in:
Michael Laß 2021-11-08 21:22:12 +01:00
commit db458c2614
6 changed files with 238 additions and 0 deletions

57
.SRCINFO Normal file
View File

@ -0,0 +1,57 @@
pkgbase = jdk-temurin
pkgdesc = Temurin (OpenJDK 17 Java binaries by Adoptium, formerly AdoptOpenJDK)
pkgver = 17.0.1.u12
pkgrel = 1
url = https://adoptium.net/
install = install_jdk-temurin.sh
arch = x86_64
license = custom
depends = java-runtime-common>=3
depends = java-environment-common
depends = ca-certificates-utils
depends = desktop-file-utils
depends = libxrender
depends = libxtst
depends = alsa-lib
optdepends = gtk2: for the Gtk+ 2 look and feel
optdepends = gtk3: for the Gtk+ 3 look and feel
provides = java-runtime-headless=17
provides = java-runtime-headless-openjdk=17
provides = jre17-openjdk-headless=17.0.1.u12
provides = jre-openjdk-headless=17.0.1.u12
provides = java-runtime=17
provides = java-runtime-openjdk=17
provides = jre17-openjdk=17.0.1.u12
provides = jre-openjdk=17.0.1.u12
provides = java-environment=17
provides = java-environment-openjdk=17
provides = jdk17-openjdk=17.0.1.u12
provides = jdk-openjdk=17.0.1.u12
provides = openjdk17-src=17.0.1.u12
provides = openjdk-src=17.0.1.u12
replaces = jdk-adoptopenjdk
backup = etc/java-temurin/logging.properties
backup = etc/java-temurin/management/jmxremote.access
backup = etc/java-temurin/management/jmxremote.password.template
backup = etc/java-temurin/management/management.properties
backup = etc/java-temurin/net.properties
backup = etc/java-temurin/sdp/sdp.conf.template
backup = etc/java-temurin/security/java.policy
backup = etc/java-temurin/security/java.security
backup = etc/java-temurin/security/policy/limited/default_local.policy
backup = etc/java-temurin/security/policy/limited/default_US_export.policy
backup = etc/java-temurin/security/policy/limited/exempt_local.policy
backup = etc/java-temurin/security/policy/README.txt
backup = etc/java-temurin/security/policy/unlimited/default_local.policy
backup = etc/java-temurin/security/policy/unlimited/default_US_export.policy
backup = etc/java-temurin/sound.properties
source = https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
source = freedesktop-java.desktop
source = freedesktop-jconsole.desktop
source = freedesktop-jshell.desktop
sha256sums = 6ea18c276dcbb8522feeebcfc3a4b5cb7c7e7368ba8590d3326c6c3efc5448b6
sha256sums = ae076317d93a389cc0c893fd9ec6769ae860c2cc01f8c8bed3f4ee476c73e625
sha256sums = dc278160ca7df32bcfab0a5420c09eaf6f4602d30f57b6c5bedb0f60062c5228
sha256sums = d0913ae3b9f469f8567432b0867222d66f50008c313f5a0882d15994ba19ec01
pkgname = jdk-temurin

106
PKGBUILD Normal file
View File

@ -0,0 +1,106 @@
# Maintainer: Michael Lass <bevan@bi-co.net>
# This PKGBUILD heavily borrows from java-openjdk in [extra] maintained by:
# Levente Polyak <anthraxx[at]archlinux[dot]org>
# Guillaume ALAUX <guillaume@archlinux.org>
# This PKGBUILD is maintained on github:
# https://github.com/michaellass/AUR
_majorver=17
_completever=17.0.1
_updatever=12
pkgrel=1
pkgver=${_completever}.u${_updatever}
_tag_ver=${_completever}+${_updatever}
[ $_majorver != $_completever ] && _versuffix=U
pkgname=jdk-temurin
pkgdesc="Temurin (OpenJDK ${_majorver} Java binaries by Adoptium, formerly AdoptOpenJDK)"
arch=('x86_64')
url='https://adoptium.net/'
license=('custom')
depends=('java-runtime-common>=3' 'java-environment-common' 'ca-certificates-utils' 'desktop-file-utils' 'libxrender' 'libxtst' 'alsa-lib')
optdepends=('gtk2: for the Gtk+ 2 look and feel'
'gtk3: for the Gtk+ 3 look and feel')
provides=("java-runtime-headless=${_majorver}"
"java-runtime-headless-openjdk=${_majorver}"
"jre${_majorver}-openjdk-headless=${pkgver}"
"jre-openjdk-headless=${pkgver}"
"java-runtime=${_majorver}"
"java-runtime-openjdk=${_majorver}"
"jre${_majorver}-openjdk=${pkgver}"
"jre-openjdk=${pkgver}"
"java-environment=${_majorver}"
"java-environment-openjdk=${_majorver}"
"jdk${_majorver}-openjdk=${pkgver}"
"jdk-openjdk=${pkgver}"
"openjdk${_majorver}-src=${pkgver}"
"openjdk-src=${pkgver}")
replaces=("jdk-adoptopenjdk")
backup=(etc/java-temurin/logging.properties
etc/java-temurin/management/jmxremote.access
etc/java-temurin/management/jmxremote.password.template
etc/java-temurin/management/management.properties
etc/java-temurin/net.properties
etc/java-temurin/sdp/sdp.conf.template
etc/java-temurin/security/java.policy
etc/java-temurin/security/java.security
etc/java-temurin/security/policy/limited/default_local.policy
etc/java-temurin/security/policy/limited/default_US_export.policy
etc/java-temurin/security/policy/limited/exempt_local.policy
etc/java-temurin/security/policy/README.txt
etc/java-temurin/security/policy/unlimited/default_local.policy
etc/java-temurin/security/policy/unlimited/default_US_export.policy
etc/java-temurin/sound.properties)
install=install_jdk-temurin.sh
source=(https://github.com/adoptium/temurin${_majorver}-binaries/releases/download/jdk-${_tag_ver/+/%2B}/OpenJDK${_majorver}${_versuffix}-jdk_x64_linux_hotspot_${_tag_ver/+/_}.tar.gz
freedesktop-java.desktop
freedesktop-jconsole.desktop
freedesktop-jshell.desktop)
sha256sums=('6ea18c276dcbb8522feeebcfc3a4b5cb7c7e7368ba8590d3326c6c3efc5448b6'
'ae076317d93a389cc0c893fd9ec6769ae860c2cc01f8c8bed3f4ee476c73e625'
'dc278160ca7df32bcfab0a5420c09eaf6f4602d30f57b6c5bedb0f60062c5228'
'd0913ae3b9f469f8567432b0867222d66f50008c313f5a0882d15994ba19ec01')
_jvmdir=/usr/lib/jvm/java-${_majorver}-temurin
_jdkdir=jdk-${_tag_ver}
package() {
install -dm 755 "${pkgdir}${_jvmdir}"
cp -a "${srcdir}/${_jdkdir}"/* "${pkgdir}${_jvmdir}"
cd "${pkgdir}${_jvmdir}"
# Conf
install -dm 755 "${pkgdir}/etc"
mv conf "${pkgdir}/etc/java-temurin"
ln -sf /etc/java-temurin conf
# Legal
install -dm 755 "${pkgdir}/usr/share/licenses"
mv legal "${pkgdir}/usr/share/licenses/${pkgname}"
ln -sf /usr/share/licenses/${pkgname} legal
# Man pages
for f in man/man1/*; do
install -Dm 644 "${f}" "${pkgdir}/usr/share/${f/\.1/-temurin${_majorver}.1}"
done
rm -rf man
ln -sf /usr/share/man man
# Link JKS keystore from ca-certificates-utils
rm -f lib/security/cacerts
ln -sf /etc/ssl/certs/java/cacerts lib/security/cacerts
# Desktop files
for f in jconsole java jshell; do
install -Dm 644 \
"${srcdir}/freedesktop-${f}.desktop" \
"${pkgdir}/usr/share/applications/${f}-${pkgname}.desktop"
done
}

9
freedesktop-java.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Temurin Java 17 Runtime
Comment=Temurin Java 17 Runtime
Keywords=java;runtime
Exec=/usr/lib/jvm/java-17-temurin/bin/java -jar
Terminal=false
Type=Application
MimeType=application/x-java-archive;application/java-archive;application/x-jar;
NoDisplay=true

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Temurin Java 17 Console
Comment=Temurin Java 17 Monitoring & Management Console
Keywords=java;console;monitoring
Exec=/usr/lib/jvm/java-17-temurin/bin/jconsole
Terminal=false
Type=Application
Categories=Application;System;

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Temurin Java 17 Shell
Comment=Temurin Java 17 Shell
Keywords=java;shell
Exec=/usr/lib/jvm/java-17-temurin/bin/jshell
Terminal=true
Type=Application
Categories=Application;System;

50
install_jdk-temurin.sh Normal file
View File

@ -0,0 +1,50 @@
THIS_JDK='java-17-temurin'
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
/usr/bin/archlinux-java get
fi
}
post_install() {
default=$(fix_default)
case ${default} in
"")
/usr/bin/archlinux-java set ${THIS_JDK}
;;
${THIS_JDK})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
/usr/bin/update-ca-trust
fi
}
post_upgrade() {
default=$(fix_default)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${THIS_JDK}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
/usr/bin/update-ca-trust
fi
}
pre_remove() {
if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
# Check JRE is still available
if [ -x /usr/lib/jvm/${THIS_JDK}/bin/java ]; then
/usr/bin/archlinux-java unset
fi
fi
}