When run on Debian 6.0 i686 (32 bit), the setupBuildDeps.sh considers this system to be "Ubuntu 8.04". It then tries to install, amongst other packages, libluajit-5.1-dev and libvlc-dev. libluajit-5.1-dev is not available on Debian 6.0, making the entire command fail. if you run this apt-get command without luajit-5.1-dev you end up installing libvlc-dev 1.1.3-1squeeze6, which, I believe because MegaGlest expects a different version, breaks the build (cmake works) with:
[ 30%] Building CXX object source/shared_lib/CMakeFiles/libmegaglest.dir/sources/graphics/PNGReader.cpp.o
/home/megaglest/trunk/source/shared_lib/sources/graphics/video_player.cpp: In function 'void Shared::Graphics::callbacks(const libvlc_event_t*, void*)':
/home/megaglest/trunk/source/shared_lib/sources/graphics/video_player.cpp:314: error: 'libvlc_MediaPlayerVout' was not declared in this scope
/home/megaglest/trunk/source/shared_lib/sources/graphics/video_player.cpp: In member function 'bool Shared::Graphics::VideoPlayer::initPlayer(std::string)':
/home/megaglest/trunk/source/shared_lib/sources/graphics/video_player.cpp:765: error: 'libvlc_MediaPlayerVout' was not declared in this scope
make[2]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/sources/graphics/video_player.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/all] Error 2
make: *** [all] Error 2
ERROR: MAKE failed.
I think the real problem with the setupBuildDeps.sh scritpt is that it uses unreliable criteria to map out the system it is run on. It would be better to work more with the 'lsb_release' and 'arch' / 'uname -a' commands, and to develop unique criteria for each supported distribution and version, and, optionally, for readability, to use 'case' instead of 'if ... then ... elif ... fi'.
In case Softcoder agrees with my view then I'd happily offer to rewrite it myself.