2011-02-06 09:18:43 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DATE=`date +%d.%m.%Y`
|
|
|
|
[ -z "$ARCH" ] && ARCH=`${PREFIX}gcc -dumpmachine | cut -d- -f1`
|
2012-03-04 18:15:01 +01:00
|
|
|
VERSION=`cat src/controller/KissCount.hpp | grep APP_VERSION | cut -d\" -f2`
|
2011-02-06 09:18:43 +01:00
|
|
|
DIR="KissCount_build_${VERSION}_${DATE}_${ARCH}"
|
2012-03-04 18:15:01 +01:00
|
|
|
FILE="$DIR.zip"
|
2011-02-06 09:18:43 +01:00
|
|
|
|
2012-06-07 19:48:52 +02:00
|
|
|
[ -f "$FILE" ] && rm -f "$FILE"
|
|
|
|
[ -d "$DIR" ] && rm -rf "$DIR"
|
2011-02-06 09:18:43 +01:00
|
|
|
if [ "$1" == "clean" ] ; then
|
|
|
|
make clean
|
|
|
|
fi
|
|
|
|
make || (echo "Compilation failed" ; exit 1)
|
2012-06-07 19:48:52 +02:00
|
|
|
rm -rf "$DIR"
|
2011-02-06 09:18:43 +01:00
|
|
|
mkdir -p "$DIR"
|
2012-03-04 18:15:01 +01:00
|
|
|
cp -r lib/*.dll* "$DIR"
|
|
|
|
cp -r kc ressources TODO CONTRIBUTORS COPYING README README.fr www "$DIR"
|
2012-06-07 19:52:51 +02:00
|
|
|
rm -rf "$DIR"/ressources/po/*
|
2012-06-01 21:36:58 +02:00
|
|
|
cp -r ressources/po/*.qm "$DIR/ressources/po/" # Copy only QM files
|
2012-03-04 18:15:01 +01:00
|
|
|
mv "$DIR"/kc "$DIR"/kc.exe
|
2011-02-06 09:18:43 +01:00
|
|
|
find "$DIR" -type f -executable -exec ${PREFIX}strip \{\} \;
|
2012-03-13 20:28:13 +01:00
|
|
|
zip -r "$FILE" "$DIR"
|
2011-02-06 09:18:43 +01:00
|
|
|
rm -rf "$DIR"
|
|
|
|
echo "Packaged into $FILE !"
|