view packaging/create-dist-package.sh.in @ 1047:f148149c9b09

Added tag 0.9.1 for changeset e10bc7372545
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 04 Sep 2014 16:15:11 +0200
parents cbd32175c56c
children 1c1964c27b39
line wrap: on
line source
#!/bin/bash
# Helper script to package the files expected by the -admin application
# Windows build is expected to live in CMAKE_SOURCE_DIR/build-windows
set -x
set -e

if [ ! -x `which wine` ]; then
    echo "ERROR: Could not find wine."
    exit 1
fi

if [ ! -f @CMAKE_SOURCE_DIR@/build-windows/Makefile ]; then
    echo "Could not find a windows build in: @CMAKE_SOURCE_DIR@/build-windows "
    exit 1
fi

if [ ! -f @CMAKE_SOURCE_DIR@/build-i386/Makefile ]; then
    echo "Could not find a i386 build in: @CMAKE_SOURCE_DIR@/build-i386 "
    exit 1
fi

TMPD=$(mktemp -d)
TMPDIR=$TMPD/TrustBridge-@PROJECT_VERSION@
cd @CMAKE_SOURCE_DIR@/build-windows
echo "Updating windows build"
make -j`nproc`
cd @CMAKE_SOURCE_DIR@/build-i386
echo "Building x86 package"
make -j`nproc`
/bin/bash packaging/linux-createpackage.sh i386
cd @CMAKE_BINARY_DIR@
echo "Building amd64 package"
/bin/bash packaging/linux-createpackage.sh x86_64
mkdir -p $TMPDIR/linux
mkdir -p $TMPDIR/windows
mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh \
    $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-amd64.sh
mv @CMAKE_SOURCE_DIR@/build-i386/TrustBridge-@PROJECT_VERSION@.sh \
    $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-i386.sh
cp @CMAKE_SOURCE_DIR@/build-windows/ui/trustbridge.exe $TMPDIR/windows
cp @CMAKE_SOURCE_DIR@/build-windows/cinst/cinst.exe $TMPDIR/windows
cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows
cp -r @CMAKE_BINARY_DIR@/manuals/help-manual/html $TMPDIR/windows/doc

cp @CMAKE_SOURCE_DIR@/packaging/filelist.nsh $TMPDIR
cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR
cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources
LC_ALL="de_DE.latin-1" echo "company=Bundesamt f�r Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini
EST_SIZE=$(du -s $TMPDIR/windows | cut -f 1)
echo "version_number=@PROJECT_VERSION@" >>  $TMPDIR/meta.ini
echo "setupname=%1TrustBridge-@PROJECT_VERSION@.exe" >> $TMPDIR/meta.ini
echo "productname=TrustBridge" >> $TMPDIR/meta.ini
echo "info_url=http://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ini
echo "productname_short=TrustBridge" >> $TMPDIR/meta.ini
echo "description=TrustBridge" >> $TMPDIR/meta.ini
echo "size=$EST_SIZE" >> $TMPDIR/meta.ini

# Create a temporary NSIS file for the uninstaller cration
LC_ALL="de_DE.latin-1" makensis -Dfiles_dir=$TMPDIR/windows \
    -Dcompany="Bundesamt f�r Sicherheit in der Informationstechnik" \
    -Dversion_number=@PROJECT_VERSION@ \
    -Dsetupname="$TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe" \
    -Dproductname="TrustBridge" \
    -Dpath_sep="/" \
    -Dinfo_url="http://wald.intevation.org/projects/trustbridge/" \
    -Dsize=$EST_SIZE \
    -DWRITE_UNINSTALLER \
    -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi
wine $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe /S || true
mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR/windows
rmdir ~/.wine/drive_c/tmp-uninstaller
rm $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe

cd $TMPD
zip -r TrustBridge-@PROJECT_VERSION@.zip TrustBridge-@PROJECT_VERSION@
mv TrustBridge-@PROJECT_VERSION@.zip @CMAKE_BINARY_DIR@
rm -r $TMPD
echo "Package is: @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.zip"

http://wald.intevation.org/projects/trustbridge/