#!/bin/sh

rvern="$(./vcs-revno)"
nativrev="$(./vcs-native-revno)"
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\n\r\nDownload using git:\r\ngit clone git://unetbootin.git.sourceforge.net/gitroot/unetbootin\r\ncd unetbootin\r\ngit checkout $nativrev\r\n\r\nDownload using bzr:\r\nbzr branch http://bazaar.launchpad.net/~vcs-imports/unetbootin/trunk -r$rvern\r\n\r\nBuild instructions at http://unetbootin.wiki.sourceforge.net/compile\r\n\r\nsed -i '/^RESOURCES/d' unetbootin.pro\r\nlupdate-qt4 unetbootin.pro\r\nlrelease-qt4 unetbootin.pro\r\nqmake-qt4 \"DEFINES += NOSTATIC\" \"RESOURCES -= unetbootin.qrc\"\r\nmake\r\n" > README.TXT
zip release/unetbootin-source-$rvern.zip README.TXT $(./vcs-ls)
cp unetbootin.pro unetbootin-pro.bak
sed -i '/^RESOURCES/d' unetbootin.pro
echo "DEFINES += NOSTATIC" >> unetbootin.pro
tar -cvzf release/unetbootin-source-$rvern.tar.gz $(./vcs-ls | grep '\.cpp$') $(./vcs-ls | grep '\.h$') $(./vcs-ls | grep '\.ui$') $(./vcs-ls | grep '\.pro$') $(./vcs-ls | grep '\.ts$') unetbootin.desktop build-nostatic vcs-revno vcs-name INSTALL README.TXT
mv unetbootin-pro.bak unetbootin.pro

