2013-03-12 13:35:26 +00:00
|
|
|
#!/bin/bash
|
2013-09-05 18:19:24 +00:00
|
|
|
# Generates the 'source tarball' for JDK 8 projects.
|
|
|
|
#
|
2014-04-16 01:35:05 +00:00
|
|
|
# Usage: generate_source_tarball.sh project_name repo_name tag
|
2013-09-05 18:19:24 +00:00
|
|
|
#
|
|
|
|
# Examples:
|
2015-02-12 14:40:20 +00:00
|
|
|
# sh generate_source_tarball.sh jdk8u jdk8u40 jdk8u40-b25
|
2014-04-16 01:35:05 +00:00
|
|
|
# ./generate_source_tarball.sh jdk8 jdk8 jdk8-b79
|
|
|
|
# ./generate_source_tarball.sh jdk8u jdk8u jdk8u5-b13
|
|
|
|
# ./generate_source_tarball.sh aarch64-port jdk8 aarch64-${DATE}
|
2013-09-05 18:19:24 +00:00
|
|
|
#
|
|
|
|
# This script creates a single source tarball out of the repository
|
2014-04-16 01:35:05 +00:00
|
|
|
# based on the given tag and removes code not allowed in fedora. For
|
2015-07-20 19:05:32 +00:00
|
|
|
# consistency, the source tarball will always contain 'openjdk' as the top
|
2014-04-16 01:35:05 +00:00
|
|
|
# level folder.
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2013-07-23 08:59:21 +00:00
|
|
|
set -e
|
|
|
|
|
2014-04-16 01:35:05 +00:00
|
|
|
PROJECT_NAME="$1"
|
|
|
|
REPO_NAME="$2"
|
|
|
|
VERSION="$3"
|
|
|
|
OPENJDK_URL=http://hg.openjdk.java.net
|
2013-03-12 13:35:26 +00:00
|
|
|
|
2014-04-16 01:35:05 +00:00
|
|
|
if [[ "${PROJECT_NAME}" = "" ]] ; then
|
|
|
|
echo "No repository specified."
|
|
|
|
exit -1
|
|
|
|
fi
|
2013-09-05 18:19:24 +00:00
|
|
|
if [[ "${REPO_NAME}" = "" ]] ; then
|
|
|
|
echo "No repository specified."
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
if [[ "${VERSION}" = "" ]]; then
|
|
|
|
echo "No version/tag specified."
|
2013-03-12 13:35:26 +00:00
|
|
|
exit -1;
|
|
|
|
fi
|
|
|
|
|
2013-09-05 18:19:24 +00:00
|
|
|
mkdir "${REPO_NAME}"
|
|
|
|
pushd "${REPO_NAME}"
|
|
|
|
|
2014-04-16 01:35:05 +00:00
|
|
|
REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}"
|
2013-09-05 18:19:24 +00:00
|
|
|
|
|
|
|
wget "${REPO_ROOT}/archive/${VERSION}.tar.gz"
|
|
|
|
tar xf "${VERSION}.tar.gz"
|
|
|
|
rm "${VERSION}.tar.gz"
|
|
|
|
|
2015-07-20 19:05:32 +00:00
|
|
|
mv "${REPO_NAME}-${VERSION}" openjdk
|
|
|
|
pushd openjdk
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2014-11-05 15:56:02 +00:00
|
|
|
repos="corba hotspot jdk jaxws jaxp langtools nashorn"
|
|
|
|
if [ aarch64-port = $PROJECT_NAME ] ; then
|
|
|
|
repos="hotspot"
|
|
|
|
fi;
|
|
|
|
|
|
|
|
for subrepo in $repos
|
2013-07-23 08:59:21 +00:00
|
|
|
do
|
2013-09-05 18:19:24 +00:00
|
|
|
wget "${REPO_ROOT}/${subrepo}/archive/${VERSION}.tar.gz"
|
|
|
|
tar xf "${VERSION}.tar.gz"
|
|
|
|
rm "${VERSION}.tar.gz"
|
|
|
|
mv "${subrepo}-${VERSION}" "${subrepo}"
|
2013-07-21 17:35:12 +00:00
|
|
|
done
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2015-07-20 19:05:32 +00:00
|
|
|
echo "Removing EC source code we don't build"
|
|
|
|
rm -vrf jdk/src/share/native/sun/security/ec/impl
|
|
|
|
|
|
|
|
#get this file http://icedtea.classpath.org/hg/icedtea/raw-file/tip/patches/pr2126.patch (from http://icedtea.classpath.org//hg/icedtea?cmd=changeset;node=8d2c9a898f50)
|
|
|
|
#from most correct tag
|
|
|
|
#and use it like below. Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126)
|
|
|
|
pwd
|
|
|
|
echo "Syncing EC list with NSS"
|
|
|
|
patch -Np1 < ../../pr2126.patch
|
|
|
|
|
2013-09-05 18:19:24 +00:00
|
|
|
popd
|
|
|
|
|
2015-07-20 19:05:32 +00:00
|
|
|
tar cJf ${REPO_NAME}-${VERSION}.tar.xz openjdk
|
2013-09-05 18:19:24 +00:00
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
mv "${REPO_NAME}/${REPO_NAME}-${VERSION}.tar.xz" .
|