#!/bin/sh

mingwb="$(ls /usr/ | grep mingw32 | head --lines 1)"
rvern="$(bzr version-info | grep revno | sed 's/revno: //')"
make clean
rm Makefile*
rm release/*
lupdate-qt4 unetbootin.pro
lrelease-qt4 unetbootin.pro
./qmake-windows "DEFINES += AUTOSUPERGRUBDISK" "RESOURCES += unetbootin-autosupergrubdisk.qrc" "RESOURCES -= unetbootin-sevnz.qrc"
make
$mingwb-strip --strip-all release/unetbootin.exe
mv release/unetbootin.exe release/unetbootin-autosupergrubdisk-windows-$rvern.exe
./upx --lzma release/unetbootin-autosupergrubdisk-windows-$rvern.exe
./qmake-linux "DEFINES += AUTOSUPERGRUBDISK" "RESOURCES += unetbootin-autosupergrubdisk.qrc"
make
$mingwb-strip --strip-all unetbootin
mv unetbootin release/unetbootin-autosupergrubdisk-linux-$rvern
./upx --lzma release/unetbootin-autosupergrubdisk-linux-$rvern
qmake-qt4 -spec linux-g++-32 "RESOURCES += unetbootin-linux.qrc"

