We collect installation packages from Qt projects in an adult way

    By trial and error, I invented another bike, which I’m going to tell you below. It will be about building packages from Qt projects for Debian and Rpm based systems, Windows from under Ubuntu / Debian. In principle, the method is very simple, therefore, I think that with small changes it will be suitable for rpb based distributions, and for Windows systems cygwin installation will be required. In addition, this topic is very little discussed on the Internet, although I would not call the assembly of cross-platform applications in installation packages are a simple task. Who will be interested in this material:
    • primarily for beginner Qt developers who want to distribute their applications in a user-friendly way;
    • developers using other programming languages ​​(with small changes, you can get.
    I have confidence that all the actions described below could be done with a make script, but the current version is also good and has a right to exist. Also, if you use any other method to automatically build projects, please describe it. As a result, I would like to collect as much information as possible on this topic. A small introduction. In the article, I will provide ready-made scripts for my open source project, which I wrote about earlier here . Part 1. Installation and configuration And so, first of all, we need to install the following packages:
    sudo aptitude install build-essential dh-make mingw32 alien wine qt4-dev-tools
    I might have forgotten to add some packages here, but you will learn about their shortage when running the script. You can also do without qt4-dev-tools by specifying in PATH and LD_LIBRARY_PATH the path to your qmake and qt libraries from Qt-Sdk downloaded from the site Nokia
    For example, writing the paths in ~ / .bashrc :
    export PATH=~/qtsdk-2010.01/qt/bin/:$PATH

    export LD_LIBRARY_PATH=~/qtsdk-2010.01/qt/lib/:$LD_LIBRARY_PATH
    We also need to download and install the Nullsoft Scriptable Install System under wine, we will need it to create installation packages for Windows. After installing NSIS, we need a little setup.
    wine regedit
    Add the Environment key to HKEY_CURRENT_USER, in which we create two string values:
    • NSISDIR - C: \ Program Files \ NSIS
    • PATH - C: \ Program Files \ NSIS
    As a result of such a simple procedure, we can call wine makensis in any directory, which will allow us to refuse to indicate the full paths to makensis in the future. Part 2. We write scripts Compilation of qt-projects for Windows from under Linux For cross-compilation we need mingw32, which we have already installed, as well as our own configuration settings for qmake. The configuration for qmake, on the basis of which we will make our own, can be found by following way:
    $ QT_SDK_INSTALL_DIR / qt / mkspecs.
    We copy win32-g ++ to the directory with our project, renaming it win32-x-g ++. Next, edit qmake.conf, replacing the mingw32 calls, Windows commands with Linux commands. In essence, we should get a file with the following contents:
    #
    # qmake configuration for win32-g++
    #
    # Written for MinGW
    #
    MAKEFILE_GENERATOR    = MINGW
    TEMPLATE        = app
    CONFIG            += qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target precompile_header
    QT            += core gui
    DEFINES            += UNICODE QT_LARGEFILE_SUPPORT
    QMAKE_COMPILER_DEFINES  += __GNUC__ WIN32
    QMAKE_EXT_OBJ           = .o
    QMAKE_EXT_RES           = _res.o
    QMAKE_CC        = gcc
    QMAKE_LEX        = flex
    QMAKE_LEXFLAGS        =
    QMAKE_YACC        = byacc
    QMAKE_YACCFLAGS        = -d
    QMAKE_CFLAGS        =
    QMAKE_CFLAGS_DEPS    = -M
    QMAKE_CFLAGS_WARN_ON    = -Wall
    QMAKE_CFLAGS_WARN_OFF    = -w
    QMAKE_CFLAGS_RELEASE    = -O2
    QMAKE_CFLAGS_DEBUG    = -g
    QMAKE_CFLAGS_YACC    = -Wno-unused -Wno-parentheses
    QMAKE_CXX        = i586-mingw32msvc-g++
    QMAKE_CXXFLAGS        = $$QMAKE_CFLAGS
    QMAKE_CXXFLAGS_DEPS    = $$QMAKE_CFLAGS_DEPS
    QMAKE_CXXFLAGS_WARN_ON    = $$QMAKE_CFLAGS_WARN_ON
    QMAKE_CXXFLAGS_WARN_OFF    = $$QMAKE_CFLAGS_WARN_OFF
    QMAKE_CXXFLAGS_RELEASE    = $$QMAKE_CFLAGS_RELEASE
    QMAKE_CXXFLAGS_DEBUG    = $$QMAKE_CFLAGS_DEBUG
    QMAKE_CXXFLAGS_YACC    = $$QMAKE_CFLAGS_YACC
    QMAKE_CXXFLAGS_THREAD    = $$QMAKE_CFLAGS_THREAD
    QMAKE_CXXFLAGS_RTTI_ON    = -frtti
    QMAKE_CXXFLAGS_RTTI_OFF    = -fno-rtti
    QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
    QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
    QMAKE_INCDIR        =
    QMAKE_INCDIR_QT        = $$[QT_WIN_INCLUDE_PATH]
    QMAKE_LIBDIR_QT        = $$[QT_WIN_LIB_PATH]
    QMAKE_RUN_CC        = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CC_IMP    = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
    QMAKE_RUN_CXX        = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CXX_IMP    = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    QMAKE_LINK        = i586-mingw32msvc-g++
    QMAKE_LINK_C        = gcc
    QMAKE_LFLAGS        = -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import \
       -Wl,-enable-runtime-pseudo-reloc -mwindows
    QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
    QMAKE_LFLAGS_EXCEPTIONS_OFF =
    QMAKE_LFLAGS_RELEASE    = -Wl,-s
    QMAKE_LFLAGS_DEBUG    =
    QMAKE_LFLAGS_CONSOLE    = -Wl,-subsystem,console
    QMAKE_LFLAGS_WINDOWS    = -Wl,-subsystem,windows
    QMAKE_LFLAGS_DLL        = -shared
    QMAKE_LINK_OBJECT_MAX    = 10
    QMAKE_LINK_OBJECT_SCRIPT= object_script
    QMAKE_LIBS        =
    QMAKE_LIBS_CORE         = -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
    QMAKE_LIBS_GUI          = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
    QMAKE_LIBS_NETWORK      = -lws2_32
    QMAKE_LIBS_OPENGL       = -lopengl32 -lglu32 -lgdi32 -luser32
    QMAKE_LIBS_COMPAT       = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
    QMAKE_LIBS_QT_ENTRY     = -lmingw32 -lqtmain
    !isEmpty(QMAKE_SH) {
        MINGW_IN_SHELL      = 1
        QMAKE_DIR_SEP        = /
        QMAKE_COPY        = cp
        QMAKE_COPY_DIR        = xcopy /s /q /y /i
        QMAKE_MOVE        = mv
        QMAKE_DEL_FILE        = rm
        QMAKE_MKDIR        = mkdir
        QMAKE_DEL_DIR        = rmdir
        QMAKE_CHK_DIR_EXISTS = test -d
    } else {
        QMAKE_COPY        = copy /y
        QMAKE_COPY_DIR        = xcopy /s /q /y /i
        QMAKE_MOVE        = move
        QMAKE_DEL_FILE        = del
        QMAKE_MKDIR        = mkdir
        QMAKE_DEL_DIR        = rmdir
        QMAKE_CHK_DIR_EXISTS    = if not exist
    }
    QMAKE_MOC        = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc
    QMAKE_UIC        = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic
    QMAKE_IDC        = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc
    QMAKE_IDL        = midl
    QMAKE_LIB        = ar -ru
    QMAKE_RC        = i586-mingw32msvc-windres
    QMAKE_ZIP        = zip -r -9
    QMAKE_STRIP        = i586-mingw32msvc-strip
    QMAKE_STRIPFLAGS_LIB     += --strip-unneeded
    load(qt_config)
    More information about cross compilation can be found here . Edit the project file (.pro). These additions in the file are needed in order for the install option to appear in the Makefile generated by qmake.
    unix { 
        # VARIABLES
        isEmpty(PREFIX):PREFIX = /usr/local #PREFIX - это путь установки
        BINDIR = $$PREFIX/bin # путь к бинарникам
        DATADIR = $$PREFIX/share # путь к различным компонентам приложения, от которых можно отказаться
        DEFINES += DATADIR=\"$$DATADIR\" \
            PKGDATADIR=\"$$PKGDATADIR\"
        # MAKE INSTALL
        INSTALLS += target \
            desktop \
            pixmaps \
            icon22 \
            templates1 \
            templates2 \
            pagetemplates # оставив в INSTALLS только target, также по аналогии можно добавить и инсталяцию библиотек в нужные директории
        target.path = $$BINDIR
        desktop.path = $$DATADIR/applications/
        desktop.files += $${TARGET}.desktop
        pixmaps.path = $$DATADIR/pixmaps/
        pixmaps.files += images/$${TARGET}.png
        icon22.path = $$DATADIR/icons/hicolor/22x22/apps/
        icon22.files += images/$${TARGET}.png
        templates1.path = $$DATADIR/yourownnewsmaker/templates/default/
        templates1.files = templates/default/*.*
        templates2.path = $$DATADIR/yourownnewsmaker/templates/eeex-sony-pdf/
        templates2.files = templates/eeex-sony-pdf/*.*
        pagetemplates.path = $$DATADIR/yourownnewsmaker/page-templates/
        pagetemplates.files = page-templates/*.*
    }
    
    If we want our Windows application to have its own icon, then we need to add the following lines to the project file:
    win32:RC_FILE = icons.rc
    And create the icons.rc file with the following contents
    IDI_ICON1               ICON    DISCARDABLE     "путь/к/Вашей/иконке.ico"
    
    Build deb packages. Control and changelog files are very standard and I think they do not need to be described once again. You can see examples of my files by downloading the archive with scripts. I draw attention to the fact that tabs are not used in all scripts. This is very important for NSIS and for dh_make.Rules had to be completely replaced, but as a result we get a very universal file in which we need to specify only APPNAME.
    #!/usr/bin/make -f
    APPNAME := yourownnewsmaker
    builddir:
        mkdir -p builddir
    builddir/Makefile: builddir
        cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro -spec linux-g++ -r 
    build: build-stamp
    build-stamp: builddir/Makefile
        dh_testdir
        # Add here commands to compile the package.
        cd builddir && $(MAKE)
        touch $@
    clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp
        # Add here commands to clean up after the build process.
        rm -rf builddir
        dh_clean
    install: build
        dh_testdir
        dh_testroot
        dh_clean -k
        dh_installdirs
        # Add here commands to install the package into debian/your_appname
        #cd builddir && $(MAKE) install
        cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install
        #cd builddir && $(MAKE) install
    binary-indep: build install
    binary-arch: build install
        dh_testdir
        dh_testroot
        dh_installdocs
        dh_installexamples
        dh_installman
        dh_link
        dh_compress
        dh_fixperms
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb
    binary: binary-indep binary-arch
    .PHONY: build clean binary-indep binary-arch binary install configurege
    
    Changelog - the following is an example, note that the file does not use tabs.
    yourownnewsmaker (1.3) karmic; urgency=low
        * Added new template for sony e-readers;
        * Added new file pdf-print.properties in templates;
        * Fixed installer for windows;
     -- Valery Konchin   Mon, 1 Mar 2010 00:00:00 +0300
    
    Here you can read a little more about creating deb packages from qt projects. NSIS script for Windows. I wrote this script based on examples and it does not contain anything superfluous, just showing the license, choosing the path to install and installing the application itself. You only need to change the paths in the script to your own. Content of the script:
    ; Turn off old selected section
    ; 12 06 2005: Luis Wong
    ; Template voor het genereren van een installer.
    ; speciaal voor het genereren van EasyPlayer installers.
    ; Trimedia Interactive Projects
    ; -------------------------------
    ; Start
      !define MUI_PRODUCT "yourownnewsmaker"
      !define MUI_FILE "yourownnewsmaker"
      !define MUI_VERSION "1.3"
      !define MUI_BRANDINGTEXT "Your Own New Maker Ver. ${MUI_VERSION}"
      CRCCheck On
      ; Bij deze moeten we waarschijnlijk een absoluut pad gaan gebruiken
      ; dit moet effe uitgetest worden.
      !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
    ;--------------------------------
    ;General
      Name "${MUI_BRANDINGTEXT}"
      OutFile "../yourownnewsmaker-install-v.${MUI_VERSION}.exe"
      ShowInstDetails "nevershow"
      ShowUninstDetails "nevershow"
      ;SetCompressor "bzip2"
      !define MUI_ICON "images/yourownnewsmaker.ico"
      !define MUI_UNICON "images/yourownnewsmaker.ico"
      ;!define MUI_SPECIALBITMAP "Bitmap.bmp"
      ; Request application privileges for Windows Vista
      RequestExecutionLevel user
    ;--------------------------------
    ;Folder selection page
      InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
    ;--------------------------------
    ;Modern UI Configuration
      !define MUI_WELCOMEPAGE  
      !define MUI_LICENSEPAGE
      !define MUI_DIRECTORYPAGE
      !define MUI_ABORTWARNING
      !define MUI_UNINSTALLER
      !define MUI_UNCONFIRMPAGE
      !define MUI_FINISHPAGE  
    ;--------------------------------
    ;Pages
      !insertmacro MUI_PAGE_WELCOME
      !insertmacro MUI_PAGE_LICENSE "license"
      !insertmacro MUI_PAGE_COMPONENTS
      !insertmacro MUI_PAGE_DIRECTORY
      !insertmacro MUI_PAGE_INSTFILES
      !insertmacro MUI_PAGE_FINISH
      !insertmacro MUI_UNPAGE_WELCOME
      !insertmacro MUI_UNPAGE_CONFIRM
      !insertmacro MUI_UNPAGE_INSTFILES
      !insertmacro MUI_UNPAGE_FINISH
    ;--------------------------------
    ;Language
      !insertmacro MUI_LANGUAGE "English"
    ;-------------------------------- 
    ;Modern UI System
      ;!insertmacro MUI_SYSTEM 
      !include "MUI2.nsh"
    ;--------------------------------
    ;Data
      LicenseData "license"
    ;-------------------------------- 
    ;Installer Sections     
    Section "Your Own News Maker  (required)"
    ;Add files
      SetOutPath "$INSTDIR"
      File "${MUI_FILE}.exe"
      File "*.dll"
      File "license"
      File "changes"
      SetOutPath "$INSTDIR\page-templates"
      file "page-templates\*.properties"
      SetOutPath "$INSTDIR\templates\eeex-sony-pdf"
      file "templates\eeex-sony-pdf\*.*"
      SetOutPath "$INSTDIR\templates\default"
      file "templates\default\*.*"
      ;file "templates\*.html"
      ; file "page-templates\*.properties"
      ; SetOutPath "$INSTDIR\data"
      ; file "data\*.cst"
      ; file "data\errorlog.txt"
      ; hier komen dan nog de bestanden die in de playlist staan
      ; SetOutPath "$INSTDIR"  
      ; file /r mpg
      ; SetOutPath "$INSTDIR"  
      ; file /r xtras  
    ;create desktop shortcut
      CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
    ;create start-menu items
      CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}"
      CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
      CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0
    ;write uninstall information to the registry
      WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
      WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
      WriteUninstaller "$INSTDIR\Uninstall.exe"
    SectionEnd
    ;--------------------------------    
    ;Uninstaller Section  
    Section "Uninstall"
    ;Delete Files 
      RMDir /r "$INSTDIR\*.*"    
    ;Remove the installation directory
      RMDir "$INSTDIR"
    ;Delete Start Menu Shortcuts
      Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
      Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
      RmDir  "$SMPROGRAMS\${MUI_PRODUCT}"
    ;Delete Uninstaller And Unistall Registry Entries
      DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
      DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"  
    SectionEnd
    ;--------------------------------    
    ;MessageBox Section
    ;Function that calls a messagebox when installation finished correctly
    Function .onInstSuccess
      MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}. Use the desktop icon to start the program."
    FunctionEnd
    Function un.onUninstSuccess
      MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."
    FunctionEnd
    ;eof
    
    Scripts for automatic assembly. Linux packages:
    #!/bin/sh
    #
    #
    BUILDDATE=$(date +%F)
    MAJORVERSION=`sed '/^\#/d' version.properties | grep 'major'  | tail -n 1 | sed 's/^.*=//;s/^[[:space:]]*//;s/[[:space:]]*$//'`
    MINORVERSION=`sed '/^\#/d' version.properties | grep 'minor'  | tail -n 1 | sed 's/^.*=//;s/^[[:space:]]*//;s/[[:space:]]*$//'`
    echo "Version: $MAJORVERSION.$MINORVERSION"
    echo "Build date: $BUILDDATE"
    BASEDIR="./"
    DEPLOYDIR="deploy/yourownnewsmaker-$MAJORVERSION.$MINORVERSION"
    PLATFORMDIR="linux"
    BUILDNAME="yourownnewsmaker-$MAJORVERSION.$MINORVERSION"
    RELEASEDIR="$DEPLOYDIR/$PLATFORMDIR/$BUILDNAME"
    echo "Build dir: $RELEASEDIR"
    rm -rf $DEPLOYDIR/$PLATFORMDIR/
    mkdir -p "$DEPLOYDIR/$PLATFORMDIR"
    svn export ./ $RELEASEDIR
    cd $RELEASEDIR
    sed -i "s/%test-major-version%/$MAJORVERSION/g" version.cpp
    sed -i "s/%test-minor-version%/$MINORVERSION/g" version.cpp
    sed -i "s/%test-date%/$BUILDDATE/g" version.cpp
    rm -rf *.rc
    rm -rf build-libs
    rm -rf win32-x-g++
    rm -rf linux-g++-qt4.5
    rm -rf *.user
    rm -rf *.sh
    rm -rf Makefile
    rm -rf *.properties
    rm -rf *.nsi
    rm -rf help
    mkdir src
    mv *.cpp src
    mv *.h src
    mv *.ui src
    mv yourownnewsmaker.pro src/src.pro
    mv *.qrc src
    mv images src
    mv page-templates src
    mv templates src
    mv yourownnewsmaker.desktop src
    mv changes src
    mv license src
    touch yourownnewsmaker.pro
    echo "QMAKEVERSION = $$[QMAKE_VERSION]" >> yourownnewsmaker.pro
    echo "ISQT4 = $$find(QMAKEVERSION, ^[2-9])" >> yourownnewsmaker.pro
    echo "isEmpty( ISQT4 ) {" >> yourownnewsmaker.pro
    echo "error(\"Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4\");" >> yourownnewsmaker.pro
    echo "}" >> yourownnewsmaker.pro
    echo "" >> yourownnewsmaker.pro
    echo "TEMPLATE = subdirs" >> yourownnewsmaker.pro
    echo "SUBDIRS  = src" >> yourownnewsmaker.pro
    export DEBFULLNAME="Valery Konchin"
    dh_make -e eeexception@gmail.com --createorig --single -c gpl
    mkdir debian
    mv rules debian/rules
    mv control debian/control
    mv changelog debian/changelog
    sed -i "s//http:\/\/eeexception.org/g" debian/copyright
    sed -i "s//Valery Konchin /g" debian/copyright
    sed -i "s///g" debian/copyright
    sed -i "s/Copyright (C) YYYY Firstname Lastname/Copyright (C) 2010 Valery Konchin/g" debian/copyright
    dpkg-buildpackage 
    rm -rf debian
    rm -rf builddir
    cd ../
    tar -pczf $BUILDNAME.tar.gz $BUILDNAME
    rm -rf $BUILDNAME
    
    Windows packages:
    #!/bin/sh
    #
    #
    BUILDDATE=$(date +%F)
    MAJORVERSION=`sed '/^\#/d' version.properties | grep 'major'  | tail -n 1 | sed 's/^.*=//;s/^[[:space:]]*//;s/[[:space:]]*$//'`
    MINORVERSION=`sed '/^\#/d' version.properties | grep 'minor'  | tail -n 1 | sed 's/^.*=//;s/^[[:space:]]*//;s/[[:space:]]*$//'`
    echo "Version: $MAJORVERSION.$MINORVERSION"
    echo "Build date: $BUILDDATE"
    BASEDIR="./"
    DEPLOYDIR="deploy/yourownnewsmaker-$MAJORVERSION.$MINORVERSION"
    PLATFORMDIR="windows"
    BUILDNAME="yourownnewsmaker-$MAJORVERSION.$MINORVERSION"
    RELEASEDIR="$DEPLOYDIR/$PLATFORMDIR/$BUILDNAME"
    echo "Build dir: $RELEASEDIR"
    rm -rf $DEPLOYDIR/$PLATFORMDIR/
    mkdir -p "$DEPLOYDIR/$PLATFORMDIR"
    svn export ./ $RELEASEDIR
    cd $RELEASEDIR
    sed -i "s/%test-major-version%/$MAJORVERSION/g" version.cpp
    sed -i "s/%test-minor-version%/$MINORVERSION/g" version.cpp
    sed -i "s/%test-date%/$BUILDDATE/g" version.cpp
    #устанавливаем необходимые пути
    QT_WIN_INSTALL_DIR=/home/exception/Development/qt-4.6.1-win
    QT_LIN_INSTALL_DIR=/home/exception/Development/qtsdk-2010.01/qt
    export LD_LIBRARY_PATH=$QT_LIN_INSTALL_DIR/lib:$LD_LIBRARY_PATH
    export PATH=$QT_LIN_INSTALL_DIR/bin:$PATH
    export QT_LINUX_BIN_PATH=$QT_LIN_INSTALL_DIR/bin
    export QT_WIN_INCLUDE_PATH=$QT_WIN_INSTALL_DIR/include
    export QT_WIN_LIB_PATH=$QT_WIN_INSTALL_DIR/lib
    qmake -set QT_WIN_INCLUDE_PATH $QT_WIN_INCLUDE_PATH
    qmake -set QT_WIN_LIB_PATH $QT_WIN_LIB_PATH
    #вот так выглядит запуск qmake с кросс компиляцией
    qmake yourownnewsmaker.pro -spec win32-x-g++ -r
    make
    cp -rf build-libs/win/*.dll ./
    cp -rf release/*.exe ./
    rm -rf images/*.png
    rm -rf *.rc
    rm -rf *.res
    rm -rf build-libs
    rm -rf win32-x-g++
    rm -rf linux-g++-qt4.5
    rm -rf *.user
    rm -rf *.sh
    rm -rf Makefile
    rm -rf *.properties
    rm -rf release
    rm -rf debug
    rm -rf *.desktop
    rm -rf Makefile.*
    rm -rf *.Debug
    rm -rf *.Release
    rm -rf control
    rm -rf changelog
    rm -rf rules
    rm -rf help
    rm -rf *.qrc
    rm -rf *.cpp
    rm -rf *.h
    rm -rf *.ui
    rm -rf *.pro
    #Данными командами мы заменяем переносы строк на виндовые
    sed -i s/$/'\r'/ templates/default/*.*
    sed -i s/$/'\r'/ templates/eeex-sony-pdf/*.*
    sed -i s/$/'\r'/ page-templates/*.properties
    sed -i s/$/'\r'/ license
    sed -i s/$/'\r'/ changes
    wine makensis.exe win.nsi
    rm -rf *.nsi
    cd ../
    zip -r $BUILDNAME.zip $BUILDNAME
    
    Part 3. Checking the results of work.As a result of running the scripts, we will receive in the deploy / deb, rpm directory, an archive with sources, as well as an archive with binaries and an installation package for Windows, which in my opinion is quite enough for most users. The deb and rpm packages generated in this way may not be ideal for inclusion in the repository, but they quite successfully install and update the application on the system. Ideally, the scripts still lack verification of the correct installation, as well as the functionality of the applications themselves, but for this you need to use some kind of GUI testing system that I am currently searching for. PS Due to the limitation on the size of the article, I put the whole scripts separately In addition, I recommend downloading them, as the parser of the site editor could swallow some symbols.http://dl.dropbox.com/u/930431/project-build-scripts.tar.gz .
    http://eeexception.org/project-build-scripts.tar.gz .
    http://yourownnewsmaker.googlecode.com/files/project-build-scripts.tar.gz .

    Also popular now: