aheinecke@575: Installation Instructions
aheinecke@575: *************************
aheinecke@575: 
aheinecke@575: For Debian based GNU / Linux
aheinecke@575: ============================
bernhard@598: Tested development platform: Ubuntu 13.10.
bernhard@598: 
aheinecke@575: The following commands build qt5 and polarssl which are dependencies of the Software.
aheinecke@575: For build dependencies please refer to the Qt documentation 
bernhard@598: ( qtbase/src/plugins/platforms/xcb/README ).
bernhard@598: Polarssl needs cmake and build-essentials.
aheinecke@575: 
aheinecke@575:     export YOURPREFIX=<Prefix of your choice (default /usr)>
aheinecke@577:     export PATH=$YOURPREFIX/bin:$PATH
aheinecke@575: 
aheinecke@575:     curl https://download.qt-project.org/official_releases/qt/5.3/5.3.0/single/qt-everywhere-opensource-src-5.3.0.tar.xz.mirrorlist | grep SHA-256
aheinecke@575: 
aheinecke@575: e6f47e69a5ce707452dd4bad1fd1919201a71e88be1b06afe1d302a3935daf1f
aheinecke@575: 
aheinecke@575:     http://qt-mirror.dannhauer.de/official_releases/qt/5.3/5.3.0/single/qt-everywhere-opensource-src-5.3.0.tar.xz
aheinecke@575: 
aheinecke@575:     sha256sum qt-everywhere-opensource-src-5.3.0.tar.xz
aheinecke@575: 
aheinecke@575:     tar -xvmlf qt-everywhere-opensource-src-5.3.0.tar.xz
aheinecke@575: 
aheinecke@575:     cd qt-everywhere-opensource-src-5.3.0/qtbase
aheinecke@575: 
aheinecke@575: build dependencies have to to be installed at this point,
aheinecke@575: see ../qtbase/src/plugins/platforms/xcb/README
aheinecke@575: 
aheinecke@575:     ./configure --prefix=$YOURPREFIX \
aheinecke@575:     -opensource \
aheinecke@575:     -release  -nomake tests  -nomake examples  -confirm-license \
andre@601:     -static -no-cups -no-nis -no-icu -fontconfig \
aheinecke@575:     -no-directfb -no-opengl -no-kms -no-eglfs -no-egl -no-openssl -no-glib
aheinecke@575:     nice make -j8
aheinecke@575:     make install
aheinecke@575: 
aheinecke@577:     cd qttools/src/linguist
aheinecke@577:     qmake
aheinecke@577:     nice make -j8
aheinecke@577:     make install -k
aheinecke@577: 
aheinecke@575:     curl -O https://polarssl.org/download/polarssl-1.3.7-gpl.tgz
aheinecke@575:     6beef0281160bf07fefefd6b412dd1ce4c39261cf5300835aef442253f0400e5  polarssl-1.3.7-gpl.tgz
aheinecke@575: 
aheinecke@575:     tar -xf polarssl-1.3.7-gpl.tgz
aheinecke@575:     cd polarssl-1.3.7
aheinecke@575:     mkdir build
aheinecke@575:     cd build
aheinecke@575:     cmake .. -DCMAKE_C_FLAGS=-fpic -DCMAKE_INSTALL_PREFIX=$YOURPREFIX
aheinecke@575:     make && make test && make install
aheinecke@575: 
aheinecke@575: To compile the software you can use plain cmake. An out of source build is
aheinecke@575: highly suggested. For build options see CMakeList.txt
aheinecke@575: 
aheinecke@575:     hg clone https://wald.intevation.org/hg/trustbridge/
aheinecke@575:     cd trustbridge
aheinecke@575:     mkdir build-linux
aheinecke@575:     cd build-linux
aheinecke@575:     cmake .. -DCMAKE_PREFIX_PATH=$YOURPREFIX
aheinecke@575: 
aheinecke@575: 
aheinecke@585: Hiawatha (for Downloader unit test)
aheinecke@585: ===================================
aheinecke@585: Hiawatha is used in the downloader unit tests to provide a testbench
aheinecke@585: for the ssl connection. To build it you may need libxslt-dev as additional
aheinecke@585: dependency.
aheinecke@585: 
aheinecke@585:     wget https://www.hiawatha-webserver.org/files/hiawatha-9.5.tar.gz
aheinecke@585:     sha256sum hiawatha-9.5.tar.gz
aheinecke@585: 
aheinecke@585: c181011db1af187006190fc186689a0707a6f1e7b524c2a4347840e8fdf68b4f  hiawatha-9.5.tar.gz
aheinecke@585: 
aheinecke@585:     tar -xf hiawatha-9.5.tar.gz
aheinecke@585:     cp polarssl-1.3.7-gpl.tgz hiawatha-9.5/polarssl/polarssl.tgz
aheinecke@585:     cd hiawatha-9.5/polarssl
aheinecke@585:     sed -i 's/wget.*//' upgrade
aheinecke@585:     ./upgrade 1.3.7
aheinecke@585:     cd ..
aheinecke@585:     mkdir build
aheinecke@585:     cd build
aheinecke@585:     cmake .. -DCMAKE_INSTALL_PREFIX=$YOURPREFIX
aheinecke@585:     make && make install
aheinecke@585: 
aheinecke@575: For Microsoft Windows
aheinecke@575: =====================
aheinecke@575: The Windows variant can be cross compiled on Debian based GNU / Linux systems.
bernhard@598: The minimum requirement is Debian stable.
bernhard@598: Tested development platform: Ubuntu 13.10.
aheinecke@575: 
aheinecke@575: Dependencies on the Host system:
aheinecke@575:     git autoconf automake bash bison bzip2 \
aheinecke@575:     cmake flex gettext git g++ intltool \
aheinecke@575:     libffi-dev libtool libltdl-dev libssl-dev \
aheinecke@575:     libxml-parser-perl make openssl patch perl \
aheinecke@575:     pkg-config scons sed unzip wget xz-utils autopoint \
aheinecke@575:     gperf
aheinecke@575: 
aheinecke@577: Build the windows binaries:
aheinecke@575:     MXEPATH=$YOURPREFIX/win
aheinecke@575:     git clone https://github.com/mxe/mxe.git $MXEPATH
aheinecke@575:     cd $MXEPATH
aheinecke@575:     echo "MXE_TARGETS := i686-w64-mingw32.static" > settings.mk
aheinecke@575:     make polarssl
aheinecke@575:     make qtbase
aheinecke@575: 
aheinecke@575: Workaround Qt CMake Bugs:
aheinecke@575:     find $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake -name \*.cmake | \
aheinecke@575:         xargs sed -i 's/\/\([a-z]*\)\.lib/\/lib\1\.a/g'
aheinecke@575:     sed -i 's/^_qt5gui_find_extra_libs.*//' \
aheinecke@575:         $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
aheinecke@575: 
aheinecke@575: Make an NSS build available in the MXE prefix:
aheinecke@575:     # TODO -> Document how to build NSS,..
aheinecke@575:     cp -r <magic nss folder> $MXEPATH/usr/i686-w64-mingw32.static/
aheinecke@575: 
aheinecke@575: Compile the software:
aheinecke@575:     cd trustbridge
aheinecke@575:     mkdir build-windows
aheinecke@575:     cd build-windows
aheinecke@575:     MXETARGET=$MXEPATH/usr/i686-w64-mingw32.static/
aheinecke@575:     cmake .. \
aheinecke@575:         -DCMAKE_PREFIX_PATH="$MXETARGET/qt5;$MXETARGET;" \
aheinecke@575:         -DNSS_INCLUDEDIR="/nss-3.12.7/include;/nss-3.12.7/public/nss" \
aheinecke@575:         -DNSS_LIBDIR="/nss-3.12.7/lib" \
aheinecke@575:         -DCMAKE_TOOLCHAIN_FILE="$MXETARGET/share/cmake/mxe-conf.cmake" \
aheinecke@575:         -DCMAKE_VERBOSE_MAKEFILE=True