diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 2150bbf..575df62 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -1,4 +1,20 @@ #!/bin/bash + +# Copyright (C) 2024 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 . + # Generates the 'source tarball' for JDK projects. # # Example 1: @@ -81,9 +97,17 @@ if [ "$OPENJDK_LATEST" != "" ] ; then | tail --lines 1) PROJECT_NAME=openjdk REPO_NAME=jdk"${FEATURE_VERSION}"u + # Skip -ga tags since those are the same as the most recent non-ga tag, and + # the non-ga tag is the one that is used to generated the official source + # tarball. For example: + # ca760c86642aa2e0d9b571aaabac054c0239fbdc refs/tags/jdk-17.0.10-ga^{} + # 25a2e6c20c9a96853714284cabc6b456eb095070 refs/tags/jdk-17.0.10-ga + # ca760c86642aa2e0d9b571aaabac054c0239fbdc refs/tags/jdk-17.0.10+7^{} + # e49c5749b10f3e90274b72e9279f794fdd191d27 refs/tags/jdk-17.0.10+7 VERSION=$(git ls-remote --tags --refs --sort=-version:refname \ "${OPENJDK_URL_DEFAULT}/${PROJECT_NAME}/${REPO_NAME}.git" \ "jdk-${FEATURE_VERSION}*" \ + | grep --invert-match '\-ga$' \ | head --lines 1 | cut --characters 52-) FILE_NAME_ROOT=open${VERSION} WITH_TEMP=1 @@ -178,62 +202,60 @@ echo -e "\tTO_COMPRESS: ${TO_COMPRESS}" echo -e "\tBOOT_JDK: ${BOOT_JDK}" if [ -d "${FILE_NAME_ROOT}" ] ; then - echo "exists exists exists exists exists exists exists " - echo "reusing reusing reusing reusing reusing reusing " - echo "${FILE_NAME_ROOT}" - STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" - TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo "${FILE_NAME_ROOT}" + STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" + TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" else - mkdir "${FILE_NAME_ROOT}" - pushd "${FILE_NAME_ROOT}" - echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" - pushd "${VERSION}" - TAR_TIME="$(git log --max-count 1 --format=%cI)" + mkdir "${FILE_NAME_ROOT}" + pushd "${FILE_NAME_ROOT}" + echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" + git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" + pushd "${VERSION}" + TAR_TIME="$(git log --max-count 1 --format=%cI)" + popd popd - popd fi pushd "${FILE_NAME_ROOT}" - EA_PART="$(git tag --contains "${VERSION}" \ - | grep --quiet '\-ga$' || echo '-ea')" - # Generate .src-rev so build has knowledge of the revision the tarball was # created from mkdir build pushd build - sh "${PWD}"/../"${VERSION}"/configure --with-boot-jdk="${BOOT_JDK}" - make store-source-revision + sh "${PWD}"/../"${VERSION}"/configure --with-boot-jdk="${BOOT_JDK}" + make store-source-revision popd rm -rf build - # Remove commit checks - echo "Removing $(find ${VERSION} -name '.jcheck' -print)" - find ${VERSION} -name '.jcheck' -print0 | xargs -0 rm -r - - # Remove history and GHA - echo "find ${VERSION} -name '.hgtags'" - find ${VERSION} -name '.hgtags' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.hgignore'" - find ${VERSION} -name '.hgignore' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.gitattributes'" - find ${VERSION} -name '.gitattributes' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.gitignore'" - find ${VERSION} -name '.gitignore' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.git'" - find ${VERSION} -name '.git' -exec rm -rfv '{}' '+' - echo "find ${VERSION} -name '.github'" - find ${VERSION} -name '.github' -exec rm -rfv '{}' '+' - + EA_PART="$(awk -F= \ + '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ + "${VERSION}"/make/conf/version-numbers.conf)" + TARBALL_BASE=${FILE_NAME_ROOT}${EA_PART}.tar + pushd "${VERSION}" + # Omit commit checks, history, and GHA from archive. + for skip in .jcheck .hgtags .hgignore .gitattributes .gitignore .github + do + echo "${skip}"" export-ignore" >> .git/info/attributes + done + # Do not bother with --mtime here; specify it to tar below. + # Unforunately, git-archive sorts added files like .src-rev at the end; + # retar below to use GNU tar --sort=name ordering which sorts .src-rev + # at the start. + git archive --output "${TARBALL_BASE}" --prefix="${VERSION}"/ \ + --add-file=.src-rev --format=tar "${VERSION}" + popd + mv "${VERSION}" "${VERSION}".git + tar xf "${VERSION}".git/"${TARBALL_BASE}" echo "Compressing remaining forest" if [ "$COMPRESSION" = "xz" ] ; then SWITCH=cJf else SWITCH=czf fi - TARBALL_NAME=${FILE_NAME_ROOT}${EA_PART}.tar.${COMPRESSION} + TARBALL_NAME=${TARBALL_BASE}.${COMPRESSION} XZ_OPT=${XZ_OPT-"-T0"} \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ - --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" + -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" mv "${TARBALL_NAME}" .. popd if [ "$WITH_TEMP" != "" ] ; then @@ -247,4 +269,6 @@ fi # Local Variables: # compile-command: "shellcheck generate_source_tarball.sh" # fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 # End: diff --git a/java-17-openjdk-portable.spec b/java-17-openjdk-portable.spec index 0600576..483a791 100644 --- a/java-17-openjdk-portable.spec +++ b/java-17-openjdk-portable.spec @@ -131,7 +131,7 @@ # Set of architectures for which we build fastdebug builds %global fastdebug_arches x86_64 ppc64le aarch64 # Set of architectures with a Just-In-Time (JIT) compiler -%global jit_arches %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64 +%global jit_arches %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64 riscv64 # Set of architectures which use the Zero assembler port (!jit_arches) %global zero_arches ppc s390 # Set of architectures which run a full bootstrap cycle @@ -141,7 +141,7 @@ # Set of architectures with a Ahead-Of-Time (AOT) compiler %global aot_arches x86_64 %{aarch64} # Set of architectures which support the serviceability agent -%global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} +%global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} riscv64 # Set of architectures which support class data sharing # As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific # However, it does segfault on the Zero assembler port, so currently JIT only @@ -149,7 +149,7 @@ # Set of architectures for which we build the Shenandoah garbage collector %global shenandoah_arches x86_64 %{aarch64} # Set of architectures for which we build the Z garbage collector -%global zgc_arches x86_64 +%global zgc_arches x86_64 riscv64 # Set of architectures for which alt-java has SSB mitigation %global ssbd_arches x86_64 # Set of architectures for which java has short vector math library (libjsvml.so) @@ -310,6 +310,10 @@ %global archinstall aarch64 %global stapinstall arm64 %endif +%ifarch riscv64 +%global archinstall riscv64 +%global stapinstall %{_target_cpu} +%endif # 32 bit sparc, optimized for v9 %ifarch sparcv9 %global archinstall sparc @@ -327,7 +331,7 @@ %endif %ifarch %{systemtap_arches} -%if (0%{?rhel} > 0) +%if (0%{?rhel} > 0 && !0%{?epel}) %global with_systemtap 1 %else %global with_systemtap 0 @@ -404,7 +408,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 7 -%global rpmrelease 1 +%global rpmrelease 3 #%%global tagsuffix %%{nil} # Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit %if %is_system_jdk @@ -567,7 +571,7 @@ ExcludeArch: %{ix86} Name: java-%{javaver}-%{origin}-portable Version: %{newjavaver}.%{buildver} -Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -1068,7 +1072,7 @@ export NUM_PROC=${NUM_PROC:-1} [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} %endif -%ifarch s390x sparc64 alpha %{power64} %{aarch64} +%ifarch s390x sparc64 alpha %{power64} %{aarch64} riscv64 export ARCH_DATA_MODEL=64 %endif %ifarch alpha @@ -1803,7 +1807,13 @@ done %endif %changelog -* Sat Mar 02 2024 Jiri Vanek - 1:17.0.10.0.7-1.1 +* Wed Feb 21 2024 Songsong Zhang - 1:17.0.10.0.7-3 +- Add riscv64 support + +* Fri Feb 16 2024 Jiri Vanek - 1:17.0.10.0.7-2 +- fixed condition for taspets + +* Tue Feb 27 2024 Jiri Vanek - 1:17.0.10.0.7-1.1 - Rebuilt for java-21-openjdk as system jdk * Thu Jan 11 2024 Andrew Hughes - 1:17.0.10.0.7-1