rm -rf build/exe.linux-i686-2.7

python setup.py build

rm -rf ~/Work/Temp/build/exe.linux-i686-2.7
cp -r build/exe.linux-i686-2.7 ~/Work/Temp/build
rm -rf build/exe.linux-i686-2.7

cp -r Fonts ~/Work/Temp/build/exe.linux-i686-2.7
cp -r Data ~/Work/Temp/build/exe.linux-i686-2.7

cp ../API/galaxyAPI.so ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/bin/rar ~/Work/Temp/build/exe.linux-i686-2.7

# copy additional DLLs
cp /usr/lib/i386-linux-gnu/libwx_gtk2u_adv-2.8.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libwx_baseu_net-2.8.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libwx_gtk2u_html-2.8.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libSDL-1.2.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libSDL_ttf-2.0.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libSDL_image-1.2.so.0 ~/Work/Temp/build/exe.linux-i686-2.7
cp /usr/lib/i386-linux-gnu/libtiff.so.4 ~/Work/Temp/build/exe.linux-i686-2.7

# Rename the package directory
rm -rf ~/Work/Temp/build/GalaxyReportViewer_linux
mv ~/Work/Temp/build/exe.linux-i686-2.7 ~/Work/Temp/build/GalaxyReportViewer_linux

# Create test directory
mkdir ~/Work/Temp/build/xtest
cp -r ~/Work/Temp/build/GalaxyReportViewer_linux/* ~/Work/Temp/build/xtest

# Create archive
cd ~/Work/Temp/build
rm GalaxyReportViewer_linux.rar
rar a -r GalaxyReportViewer_linux GalaxyReportViewer_linux

