1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
# This scripts helps with building the source .tar.gz file
VER_MAJOR=1
VER_MINOR=1
VER_MICRO=0
VER_STATUS=
#
VERSION=$VER_MAJOR"."$VER_MINOR"."$VER_MICRO
TAG="ARANYM_"$VER_MAJOR"_"$VER_MINOR"_"$VER_MICRO
if [ "x$VER_STATUS" != "x" ]
then
VERSION=$VERSION""$VER_STATUS
TAG=$TAG"_"$VER_STATUS
fi
#upper case the tag
TAG=`echo $TAG | tr '[:lower:]' '[:upper:]'`
FOLDER="aranym-"$VERSION
FNAME="aranym_"$VERSION".orig.tar.gz"
#
echo "download from upstream git repository? (y/N)"
read key
if [ "x$key" = "xy" ]; then
git clone git://github.com/aranym/aranym.git
cd aranym
git checkout $TAG
cd ..
fi
#
grep "define VER_MAJOR" aranym/src/include/version.h | grep $VER_MAJOR >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: increase major version in src/include/version.h"
exit 1
fi
grep "define VER_MINOR" aranym/src/include/version.h | grep $VER_MINOR >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: increase minor version in src/include/version.h"
exit 1
fi
grep "define VER_MICRO" aranym/src/include/version.h | grep $VER_MICRO >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: increase micro version in src/include/version.h"
exit 1
fi
grep "[Vv]ersion "$VERSION aranym/README.md >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: increase version in README.md"
exit 1
fi
grep "%define ver" aranym/aranym.spec | grep $VERSION >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: increase version in aranym.spec"
exit 1
fi
#grep "AC_INIT(aranym, "$VERSION aranym/src/Unix/configure.ac | grep $VERSION >/dev/null
#if [ $? -ne 0 ]; then
# echo "ERROR: increase version in src/configure.ac"
# exit 1
#fi
#
cd aranym
./autogen.sh
make distclean
rm -rf .git
cd .. && mv aranym $FOLDER && GZIP=--best tar chzf $FNAME --exclude=autogen.sh --exclude=.cvsignore $FOLDER
|