2010-08-06 22:03:53 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DATE=`date +%d.%m.%Y`
|
2011-02-06 09:18:43 +01:00
|
|
|
[ -z "$ARCH" ] && ARCH=`${PREFIX}gcc -dumpmachine | cut -d- -f1`
|
2010-12-03 19:21:08 +01:00
|
|
|
VERSION=`cat src/controller/KissCount.h | grep APP_VERSION | cut -d\" -f2`
|
|
|
|
DIR="KissCount_build_${VERSION}_${DATE}_${ARCH}"
|
2010-08-06 22:03:53 +02:00
|
|
|
FILE="$DIR.tar.bz2"
|
2011-03-05 12:26:35 +01:00
|
|
|
DEB_DIR="kisscount-${VERSION}"
|
|
|
|
DEB_FILE="$DEB_DIR.tar.gz"
|
|
|
|
DEBEMAIL=soutade@gmail.com
|
|
|
|
DEBFULLNAME="Grégory Soutadé"
|
|
|
|
export DEBEMAIL DEBFULLNAME
|
2010-08-06 22:03:53 +02:00
|
|
|
|
2011-01-06 18:33:26 +01:00
|
|
|
rm -f "$FILE"
|
|
|
|
rm -rf "$DIR"
|
2010-08-20 21:33:59 +02:00
|
|
|
if [ "$1" == "clean" ] ; then
|
2010-08-06 22:03:53 +02:00
|
|
|
make clean
|
2010-08-20 21:33:59 +02:00
|
|
|
fi
|
2010-08-06 22:03:53 +02:00
|
|
|
make || (echo "Compilation failed" ; exit 1)
|
2011-01-06 18:33:26 +01:00
|
|
|
mkdir -p "$DIR"/lib
|
|
|
|
cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* "$DIR"/lib
|
2011-03-06 17:20:42 +01:00
|
|
|
cp -r kc ressources tools/launch_kc.sh TODO CONTRIBUTORS COPYING README* www "$DIR"
|
2011-01-25 20:26:29 +01:00
|
|
|
find "$DIR" -type f -executable -exec ${PREFIX}strip \{\} \;
|
2011-01-06 18:33:26 +01:00
|
|
|
tar -jcf "$FILE" "$DIR"
|
|
|
|
rm -rf "$DIR"
|
2011-03-05 12:26:35 +01:00
|
|
|
|
|
|
|
# Debian packaging
|
|
|
|
rm -rf "$DEB_DIR" "$DEB_FILE"
|
|
|
|
mkdir -p "$DEB_DIR/lib"
|
|
|
|
cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* "$DEB_DIR/lib"
|
2011-03-06 17:20:42 +01:00
|
|
|
cp -r kc.1 kc debian README* ChangeLog TODO CONTRIBUTORS ressources "$DEB_DIR"
|
2011-03-05 12:26:35 +01:00
|
|
|
#tar -zcf "$DEB_FILE" "$DEB_DIR"
|
|
|
|
cd "$DEB_DIR"
|
|
|
|
mv debian/Makefile .
|
|
|
|
ln -s ../../src
|
|
|
|
#sed -i s/i686/$ARCH/g debian/control
|
|
|
|
#dh_make -f "../$DEB_FILE" --copyright gpl3 --email $DEBEMAIL -s
|
|
|
|
[ "${ARCH}" == "x86_64" ] && ARCH="amd64"
|
|
|
|
debuild -us -uc -b -i -a${ARCH}
|
|
|
|
cd -
|
|
|
|
|
|
|
|
echo "Packaged into $FILE and kisscount_${VERSION}-1_${ARCH}.deb !"
|