#!/bin/bash DATE=`date +%d.%m.%Y` [ -z "$ARCH" ] && ARCH=`${PREFIX}gcc -dumpmachine | cut -d- -f1` VERSION=`cat src/controller/KissCount.h | grep APP_VERSION | cut -d\" -f2` DIR="KissCount_build_${VERSION}_${DATE}_${ARCH}" FILE="$DIR.tar.bz2" DEB_DIR="kisscount-${VERSION}" DEB_FILE="$DEB_DIR.tar.gz" DEBEMAIL=soutade@gmail.com DEBFULLNAME="Grégory Soutadé" export DEBEMAIL DEBFULLNAME rm -f "$FILE" rm -rf "$DIR" if [ "$1" == "clean" ] ; then make clean fi make || (echo "Compilation failed" ; exit 1) mkdir -p "$DIR"/lib cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* "$DIR"/lib cp -r kc ressources tools/launch_kc.sh TODO CONTRIBUTORS COPYING README* www "$DIR" find "$DIR" -type f -executable -exec ${PREFIX}strip \{\} \; tar -jcf "$FILE" "$DIR" rm -rf "$DIR" # 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" cp -r kc.1 kc debian README* ChangeLog TODO CONTRIBUTORS ressources "$DEB_DIR" #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 !"