automated svn install script

For code related discussions and questions
Post Reply
nonchip
Greenhorn
Posts: 9
Joined: 24 Jul 2009, 12:20

automated svn install script

Post 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.
nonchip
Greenhorn
Posts: 9
Joined: 24 Jul 2009, 12:20

Re: automated svn install script

Post 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
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: automated svn install script

Post 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
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: automated svn install script

Post 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.
and it ends here.
nonchip
Greenhorn
Posts: 9
Joined: 24 Jul 2009, 12:20

Re: automated svn install script

Post 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.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: automated svn install script

Post by Buginator »

Thanks for the addition. :3
and it ends here.
munsking
New user
Posts: 2
Joined: 26 Nov 2009, 20:17

Re: automated svn install script

Post 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 :)
KukY
Regular
Regular
Posts: 1859
Joined: 20 Mar 2009, 21:56

Re: automated svn install script

Post 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?
munsking
New user
Posts: 2
Joined: 26 Nov 2009, 20:17

Re: automated svn install script

Post 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
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: automated svn install script

Post by Berg »

Thank you nonchip
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: automated svn install script

Post 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.
FooTheYakWhoStrikesB
Trained
Trained
Posts: 50
Joined: 18 Dec 2009, 05:33
Location: here at home
Contact:

Re: automated svn install script

Post 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?
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: automated svn install script

Post by stiv »

this looks interesting. can do it if i have windows 07?
No.
Samowar
Trained
Trained
Posts: 42
Joined: 03 Jun 2009, 19:46

Re: automated svn install script

Post 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.
Post Reply