view packaging/create-dist-package.sh.in @ 1175:e210ecc32d69

(issue128) Rename mozilla process to trustbridge-nss-installer
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 22 Sep 2014 11:19:43 +0200
parents a974b61a5cce
children c8f698ca6355
line wrap: on
line source
#!/bin/bash

# Copyright (C) 2014 by Bundesamt f�r Sicherheit in der Informationstechnik
# Software engineering by Intevation GmbH
#
# This file is Free Software under the GNU GPL (v>=2)
# and comes with ABSOLUTELY NO WARRANTY!
# See LICENSE.txt for details.


# 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/trustbridge-nss-installer.exe $TMPDIR/windows
cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources
cp @CMAKE_SOURCE_DIR@/build-windows/packaging/DesktopShellRun.dll $TMPDIR/resources
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
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" \
    -Dplugin_dir="$TMPDIR/resources" \
    -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/