20a29c7b4d
Change spec to add new macros to get rid of relative dir reference and use vpp version. Store version string in .version to store metadata in dist archive. New script to create dist archive. Add dist and wipedist targets to Makefile for builds of source RPMs. Change-Id: I7cf0164f0cb094ec70f3dc323ed7fa2ee82bd902 Signed-off-by: Thomas F Herbert <therbert@redhat.com>
32 lines
600 B
Bash
Executable File
32 lines
600 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Add version to dist tarball.
|
|
#
|
|
BR=$1
|
|
prefix=$2
|
|
verstring=$3
|
|
BASE=`pwd`
|
|
|
|
git rev-parse 2> /dev/null
|
|
if [ $? == 0 ]; then
|
|
git archive --prefix=${prefix}/ HEAD | gzip -9 > ${verstring}.tar.gz
|
|
else
|
|
cd ..
|
|
tar -c ${prefix} | gzip -9 > ${verstring}.tar.gz
|
|
cp ${verstring}.tar.gz $BASE
|
|
cd $BASE
|
|
fi
|
|
|
|
mkdir ${BASE}/tmp
|
|
cd ${BASE}/tmp
|
|
tar -xzf ${BASE}/${verstring}.tar.gz
|
|
rm ${BASE}/${verstring}.tar.gz
|
|
|
|
cp ${BR}/scripts/.version ${BASE}/tmp/${prefix}/build-root/scripts
|
|
tar -c ${prefix} | gzip -9 > ${verstring}.tar.gz
|
|
mv ${verstring}.tar.gz ${BASE}
|
|
|
|
cd ${BASE}
|
|
rm -rf tmp
|