8525ac48a9
Update release notes to 11.0.19.0+7 Require tzdata 2023c due to local inclusion of JDK-8274864 & JDK-8305113 Update generate_tarball.sh to add support for passing a boot JDK to the configure run Add POSIX-friendly error codes to generate_tarball.sh and fix whitespace Remove .jcheck and GitHub support when generating tarballs, as done in upstream release tarballs Rebase FIPS support against 11.0.19+6 Rebase RH1750419 alt-java patch against 11.0.19+6 Replace local copies of JDK portable binaries with build dependencies Use portable build on x86_32 now one is available ** This tarball is embargoed until 2023-04-18 @ 1pm PT. ** Related: RHEL-30918
250 lines
9.0 KiB
Bash
Executable File
250 lines
9.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Generates the 'source tarball' for JDK projects.
|
|
#
|
|
# Example:
|
|
# When used from local repo set REPO_ROOT pointing to file:// with your repo
|
|
# If your local repo follows upstream forests conventions, it may be enough to set OPENJDK_URL
|
|
# If you want to use a local copy of patch GH001, set the path to it in the GH001 variable
|
|
#
|
|
# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg:
|
|
# PROJECT_NAME=openjdk
|
|
# REPO_NAME=jdk11u
|
|
# VERSION=HEAD
|
|
# or to eg prepare systemtap:
|
|
# icedtea7's jstack and other tapsets
|
|
# VERSION=6327cf1cea9e
|
|
# REPO_NAME=icedtea7-2.6
|
|
# PROJECT_NAME=release
|
|
# OPENJDK_URL=http://icedtea.classpath.org/hg/
|
|
# TO_COMPRESS="*/tapset"
|
|
#
|
|
# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set)
|
|
|
|
# This script creates a single source tarball out of the repository
|
|
# based on the given tag and removes code not allowed in fedora/rhel. For
|
|
# consistency, the source tarball will always contain 'openjdk' as the top
|
|
# level folder, name is created, based on parameter
|
|
#
|
|
|
|
if [ ! "x$GH001" = "x" ] ; then
|
|
if [ ! -f "$GH001" ] ; then
|
|
echo "You have specified GH001 as $GH001 but it does not exist. Exiting"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if [ ! "x$GH003" = "x" ] ; then
|
|
if [ ! -f "$GH003" ] ; then
|
|
echo "You have specified GH003 as $GH003 but it does not exist. Exiting"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
set -e
|
|
|
|
OPENJDK_URL_DEFAULT=https://github.com
|
|
COMPRESSION_DEFAULT=xz
|
|
# Corresponding IcedTea version
|
|
ICEDTEA_VERSION=6.0
|
|
|
|
if [ "x$1" = "xhelp" ] ; then
|
|
echo -e "Behaviour may be specified by setting the following variables:\n"
|
|
echo "VERSION - the version of the specified OpenJDK project"
|
|
echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)"
|
|
echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)"
|
|
echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})"
|
|
echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})"
|
|
echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)"
|
|
echo "REPO_ROOT - the location of the Git repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)"
|
|
echo "TO_COMPRESS - what part of clone to pack (default is openjdk)"
|
|
echo "GH001 - the path to the ECC code patch, GH001, to apply (optional; downloaded if unavailable)"
|
|
echo "GH003 - the path to the ECC test patch, GH003, to apply (optional; downloaded if unavailable)"
|
|
echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run"
|
|
exit 1;
|
|
fi
|
|
|
|
|
|
if [ "x$VERSION" = "x" ] ; then
|
|
echo "No VERSION specified"
|
|
exit 2
|
|
fi
|
|
echo "Version: ${VERSION}"
|
|
|
|
NUM_VER=${VERSION##jdk-}
|
|
RELEASE_VER=${NUM_VER%%+*}
|
|
BUILD_VER=${NUM_VER##*+}
|
|
MAJOR_VER=${RELEASE_VER%%.*}
|
|
echo "Major version is ${MAJOR_VER}, release ${RELEASE_VER}, build ${BUILD_VER}"
|
|
|
|
if [ "x$BOOT_JDK" = "x" ] ; then
|
|
echo "No boot JDK specified".
|
|
BOOT_JDK=/usr/lib/jvm/java-${MAJOR_VER}-openjdk;
|
|
echo -n "Checking for ${BOOT_JDK}...";
|
|
if [ -d ${BOOT_JDK} -a -x ${BOOT_JDK}/bin/java ] ; then
|
|
echo "Boot JDK found at ${BOOT_JDK}";
|
|
else
|
|
echo "Not found";
|
|
PREV_VER=$((${MAJOR_VER} - 1));
|
|
BOOT_JDK=/usr/lib/jvm/java-${PREV_VER}-openjdk;
|
|
echo -n "Checking for ${BOOT_JDK}...";
|
|
if [ -d ${BOOT_JDK} -a -x ${BOOT_JDK}/bin/java ] ; then
|
|
echo "Boot JDK found at ${BOOT_JDK}";
|
|
else
|
|
echo "Not found";
|
|
exit 4;
|
|
fi
|
|
fi
|
|
else
|
|
echo "Boot JDK: ${BOOT_JDK}";
|
|
fi
|
|
|
|
# REPO_NAME is only needed when we default on REPO_ROOT and FILE_NAME_ROOT
|
|
if [ "x$FILE_NAME_ROOT" = "x" -o "x$REPO_ROOT" = "x" ] ; then
|
|
if [ "x$PROJECT_NAME" = "x" ] ; then
|
|
echo "No PROJECT_NAME specified"
|
|
exit 1
|
|
fi
|
|
echo "Project name: ${PROJECT_NAME}"
|
|
if [ "x$REPO_NAME" = "x" ] ; then
|
|
echo "No REPO_NAME specified"
|
|
exit 3
|
|
fi
|
|
echo "Repository name: ${REPO_NAME}"
|
|
fi
|
|
|
|
if [ "x$OPENJDK_URL" = "x" ] ; then
|
|
OPENJDK_URL=${OPENJDK_URL_DEFAULT}
|
|
echo "No OpenJDK URL specified; defaulting to ${OPENJDK_URL}"
|
|
else
|
|
echo "OpenJDK URL: ${OPENJDK_URL}"
|
|
fi
|
|
|
|
if [ "x$COMPRESSION" = "x" ] ; then
|
|
# rhel 5 needs tar.gz
|
|
COMPRESSION=${COMPRESSION_DEFAULT}
|
|
fi
|
|
echo "Creating a tar.${COMPRESSION} archive"
|
|
|
|
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
|
|
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
|
echo "No file name root specified; default to ${FILE_NAME_ROOT}"
|
|
fi
|
|
if [ "x$REPO_ROOT" = "x" ] ; then
|
|
REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}.git"
|
|
echo "No repository root specified; default to ${REPO_ROOT}"
|
|
fi;
|
|
|
|
if [ "x$TO_COMPRESS" = "x" ] ; then
|
|
TO_COMPRESS="openjdk"
|
|
echo "No targets to be compressed specified, ; default to ${TO_COMPRESS}"
|
|
fi;
|
|
|
|
echo -e "Settings:"
|
|
echo -e "\tVERSION: ${VERSION}"
|
|
echo -e "\tPROJECT_NAME: ${PROJECT_NAME}"
|
|
echo -e "\tREPO_NAME: ${REPO_NAME}"
|
|
echo -e "\tOPENJDK_URL: ${OPENJDK_URL}"
|
|
echo -e "\tCOMPRESSION: ${COMPRESSION}"
|
|
echo -e "\tFILE_NAME_ROOT: ${FILE_NAME_ROOT}"
|
|
echo -e "\tREPO_ROOT: ${REPO_ROOT}"
|
|
echo -e "\tTO_COMPRESS: ${TO_COMPRESS}"
|
|
echo -e "\tGH001: ${GH001}"
|
|
echo -e "\tGH003: ${GH003}"
|
|
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}
|
|
else
|
|
mkdir "${FILE_NAME_ROOT}"
|
|
pushd "${FILE_NAME_ROOT}"
|
|
echo "Cloning ${VERSION} root repository from ${REPO_ROOT}"
|
|
git clone -b ${VERSION} ${REPO_ROOT} openjdk
|
|
popd
|
|
fi
|
|
pushd "${FILE_NAME_ROOT}"
|
|
# UnderlineTaglet.java has a BSD license with a field-of-use restriction, making it non-Free
|
|
if [ -d openjdk/test ] ; then
|
|
echo "Removing langtools test case with non-Free license"
|
|
rm -vf openjdk/test/langtools/tools/javadoc/api/basic/taglets/UnderlineTaglet.java
|
|
fi
|
|
if [ -d openjdk/src ]; then
|
|
pushd openjdk
|
|
echo "Removing EC source code we don't build"
|
|
CRYPTO_PATH=src/jdk.crypto.ec/share/native/libsunec/impl
|
|
rm -vf ${CRYPTO_PATH}/ec2.h
|
|
rm -vf ${CRYPTO_PATH}/ec2_163.c
|
|
rm -vf ${CRYPTO_PATH}/ec2_193.c
|
|
rm -vf ${CRYPTO_PATH}/ec2_233.c
|
|
rm -vf ${CRYPTO_PATH}/ec2_aff.c
|
|
rm -vf ${CRYPTO_PATH}/ec2_mont.c
|
|
rm -vf ${CRYPTO_PATH}/ecp_192.c
|
|
rm -vf ${CRYPTO_PATH}/ecp_224.c
|
|
|
|
echo "Syncing EC list with NSS"
|
|
if [ "x$GH001" = "x" ] ; then
|
|
# get gh001-4curve.patch (from https://github.com/icedtea-git/icedtea) in the ${ICEDTEA_VERSION} branch
|
|
# Do not push it or publish it
|
|
echo "GH001 not found. Downloading..."
|
|
wget -v https://github.com/icedtea-git/icedtea/raw/${ICEDTEA_VERSION}/patches/gh001-4curve.patch
|
|
echo "Applying ${PWD}/gh001-4curve.patch"
|
|
git apply --stat --apply -v -p1 gh001-4curve.patch
|
|
rm gh001-4curve.patch
|
|
else
|
|
echo "Applying ${GH001}"
|
|
git apply --stat --apply -v -p1 $GH001
|
|
fi;
|
|
if [ "x$GH003" = "x" ] ; then
|
|
# get gh001-4curve.patch (from https://github.com/icedtea-git/icedtea) in the ${ICEDTEA_VERSION} branch
|
|
echo "GH003 not found. Downloading..."
|
|
wget -v https://github.com/icedtea-git/icedtea/raw/${ICEDTEA_VERSION}/patches/gh003-4curve.patch
|
|
echo "Applying ${PWD}/gh003-4curve.patch"
|
|
git apply --stat --apply -v -p1 gh003-4curve.patch
|
|
rm gh003-4curve.patch
|
|
else
|
|
echo "Applying ${GH003}"
|
|
git apply --stat --apply -v -p1 $GH003
|
|
fi;
|
|
find . -name '*.orig' -exec rm -vf '{}' ';' || echo "No .orig files found. This is suspicious, but may happen."
|
|
popd
|
|
fi
|
|
|
|
# Generate .src-rev so build has knowledge of the revision the tarball was created from
|
|
mkdir build
|
|
pushd build
|
|
sh ${PWD}/../openjdk/configure --with-boot-jdk=${BOOT_JDK}
|
|
make store-source-revision
|
|
popd
|
|
rm -rf build
|
|
|
|
# Remove commit checks
|
|
echo "Removing $(find openjdk -name '.jcheck' -print)"
|
|
find openjdk -name '.jcheck' -print0 | xargs -0 rm -r
|
|
|
|
# Remove history and GHA
|
|
echo "find openjdk -name '.hgtags'"
|
|
find openjdk -name '.hgtags' -exec rm -v '{}' '+'
|
|
echo "find openjdk -name '.hgignore'"
|
|
find openjdk -name '.hgignore' -exec rm -v '{}' '+'
|
|
echo "find openjdk -name '.gitattributes'"
|
|
find openjdk -name '.gitattributes' -exec rm -v '{}' '+'
|
|
echo "find openjdk -name '.gitignore'"
|
|
find openjdk -name '.gitignore' -exec rm -v '{}' '+'
|
|
echo "find openjdk -name '.git'"
|
|
find openjdk -name '.git' -exec rm -rv '{}' '+'
|
|
echo "find openjdk -name '.github'"
|
|
find openjdk -name '.github' -exec rm -rv '{}' '+'
|
|
|
|
echo "Compressing remaining forest"
|
|
if [ "X$COMPRESSION" = "Xxz" ] ; then
|
|
SWITCH=cJf
|
|
else
|
|
SWITCH=czf
|
|
fi
|
|
TARBALL_NAME=${FILE_NAME_ROOT}-4curve.tar.${COMPRESSION}
|
|
tar --exclude-vcs -$SWITCH ${TARBALL_NAME} $TO_COMPRESS
|
|
mv ${TARBALL_NAME} ..
|
|
popd
|
|
echo "Done. You may want to remove the uncompressed version - $FILE_NAME_ROOT."
|