Page 1 of 1

automated svn install script

Posted: 24 Jul 2009, 12:42
by nonchip
hi, i rlly love warzone2100, and i just found out how to compile from svn trunk.
the "stable" ubuntu-package for warzone2100 is version 1.x to 2.0, thats too "old", and i didn't want to download the stable 2.2 release. so i read the compilation guide and made a bash script (linux), which automatically checks the trunk out to "~/warzone", installs dependencies (apt-get, for ubuntu) and runs "autogen&&configure&&make". then it tells the user that he could install using "sudo make install", but i never do that, because i want to be able to update/customize without reinstalling.
Because the script lets u always install the newest version of warzone (because of using the svn trunk) with ONE command, i decided to publish it here.

Code: Select all

#!/bin/bash
echo creating ~/warzone
cd ~
mkdir warzone
cd warzone

echo installing libs
sudo apt-get install subversion build-essential automake flex bison \
 libpopt-dev libpng12-dev libsdl1.2-dev libsdl-net1.2-dev \
 libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglc-dev \
 libsqlite3-dev libglc-dev

echo downloading trunk
svn co https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk .

echo "autogen&&configure"
./autogen.sh
./configure

echo running make
make
echo DONE!
echo   run the following command for a system-wide install:
echo     sudo make install
to use: save the script as "warzonecompile.sh", make it executable ("chmod a+x warzonecompile.sh"), and run as default user ("./warzonecompile.sh"). it may ask for sudo password, because it needs to run "sudo apt-get install ..." for the dependencies.
when it finished (on my notebook after 1-2hours) it will say "DONE!" and tell u the command for systemwide install ("sudo make install"), but you only need to install if you want to run it for multiple users. if you don't install, just run "./warzone" to start the game.


i hope this can help you installing the trunk easier.

Re: automated svn install script

Posted: 24 Jul 2009, 18:03
by nonchip
could someone make this sticky or add it to the compilation tutorial? i think it would help new players or persons that dont compile games from source often

Re: automated svn install script

Posted: 24 Jul 2009, 21:34
by lav_coyote25
and hows about one for us windows people that dont and cant code to save our butts eh??? :3 :3 :3 :3 :3

Re: automated svn install script

Posted: 26 Jul 2009, 07:34
by Buginator
nonchip wrote:could someone make this sticky or add it to the compilation tutorial? i think it would help new players or persons that dont compile games from source often

You can edit the wiki, and insert your script if you want. It is open to all, same username/password as the forum.

Re: automated svn install script

Posted: 31 Jul 2009, 10:30
by nonchip
oh, didn't know that. have added the instructions for using the script on http://developer.wz2100.net/wiki/LinuxC ... compile.sh

oh and @lav_coyote25: i don't use windows, and i think if you really want to run svn-unstable code on windows (maybe even vista O_o ), its your fault and you can write your own script (i dont know what you need to compile wz on win), but i really recommend using linux for online gaming, because its safer. and using linux when compiling games is better too, because you can install the libs easier. windows is for users, debian is for admins, and ubuntu is for all.

Re: automated svn install script

Posted: 01 Aug 2009, 06:52
by Buginator
Thanks for the addition. :3

Re: automated svn install script

Posted: 26 Nov 2009, 20:21
by munsking
howdy folks, i made a script too, wondering what you think about it ^^

if you want to download it:
the zip file
the tar file

or just look at it:
check it on pastebin

if it needs any changes, please say so :)

Re: automated svn install script

Posted: 26 Nov 2009, 20:28
by KukY
munsking wrote:howdy folks, i made a script too, wondering what you think about it ^^

if you want to download it:
the zip file
the tar file

or just look at it:
check it on pastebin

if it needs any changes, please say so :)
Looks good.
Is it for Windows?

Re: automated svn install script

Posted: 27 Nov 2009, 00:48
by munsking
nope... unless you changed so much that your windows works like linux :P
i made it for ubuntu, but i guess it works for other versions too

Re: automated svn install script

Posted: 01 Dec 2009, 21:17
by Berg
Thank you nonchip

Re: automated svn install script

Posted: 15 Dec 2009, 20:11
by cybersphinx
munsking wrote:howdy folks, i made a script too, wondering what you think about it ^^
check it on pastebin
if it needs any changes, please say so :)
Line 16: apt-get might prompt for confirmation, the > /dev/null hides that and the script will apparently hang. It might also hide the sudo password prompt. Sudo itself is evil, especially with hidden output.

Line 30: function dircheck is quite strange, it doesn't cd if the dir doesn't exist yet, and mkdir might need a -p.

Line 43: WTF?

Line 48: Just ignore any options if you don't use them?

Line 51: WTF again. A. If you need to run as root, you're doing something wrong. B. Why use sudo if the whole thing needs to be run as root anyway?

Line 81: The dircheck will decide where to put the source, not where to install the game (if the directory exists, if not, line 84+ will fail).

Line 86: Compiling on a singe core. Yay! Well, for Warzone that's not too bad...

Line 97: The dircheck is completely useless, it might make that directory, but you need to add --prefix to ./configure to specify the directory to install into.

Line 119: Do you want the Warzone source directly in your home dir?

That's after a short look at it, it looks too untrustworthy to me to actually run it.

Re: automated svn install script

Posted: 18 Dec 2009, 10:18
by FooTheYakWhoStrikesB
nonchip wrote:hi, i rlly love warzone2100, and i just found out how to compile from svn trunk.
the "stable" ubuntu-package for warzone2100 is version 1.x to 2.0, thats too "old", and i didn't want to download the stable 2.2 release. so i read the compilation guide and made a bash script (linux), which automatically checks the trunk out to "~/warzone", installs dependencies (apt-get, for ubuntu) and runs "autogen&&configure&&make". then it tells the user that he could install using "sudo make install", but i never do that, because i want to be able to update/customize without reinstalling.
this looks interesting. can do it if i have windows 07?

Re: automated svn install script

Posted: 18 Dec 2009, 14:49
by stiv
this looks interesting. can do it if i have windows 07?
No.

Re: automated svn install script

Posted: 09 Feb 2010, 11:47
by Samowar
nonchip wrote:if you don't install, just run "./warzone" to start the game.
Not "src/warzone2100"?

btw, as soon as you have done all this for the first time, all it takes you to update your game to the newest version of trunk is

Code: Select all

svn up
make
make install
No need to rerun autogen and config every time.

@Windows people: What compiler do you use? Does MSVC also run on the command line? Then it might just work to create a .bat file with the equivalent functionality. At least for the three-step update I posted above. For the first-time install it might get tricky, as you got no package management system to install all the dependencies.