Revision 66ff08f00acc06131fe610be0f9878a6c78bfe44 authored by Software Heritage on 10 January 2019, 12:27:59 UTC, committed by Software Heritage on 10 January 2019, 12:27:59 UTC
0 parent
pack.sh
#!/usr/bin/bash
# Script name : pack.sh
# Purpose : application deployment ; WINDOWS ONLY
# Details
# Packs up the application executable and all the DLL needed by the application in one
# 7z archive.
# Use the "extract here" command to install.
# Set main project name here :
PROJECT=libszdist
# list of subprojects (separate by spaces) :
SUBPRJ=(szdist szconv)
# Libraries to pack (separate by spaces) :
LIBS=(libszdist)
# Build root directory
BUILD=/E/home/picard/develop/pc/projets/build
# set version :
VMJ=`grep -e "^VMJ" libszdist/libszdist.pri | sed -e "s/\(VM.=\)\(.*\)/\2/"`
VMN=`grep -e "^VMN" libszdist/libszdist.pri | sed -e "s/\(VM.=\)\(.*\)/\2/"`
VMC=`grep -e "^VMC" libszdist/libszdist.pri | sed -e "s/\(VM.=\)\(.*\)/\2/"`
VERSION=$VMJ.$VMN.$VMC
echo "$PROJECT v$VERSION"
TMP_DIR=./"$PROJECT"_win
#QWT_DIR=/C/lib/Qwt/6.0.1
# Terminates the script.
# Usage : command || terminate
# terminate is executed if command returns non-zero.
function terminate
{
echo "<<< Error !!! >>>"
exit 1
}
mkdir -p $TMP_DIR || terminate
# Dependencies
# ------------
cp /e/home/picard/bin/mingwm10.dll $TMP_DIR || terminate
cp $QTDIR/bin/libgcc_s_dw2-1.dll $TMP_DIR || terminate
cp $QTDIR/bin/libstdc++-6.dll $TMP_DIR || terminate
cp $QTDIR/bin/libwinpthread-1.dll $TMP_DIR || terminate
# Executable projects
# -------------------
for pro in "${SUBPRJ[@]}"; do
cp $BUILD/$pro-release/release/$pro.exe $TMP_DIR
done
# Library projects
# ----------------
for lib in "${LIBS[@]}"; do
for dll in "$BUILD/$lib-release/release/*.dll"; do
cp $dll $TMP_DIR
done
done
# Compress and clean-up
# ---------------------
rm -f "$PROJECT-v$VERSION".7z
7z a "$PROJECT-v$VERSION".7z $TMP_DIR/*
rm -rf $TMP_DIR
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...