Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # building a windows 32bit binary
- prefix=/build/quetoo-win32
- prefix_zip=/build/quetoo
- home=/root/quetoo
- homedata=/root/quetoo-data
- host=i686-w64-mingw32
- today=`date +%Y%m%d`
- physfs_path=/usr/x86_64-w64-mingw32/sys-root/mingw
- script_pwd=`pwd`
- # make sure we have all the latest commits
- cd $homedata
- git pull origin master
- cd $script_pwd
- # remove icon resources
- rm -f $home/src/tools/quemap/quemap.res
- rm -f $home/src/main/quetoo.res
- rm -f icons/quetoo-launcher.res
- # compile the resource files for the icons
- $host-windres icons/quemap.rc -O coff -o $home/src/tools/quemap/quemap.res || exit 1
- $host-windres icons/quetoo.rc -O coff -o $home/src/main/quetoo.res || exit 1
- $host-windres icons/quetoo-launch.rc -O coff -o icons/quetoo-launch.res || exit 1
- # make finding libraries and headers easier
- export PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig
- # build the actual programs
- cd $home
- hash=`git log --pretty=format:'%h' -n 1`
- make clean
- autoreconf --force -i || exit 1
- ./configure --host=$host --prefix=$prefix --with-physfs=$physfs_path --without-mysql || exit 1
- cd $home/src/main
- sed -i '/quetoo$(EXEEXT):/{N;N;s/$/ quetoo.res/}' Makefile || exit 1
- cd $home/src/tools/quemap
- sed -i '/quemap$(EXEEXT):/{N;N;s/$/ quemap.res/}' Makefile || exit 1
- cd $home
- make -j2 || exit 1
- make install || exit 1
- # copy the update script and rsync
- cp $home/mingw-cross/quetoo-i686/update.bat $prefix
- cp $home/mingw-cross/quetoo-i686/bin/rsync.exe $prefix/bin
- # copy the DLLs
- cp $script_pwd/dlls/* $prefix/bin
- # add game data if not present (usually won't be)
- if [ ! -d $prefix/share ]; then
- cp -R $homedata/target $prefix/share
- cp $homedata/src/default/map-* $prefix/share/default
- fi
- # build the launcher
- $host-gcc -o $prefix/quetoo-launch.exe $script_pwd/quetoo-launch.c $script_pwd/icons/quetoo-launch.res || exit 1
- # create the whole bundle
- mv $prefix $prefix_zip
- cd $prefix_zip
- zip -r ../quetoo-win32-$today-$hash.zip ./*
- cd $home
- mv $prefix_zip $prefix
- # send to server for downloads
- rsync --progress -avz -e ssh $prefix/../quetoo*.zip root@quetoo.packetflinger.com:/var/www/quetoo.packetflinger.com/dl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement