#!/bin/sh

rvern="$(bzr version-info | grep revno | sed 's/revno: //')"
rm release/*
#qmake -spec win32-static "DEFINES += AUTOSUPERGRUBDISK" "RESOURCES += unetbootin-windows.qrc unetbootin-autosupergrubdisk.qrc" "RC_FILE += ubnembed.rc" "QMAKE_LFLAGS += -Wl,-subsystem,windows"
./qmake-windows "DEFINES += AUTOSUPERGRUBDISK" "RESOURCES += unetbootin-autosupergrubdisk.qrc"
make
mv release/unetbootin.exe release/unetbootin-autosupergrubdisk-$rvern.exe
./upx --lzma release/unetbootin-autosupergrubdisk-$rvern.exe
qmake -spec linux-g++-32 "RESOURCES += unetbootin-linux.qrc"
printf "UNetbootin Source Revision $rvern\r\nCopyright Geza Kovacs\r\nHomepage at http://unetbootin.sourceforge.net\r\nLicensed under the GNU GPL v2 and above, components from other projects are licensed under their respective licenses\r\nBuild generated on $(date)\r\nDownload using bzr: bzr checkout http://bazaar.launchpad.net/~gezakovacs/unetbootin/devel-new -r$rvern\r\n" > README.TXT
zip release/unetbootin-source-$rvern.zip README.TXT $(bzr ls --versioned)

