2021-04-01 21:15:35 +00:00
|
|
|
VERSION=`git describe|cut -d- -f 1`
|
|
|
|
NUMCOMMITS=`git describe|cut -d- -f 2`
|
|
|
|
if [ "$NUMCOMMITS" != "$VERSION" ]; then
|
2024-09-04 14:11:47 +00:00
|
|
|
LASTNUM=$(echo $VERSION|rev|cut -d . -f 1|rev)
|
|
|
|
LASTNUM=$((LASTNUM+1))
|
|
|
|
FIRSTPART=$(echo $VERSION|rev|cut -d . -f 2- |rev)
|
|
|
|
VERSION=${FIRSTPART}.${LASTNUM}
|
|
|
|
VERSION=$VERSION~dev$NUMCOMMITS+`git describe|cut -d- -f 3`
|
2021-04-01 21:15:35 +00:00
|
|
|
fi
|
|
|
|
mkdir -p dist/confluent_vtbufferd-$VERSION
|
2022-08-23 20:08:25 +00:00
|
|
|
cp ../LICENSE NOTICE *.c *.h Makefile dist/confluent_vtbufferd-$VERSION
|
2021-04-01 21:15:35 +00:00
|
|
|
cd dist
|
2021-04-01 21:22:10 +00:00
|
|
|
tar czf confluent_vtbufferd-$VERSION.tar.gz confluent_vtbufferd-$VERSION
|
2021-04-01 21:15:35 +00:00
|
|
|
cd -
|
|
|
|
cp dist/confluent_vtbufferd-$VERSION.tar.gz ~/rpmbuild/SOURCES
|
|
|
|
sed -e 's/#VERSION#/'$VERSION/ confluent_vtbufferd.spec.tmpl > ~/rpmbuild/SPECS/confluent_vtbufferd.spec
|
|
|
|
rpmbuild -ba ~/rpmbuild/SPECS/confluent_vtbufferd.spec 2> /dev/null |grep ^Wrote:
|
|
|
|
if [ $? -ne 0 ]; then
|
2021-04-01 21:17:34 +00:00
|
|
|
echo "[ERROR] rpmbuild returned non-zero, run: rpmbuild -ba ~/rpmbuild/SPECS/confluent_vtbufferd.spec"
|
2021-04-01 21:15:35 +00:00
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
# Clean up the generated files in this directory
|
|
|
|
rm -rf dist
|
|
|
|
fi
|
|
|
|
|
|
|
|
|