andre@760: #!/bin/bash andre@760: # Helper script to package the files expected by the -admin application andre@760: # Windows build is expected to live in CMAKE_SOURCE_DIR/build-windows andre@760: set -x andre@760: set -e andre@760: andre@831: if [ ! -x `which wine` ]; then andre@831: echo "ERROR: Could not find wine." andre@831: exit 1 andre@831: fi andre@831: andre@885: if [ ! -f @CMAKE_SOURCE_DIR@/build-windows/Makefile ]; then andre@885: echo "Could not find a windows build in: @CMAKE_SOURCE_DIR@/build-windows " andre@885: exit 1 andre@885: fi andre@885: andre@885: if [ ! -f @CMAKE_SOURCE_DIR@/build-i386/Makefile ]; then andre@885: echo "Could not find a i386 build in: @CMAKE_SOURCE_DIR@/build-i386 " andre@885: exit 1 andre@885: fi andre@885: andre@760: TMPD=$(mktemp -d) andre@760: TMPDIR=$TMPD/TrustBridge-@PROJECT_VERSION@ andre@885: cd @CMAKE_SOURCE_DIR@/build-windows andre@885: echo "Updating windows build" andre@887: make -j`nproc` andre@885: cd @CMAKE_SOURCE_DIR@/build-i386 andre@885: echo "Building x86 package" andre@887: make -j`nproc` andre@885: /bin/bash packaging/linux-createpackage.sh andre@760: cd @CMAKE_BINARY_DIR@ andre@885: echo "Building amd64 package" andre@760: /bin/bash packaging/linux-createpackage.sh andre@760: mkdir -p $TMPDIR/linux andre@760: mkdir -p $TMPDIR/windows andre@885: mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh \ andre@885: $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-amd64.sh andre@885: mv @CMAKE_SOURCE_DIR@/build-i386/TrustBridge-@PROJECT_VERSION@.sh \ andre@885: $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-i386.sh andre@760: cp @CMAKE_SOURCE_DIR@/build-windows/ui/trustbridge.exe $TMPDIR/windows andre@760: cp @CMAKE_SOURCE_DIR@/build-windows/cinst/cinst.exe $TMPDIR/windows andre@760: cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows andre@963: cp @CMAKE_BINARY_DIR@/manuals/help-manual/html $TMPDIR/windows/doc andre@963: andre@760: cp @CMAKE_SOURCE_DIR@/packaging/filelist.nsh $TMPDIR andre@760: cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR andre@760: cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources andre@760: LC_ALL="de_DE.latin-1" echo "company=Bundesamt für Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini andre@794: EST_SIZE=$(du -s $TMPDIR/windows | cut -f 1) andre@760: echo "version_number=@PROJECT_VERSION@" >> $TMPDIR/meta.ini andre@760: echo "setupname=%1TrustBridge-@PROJECT_VERSION@.exe" >> $TMPDIR/meta.ini andre@760: echo "productname=TrustBridge" >> $TMPDIR/meta.ini andre@852: echo "info_url=http://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ini andre@820: echo "productname_short=TrustBridge" >> $TMPDIR/meta.ini andre@820: echo "description=TrustBridge" >> $TMPDIR/meta.ini andre@794: echo "size=$EST_SIZE" >> $TMPDIR/meta.ini andre@831: andre@831: # Create a temporary NSIS file for the uninstaller cration andre@831: LC_ALL="de_DE.latin-1" makensis -Dfiles_dir=$TMPDIR/windows \ andre@831: -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \ andre@831: -Dversion_number=@PROJECT_VERSION@ \ andre@831: -Dsetupname="$TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe" \ andre@831: -Dproductname="TrustBridge" \ andre@831: -Dpath_sep="/" \ andre@852: -Dinfo_url="http://wald.intevation.org/projects/trustbridge/" \ andre@831: -Dsize=$EST_SIZE \ andre@831: -DWRITE_UNINSTALLER \ andre@831: -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi andre@831: wine $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe /S || true andre@831: mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR/windows andre@831: rmdir ~/.wine/drive_c/tmp-uninstaller andre@831: rm $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe andre@831: andre@760: cd $TMPD andre@760: zip -r TrustBridge-@PROJECT_VERSION@.zip TrustBridge-@PROJECT_VERSION@ andre@760: mv TrustBridge-@PROJECT_VERSION@.zip @CMAKE_BINARY_DIR@ andre@760: rm -r $TMPD andre@760: echo "Package is: @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.zip"