TARGETDIR=`pwd -P`
SCRIPTDIR=$( cd "$(dirname "$0")" ; pwd -P )
PROJECTROOTDIR=`realpath "$SCRIPTDIR/../"`
-GITREV=""
+GITREV=`git rev-parse --short HEAD`
echo "Cleaning $BUILD_DIR"
rm -rf $BUILD_DIR
echo "Tarball done"
echo "> Copying tarball and .spec file into the $RPMBUILD_DIR .."
-cp createrepo_c-*.tar.xz $RPMBUILD_DIR/SOURCES/
+cp createrepo_c-$GITREV.tar.xz $RPMBUILD_DIR/SOURCES/
if [ ! $? == "0" ]; then
echo "Error while: cp createrepo_c-*.tar.xz $RPMBUILD_DIR/SOURCES/"
exit 1
-#!/usr/bin/bash
-
-TARGETDIR=`pwd -P`
-SCRIPTDIR=$( cd "$(dirname "$0")" ; pwd -P )
-PROJECTROOTDIR=`realpath "$SCRIPTDIR/../"`
-
-if [ "$#" -eq "1" ] && [ "$1" = "-h" ]; then
- echo "Usage: `basename $0` [git revision]"
- exit 0
-fi
+TARGET_DIR="./"
if [ "$#" -eq "0" ]; then
GITREV=`git rev-parse --short HEAD`
- SUFFIX=`$SCRIPTDIR/get_version.py $PROJECTROOTDIR`
else
GITREV=$1
- SUFFIX=$GITREV
fi
-echo "Generate tarball for revision/version: $SUFFIX (project root dir: $PROJECTROOTDIR)"
+echo "Generate tarball for revision: $GITREV"
-cd ${PROJECTROOTDIR}
-git archive ${GITREV} --prefix="createrepo_c-${SUFFIX}/" | xz > $TARGETDIR/createrepo_c-${SUFFIX}.tar.xz
+git archive ${GITREV} --prefix=createrepo_c/ | xz > $TARGET_DIR/createrepo_c-${GITREV}.tar.xz