2018-06-13 16:02:58 +00:00
|
|
|
#!/bin/bash -x
|
|
|
|
# Generates the 'source tarball' for JDK 8 projects and update spec infrastructure
|
|
|
|
# By default, this script regenerate source as they are currently used.
|
|
|
|
# so if the version of sources change, this file changes and is pushed
|
|
|
|
#
|
|
|
|
# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg:
|
2018-06-22 08:45:30 +00:00
|
|
|
# PROJECT_NAME=jdk11
|
|
|
|
# REPO_NAME=jdk
|
2018-06-13 16:02:58 +00:00
|
|
|
# VERSION=inDevelopment (but keyword tip will still do its job)
|
|
|
|
#
|
|
|
|
# If you don't, default are used and so already uploaded tarball regenerated
|
|
|
|
# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set)
|
|
|
|
#
|
|
|
|
# For other useful variables see generate_source_tarball.sh
|
|
|
|
#
|
|
|
|
# the used values are then substituted to spec and sources
|
|
|
|
|
|
|
|
if [ ! "x$PR2126" = "x" ] ; then
|
|
|
|
if [ ! -f "$PR2126" ] ; then
|
|
|
|
echo "You have specified PR2126 as $PR2126 but it does not exists. exiting"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ "x$PROJECT_NAME" = "x" ] ; then
|
2018-06-22 08:45:30 +00:00
|
|
|
PROJECT_NAME="jdk"
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
|
|
|
if [ "x$REPO_NAME" = "x" ] ; then
|
2018-07-04 19:19:04 +00:00
|
|
|
REPO_NAME="jdk11"
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
|
|
|
if [ "x$VERSION" = "x" ] ; then
|
2018-07-04 19:19:04 +00:00
|
|
|
VERSION="jdk-11+20"
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
MAIN_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
2018-06-13 16:02:58 +00:00
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
if [ ! -f ${MAIN_FILENAME} ] ; then
|
|
|
|
echo "Generating ${MAIN_FILENAME}"
|
|
|
|
. ./generate_source_tarball.sh
|
2018-06-13 16:02:58 +00:00
|
|
|
else
|
2018-07-04 19:19:04 +00:00
|
|
|
echo "exists exists exists exists exists exists exists "
|
|
|
|
echo "reusing reusing reusing reusing reusing reusing "
|
|
|
|
echo ${MAIN_FILENAME}
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# generate shenandoah hotspot
|
2018-07-04 19:19:04 +00:00
|
|
|
if [ "x$PROJECT_NAME" = "x" ] ; then
|
|
|
|
PROJECT_NAME="shenandoah"
|
|
|
|
fi
|
|
|
|
if [ "x$REPO_NAME" = "x" ] ; then
|
|
|
|
REPO_NAME="jdk"
|
|
|
|
fi
|
|
|
|
if [ "x$VERSION" = "x" ] ; then
|
|
|
|
VERSION="4f5549ec27fb"
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
2018-06-22 15:24:43 +00:00
|
|
|
|
2018-07-04 19:19:04 +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
|
2018-06-22 15:24:43 +00:00
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
SHENANDOAH_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
2018-06-13 16:02:58 +00:00
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
if [ ! -f ${SHENANDOAH_FILENAME} ] ; then
|
|
|
|
echo "Generating ${SHENANDOAH_FILENAME}"
|
|
|
|
. ./generate_source_tarball.sh
|
2018-06-13 16:02:58 +00:00
|
|
|
else
|
2018-07-04 19:19:04 +00:00
|
|
|
echo "exists exists exists exists exists exists exists "
|
|
|
|
echo "reusing reusing reusing reusing reusing reusing "
|
|
|
|
echo ${SHENANDOAH_FILENAME}
|
2018-06-13 16:02:58 +00:00
|
|
|
fi
|
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
TAPSET=`sh generate_tapsets.sh | tail -n 1`
|
2018-06-22 15:24:43 +00:00
|
|
|
|
2018-07-04 19:19:04 +00:00
|
|
|
echo "rh/fedpkg $TAPSET $SHENANDOAH_FILENAME $MAIN_FILENAME"
|
2018-06-13 16:02:58 +00:00
|
|
|
|
|
|
|
user_name=`whoami`
|
|
|
|
user_record=$(getent passwd $user_name)
|
|
|
|
user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5)
|
|
|
|
user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1)
|
|
|
|
spec_date=`date +"%a %b %d %Y"`
|
|
|
|
revision_helper=`echo ${MAIN_VERSION%-*}`
|
|
|
|
updatever=`echo ${revision_helper##*u}`
|
|
|
|
buildver=`echo ${MAIN_VERSION##*-}`
|
2018-07-04 19:19:04 +00:00
|
|
|
echo "%chnagelog"
|
|
|
|
echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:MAJORVER.SECURITY.UPDATE.BUILD-RELEASE(1)"
|
|
|
|
echo "- updated to $MAIN_FILENAME"
|
|
|
|
echo "- updated to $SHENANDOAH_FILENAME"
|
|
|
|
echo "- updated to $TAPSET "
|
|
|
|
echo "- adjusted buildver minorver securityver majorver acordingly"
|
|
|
|
echo "you should verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl"
|
2018-06-13 16:02:58 +00:00
|
|
|
|