#!/bin/sh mingwb="$(ls /usr/ | grep mingw32 | grep -v amd64 | head --lines 1)" #qmake="/usr/bin/qmake" #uic="/usr/bin/uic" #rcc="/usr/bin/rcc" #moc="/usr/bin/moc" qtwind="$(pwd)/winbuild/qt4.5-win" qtx11d="$(pwd)/winbuild/qt4.5-x11" if [ ! -f "embedfiles/sevnz.dll" ] || [ ! -f "embedfiles/sevnz.exe" ]; then svloc=$(wget "http://7-zip.org/" -O - | grep --ignore-case "a href=\"http://downloads.sourceforge.net/sevenzip/" | grep -v ".msi" | grep -v "x64" | tail --lines 1 | tr "<" "\n" | tr ">" "\n" | tr "\"" "\n" | grep "http://downloads.sourceforge.net/sevenzip/") wget "$svloc" -O sevenzip.exe svxloc=$(echo "$svloc" | sed 's/.exe/_extra.7z/') wget "$svxloc" -O sevenzip-extra.7z 7z e sevenzip.exe 7z.exe 7z.dll 7z e sevenzip-extra.7z 7zS.sfx mv 7z.exe embedfiles/sevnz.exe mv 7z.dll embedfiles/sevnz.dll mv 7zS.sfx embedfiles/7zS.sfx fi rvern="$(./vcs-revno)" mkdir -p release make clean rm Makefile* rm release/*.exe ./mkpotfile $qtx11d/bin/qmake -spec $qtx11d/mkspecs/win32-g++ "DEFINES += STATICWINDOWS" "QMAKE_CC = $mingwb-gcc" "QMAKE_CXX = $mingwb-g++" "QMAKE_INCDIR_QT = $qtwind/include" "QMAKE_LIBDIR_QT = $qtwind/lib" "QMAKE_LINK = $mingwb-g++" "QMAKE_COPY_DIR = cp -r" "QMAKE_COPY = cp" "QMAKE_COPY_DIR = cp -r" "QMAKE_MOVE = mv" "QMAKE_DEL_FILE = rm" "QMAKE_CHK_DIR_EXISTS = test -d" "QMAKE_QMAKE = $qtx11d/bin/qmake" "QMAKE_MOC = $qtx11d/bin/moc" "QMAKE_UIC = $qtx11d/bin/uic" "QMAKE_RCC = $qtx11d/bin/rcc" "QMAKE_RC = $mingwb-windres" "RESOURCES += tuxboot-windows.qrc" "QMAKE_LFLAGS += -Wl,-subsystem,windows" "RC_FILE += tuxboot.rc" "$@" #qmake -spec win32-g++ "DEFINES += STATICWINDOWS" "QMAKE_CC = $mingwb-gcc" "QMAKE_CXX = $mingwb-g++" "QMAKE_INCDIR_QT = $qtwind/include" "QMAKE_LIBDIR_QT = $qtwind/lib" "QMAKE_LINK = $mingwb-g++" "QMAKE_COPY_DIR = cp -r" "QMAKE_COPY = cp" "QMAKE_COPY_DIR = cp -r" "QMAKE_MOVE = mv" "QMAKE_DEL_FILE = rm" "QMAKE_CHK_DIR_EXISTS = test -d" "QMAKE_QMAKE = $qmake" "QMAKE_MOC = $moc" "QMAKE_UIC = $uic" "QMAKE_RCC = $rcc" "QMAKE_RC = $mingwb-windres" "RESOURCES += tuxboot-windows.qrc" "QMAKE_LFLAGS += -Wl,-subsystem,windows" "RC_FILE += tuxboot.rc" "$@" make $mingwb-strip --strip-all release/tuxboot.exe mv release/tuxboot.exe release/tuxboot-windows-$rvern.exe ./upx --lzma release/tuxboot-windows-$rvern.exe rm sevenzip* make clean