Thomas F Herbert 20a29c7b4d VPP-498: Prepare vpp RPM packaging for use by downstream distros.
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>
2016-11-04 22:22:53 +00:00

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