#!/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: # PROJECT_NAME=jdk11 # REPO_NAME=jdk # 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 PROJECT_NAME="jdk" fi if [ "x$REPO_NAME" = "x" ] ; then REPO_NAME="jdk11" fi if [ "x$VERSION" = "x" ] ; then VERSION="jdk-11+20" 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 MAIN_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} if [ ! -f ${MAIN_FILENAME} ] ; then echo "Generating ${MAIN_FILENAME}" . ./generate_source_tarball.sh else echo "exists exists exists exists exists exists exists " echo "reusing reusing reusing reusing reusing reusing " echo ${MAIN_FILENAME} fi # generate shenandoah hotspot 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" 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 SHENANDOAH_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} if [ ! -f ${SHENANDOAH_FILENAME} ] ; then echo "Generating ${SHENANDOAH_FILENAME}" . ./generate_source_tarball.sh else echo "exists exists exists exists exists exists exists " echo "reusing reusing reusing reusing reusing reusing " echo ${SHENANDOAH_FILENAME} fi TAPSET=`sh generate_tapsets.sh | tail -n 1` echo "rh/fedpkg $TAPSET $SHENANDOAH_FILENAME $MAIN_FILENAME" 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##*-}` 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"