2015-12-08 11:55:18 +00:00
|
|
|
#!/bin/bash -x
|
2013-09-05 18:19:24 +00:00
|
|
|
# Generates the 'source tarball' for JDK 8 projects.
|
|
|
|
#
|
2015-12-08 11:55:18 +00:00
|
|
|
# Example:
|
|
|
|
# When used from local repo set REPO_ROOT pointing to file:// wth your repo
|
|
|
|
# if your local repo follows upstream forests conventions, you may be enough by setting OPENJDK_URL
|
|
|
|
# if you wont to use local copy of patch PR2126 set path to it to PR2126 variable
|
2013-09-05 18:19:24 +00:00
|
|
|
#
|
2015-12-08 11:55:18 +00:00
|
|
|
# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg:
|
|
|
|
# PROJECT_NAME=jdk8u OR aarch64-port
|
|
|
|
# REPO_NAME=jdk8u60 OR jdk8u60
|
|
|
|
# VERSION=jdk8u60-b27 OR aarch64-jdk8u65-b17 OR for head, keyword 'tip' should do the job there
|
|
|
|
#
|
|
|
|
# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set)
|
2015-08-19 11:20:20 +00:00
|
|
|
|
2013-09-05 18:19:24 +00:00
|
|
|
# This script creates a single source tarball out of the repository
|
2015-12-08 11:55:18 +00:00
|
|
|
# based on the given tag and removes code not allowed in fedora/rhel. For
|
2015-07-20 19:05:32 +00:00
|
|
|
# consistency, the source tarball will always contain 'openjdk' as the top
|
2015-12-08 11:55:18 +00:00
|
|
|
# level folder, name is created, based on parameter
|
|
|
|
#
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2013-07-23 08:59:21 +00:00
|
|
|
set -e
|
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "x$PROJECT_NAME" = "x" ] ; then
|
|
|
|
echo "no PROJECT_NAME"
|
|
|
|
exit 1
|
2014-04-16 01:35:05 +00:00
|
|
|
fi
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "x$REPO_NAME" = "x" ] ; then
|
|
|
|
echo "no REPO_NAME"
|
|
|
|
exit 2
|
2013-09-05 18:19:24 +00:00
|
|
|
fi
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "x$VERSION" = "x" ] ; then
|
|
|
|
echo "no VERSION"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
if [ "x$OPENJDK_URL" = "x" ] ; then
|
|
|
|
OPENJDK_URL=http://hg.openjdk.java.net
|
2013-03-12 13:35:26 +00:00
|
|
|
fi
|
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "x$COMPRESSION" = "x" ] ; then
|
|
|
|
# rhel 5 needs tar.gz
|
|
|
|
COMPRESSION=xz
|
|
|
|
fi
|
|
|
|
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
|
|
|
|
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
|
|
|
fi
|
|
|
|
if [ "x$REPO_ROOT" = "x" ] ; then
|
|
|
|
REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}"
|
|
|
|
fi;
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
mkdir "${FILE_NAME_ROOT}"
|
|
|
|
pushd "${FILE_NAME_ROOT}"
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
hg clone ${REPO_ROOT} openjdk -r ${VERSION}
|
2015-07-20 19:05:32 +00:00
|
|
|
pushd openjdk
|
2015-12-08 11:55:18 +00:00
|
|
|
|
|
|
|
#jdk is last for its size
|
|
|
|
repos="hotspot corba jaxws jaxp langtools nashorn jdk"
|
2014-11-05 15:56:02 +00:00
|
|
|
|
|
|
|
for subrepo in $repos
|
2013-07-23 08:59:21 +00:00
|
|
|
do
|
2015-12-08 11:55:18 +00:00
|
|
|
hg clone ${REPO_ROOT}/${subrepo} -r ${VERSION}
|
2013-07-21 17:35:12 +00:00
|
|
|
done
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2015-12-08 11:55:18 +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
|
|
|
|
|
|
|
|
echo "Syncing EC list with NSS"
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "x$PR2126" = "x" ] ; then
|
|
|
|
# get pr2126.patch (from http://icedtea.classpath.org//hg/icedtea?cmd=changeset;node=8d2c9a898f50) from most correct tag
|
|
|
|
# Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126)
|
|
|
|
wget http://icedtea.classpath.org/hg/icedtea/raw-file/tip/patches/pr2126.patch
|
|
|
|
patch -Np1 < pr2126.patch
|
|
|
|
rm pr2126.patch
|
|
|
|
else
|
|
|
|
patch -Np1 < $PR2126
|
|
|
|
fi;
|
2015-07-20 19:05:32 +00:00
|
|
|
|
2013-09-05 18:19:24 +00:00
|
|
|
popd
|
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
if [ "X$COMPRESSION" = "Xxz" ] ; then
|
|
|
|
tar --exclude-vcs -cJf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk
|
|
|
|
else
|
|
|
|
tar --exclude-vcs -czf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk
|
|
|
|
fi
|
2013-09-05 18:19:24 +00:00
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
mv ${FILE_NAME_ROOT}.tar.${COMPRESSION} ..
|
2013-09-05 18:19:24 +00:00
|
|
|
popd
|
|
|
|
|
2015-12-08 11:55:18 +00:00
|
|
|
|