| 1 | #!/bin/sh |
| 2 | # This scripts helps with building the source .tar.gz file |
| 3 | |
| 4 | VER_MAJOR=7 |
| 5 | VER_MINOR=1 |
| 6 | VER_MICRO=2 |
| 7 | # |
| 8 | VERSION=$VER_MAJOR"."$VER_MINOR"."$VER_MICRO |
| 9 | TAG="ATARI800_"$VER_MAJOR"_"$VER_MINOR"_"$VER_MICRO |
| 10 | #upper case the tag |
| 11 | TAG=`echo $TAG | tr [:lower:] [:upper:]` |
| 12 | FOLDER="atari800-"$VERSION |
| 13 | FNAME=$FOLDER"-src.tgz" |
| 14 | # |
| 15 | echo "download from GitHub? (y/N)" |
| 16 | read key |
| 17 | if [ "x"$key = "xy" ]; then |
| 18 | git clone https://github.com/atari800/atari800.git |
| 19 | rm -rf atari800/.git atari800/.gitignore |
| 20 | rm -rf atari800/.travis atari800/.travis.yml |
| 21 | fi |
| 22 | # |
| 23 | grep "[Vv]ersion "$VERSION atari800/README.TXT >/dev/null |
| 24 | if [ $? -ne 0 ]; then |
| 25 | echo "ERROR: increase version in README.TXT" |
| 26 | exit 1 |
| 27 | fi |
| 28 | grep "[Vv]ersion "$VERSION atari800/DOC/README >/dev/null |
| 29 | if [ $? -ne 0 ]; then |
| 30 | echo "ERROR: increase version in DOC/README" |
| 31 | exit 1 |
| 32 | fi |
| 33 | grep "Atari800 "$VERSION atari800/src/atari800.man >/dev/null |
| 34 | if [ $? -ne 0 ]; then |
| 35 | echo "ERROR: increase version in src/atari800.man" |
| 36 | exit 1 |
| 37 | fi |
| 38 | grep "%define ver" atari800/atari800.spec | grep $VERSION >/dev/null |
| 39 | if [ $? -ne 0 ]; then |
| 40 | echo "ERROR: increase version in atari800.spec" |
| 41 | exit 1 |
| 42 | fi |
| 43 | grep "AC_INIT(Atari800, "$VERSION atari800/configure.ac | grep $VERSION >/dev/null |
| 44 | if [ $? -ne 0 ]; then |
| 45 | echo "ERROR: increase version in configure.ac" |
| 46 | exit 1 |
| 47 | fi |
| 48 | # |
| 49 | cd atari800 |
| 50 | ./autogen.sh |
| 51 | # remove leftovers from autogen process |
| 52 | rm -f autogen.sh config.cache config.log |
| 53 | rm -rf autom4te.cache |
| 54 | cd .. |
| 55 | mv atari800 $FOLDER |
| 56 | GZIP=--best tar chozvf $FNAME $FOLDER |