Generic Spring SVN install script.

Generic Spring SVN install script.

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Generic Spring SVN install script.

Post by pheldens »

requires: svn, wget
Usage (after examining):

> sh spring_build.sh

Code: Select all


#!/bin/sh
# Assuming you have all compiletime dependencies installed,
# this downloads and builds spring svn in $TLD.
# version Mon Mar  5 10:49:56 CET 2007

TLD=~/spring

# Update existing svn build to current.
if [[ -d $TLD/svn/trunk && -f $TLD/game/spring && -f $TLD/UnityLobby/client/unitsync.so ]]
then
  cd $TLD/svn/trunk
  svn up | tee svn.log
  if $(tail -n1 svn.log | grep -q '^At')
  then 
    clear 
    tail -n1 svn.log 
    echo "Already Up to date." 
    exit 
  else
    scons -c
    scons configure && scons 
    cp -rf game/*  $TLD/game
    cp -rf UnityLobby $TLD
    rm $TLD/game/AI/AAI/cfg/mod/xtape.cfg        2>1&> /dev/null
    rm $TLD/game/AI/AAI/log/BuildTable_XTAPE.txt 2>1&> /dev/null
    clear
    tail -n1 svn.log
    echo "Up to date."
    exit
  fi

else

# Setup directories.
mkdir -p $TLD/svn


# Download free game data (includes Nanoblobs mod.)
cd $TLD
wget http://download2.berlios.de/taspring-linux/spring-linux-data-0.74b1.tar.bz2
tar -jxf spring-linux-data-0.74b1.tar.bz2
mv spring-linux-data-0.74b1 game
rm spring-linux-data-0.74b1.tar.bz2


# Download non-free data (includes XTA mod.) 
# Comment out if you do not want non-free mod/data.
cd $TLD/game/base
wget http://ipxserver.dyndns.org/games/spring/mods/xta/base-ota-content.zip
unzip base-ota-content.zip
rm base-ota-content.zip
cd $TLD/game/mods
wget http://ipxserver.dyndns.org/games/spring/mods/xta/XTAPE.sd7


# Download svn source.
echo -e "\n\n$0 says: Choose p upon certificate misconfiguration trouble.\n"
cd $TLD/svn
svn co https://taspring.clan-sy.com/svn/spring/trunk


# Build spring engine and AI and copy them to the game tree.
cd $TLD/svn/trunk
scons configure && scons
cp -rf game/*  $TLD/game


# Some cleanup for AAI/XTA
cd $TLD/game/AI/AAI/cfg/mod/
wget http://ipxserver.dyndns.org/games/spring/mods/xta/XTAPE.cfg -O XTAPE.cfg
rm $TLD/game/AI/AAI/cfg/mod/xtape.cfg        2>1&> /dev/null
rm $TLD/game/AI/AAI/learn/mod/XTAPE.dat      2>1&> /dev/null
rm $TLD/game/AI/AAI/log/BuildTable_XTAPE.txt 2>1&> /dev/null

# Copy Unity spring trayicon frontend.
cd $TLD/svn/trunk
cp -rf UnityLobby $TLD


# Setup a Unity default profile.
cat > $TLD/UnityLobby/profiles/default.profile <<EOF
[SETUP]
PROFILE_NAME = $USER
SPRING_DATADIR = $TLD/game 
SPRING_BINARY = $TLD/game/spring
UNITSYNC_LOCATION = $TLD/UnityLobby/client
EOF


# Some guidance. 
clear 
cat <<EOF

Remove existing  ~/.springrc ~/.unity-lobby unless you know what you are doing. 

To start spring directly: 
  > cd $TLD/game && ./spring

To start spring with the Unity trayicon frontend: 
  > cd $TLD/UnityLobby && ./Unity.py
  (Upon Unity errors, make sure you are using the latest gtk/gdk/pango/pygtk/librsvg.)"

To update an earlier install wih this script in $TLD to the latest SVN engine version:
  > sh $0 

Comments at:
   http://spring.clan-sy.com/phpbb/viewtopic.php?p=119032

EOF

fi
Last edited by pheldens on 05 Mar 2007, 13:22, edited 4 times in total.
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

Updated to present situation and versions.
User avatar
clericvash
Posts: 1394
Joined: 05 Oct 2004, 01:05

Post by clericvash »

Well done, i think this will help quite a few people :), or just save time for lazy people. Mabye this should be stickied?
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

Note with UnityLobby in spring svn
Its possible to automate the setup, so user doesnt need togo through the setup
Have a look at both files

Code: Select all

trunk/UnityLobby/profiles/README
trunk/UnityLobby/profiles/example.profile
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

thx, fixed.
User avatar
SupaSonic
Posts: 26
Joined: 24 Feb 2007, 14:43

Post by SupaSonic »

Great stuff! I just tried it out, works like a charm.

Should be stickied.
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

Updated
- Autodetected svn updates and subsequent building.
- Added https cert warning instruction.
- Changed unitsync.so handling to new situation
(built into Unitylobby/client already)
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

gotta try this :) going to try in opensuse too ^^
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Be aware that svn trunk builds will most likely desync with windows users and people who use the debian packages.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Post by Licho »

Yeah don't use trunk Spring builds if you want to stay compatible.
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

yes, backup your existing ~/.springrc and ~/.unity-lobby, for the rest it's isolated into it's own directory.

If you want to return to stable, or other previous install, remove $TLD, and restore ~/.springrc and ~/.unity-lobby.
MAXDDARK
Posts: 39
Joined: 28 Sep 2006, 15:02

Post by MAXDDARK »

I'm lost, I can't understand what is wrong...
I run the script and it was fine, but I can't manage to run the game.

Code: Select all

maxim@maxim:~/spring/game$ && ./spring
bash: syntax error near unexpected token `&&'
maxim@maxim:~/spring/game$ ./spring
bash: ./spring: No such file or directory
maxim@maxim:~/spring/game$ spring
I: workdir is '/home/maxim/.springdir/maxim:0.0'
I: type spring-setup to configure spring
sh: /usr/bin/spring.bin: not found
maxim@maxim:~/spring/game$ spring-setup
E: Unable to determine default mod.
maxim@maxim:~/spring/game$ spring setup
I: workdir is '/home/maxim/.springdir/maxim:0.0'
I: type spring-setup to configure spring
sh: /usr/bin/spring.bin: not found
I use Ubuntu Edgy...
except the old debrpring nothing works for me.
I removed it before I run the script.
I don't know what to do at this point.

P.S
you should update the svn to the newest version 0.74c
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

@ Maxddark
Looks like something is still left from debspring.
Why u install a package thats over 1/2 year old ?
MAXDDARK
Posts: 39
Joined: 28 Sep 2006, 15:02

Post by MAXDDARK »

at that time this was the easiest way to install spring under Ubuntu.
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

If you just tried updating the data package for your exisiting install, that wont work; differing versions and wrong install path. I linked you here for the url to the data files you requested. Contact an ubuntu spring user if you want to continue with the ubuntu/debian specific install.


If you ran this script, or decide to continue with this script;
It didn't build a spring executable by the looks of it. You need all dependencies for it to work (gcc/svn/dev libs etc). And delete your old spring install and old spring config. This would then be an incompatible latest svn install, solely suited for offline play, or online play against users using the same checkout.
Fri13
Posts: 54
Joined: 03 Feb 2007, 13:15

Debian only?

Post by Fri13 »

It seems that this only work with deb distros, tryed this on OpenSUSE and it will install it but "... && ./spring" command dont start anything, because there is no spring bin.

And this script should be updated to new beta 3 version....
pheldens
Posts: 191
Joined: 12 Aug 2006, 21:35

Post by pheldens »

I just checked, and 74b1 seems to be the most recent game data for linux.

The script is distro neutral (I dont use debian or clones), it's just what you would normally do by hand to build spring svn. If it doesn't build the binary, you can check why by executing the scons build step manually. Your distro install probably doesn't meet the spring build requirements. (install all spring deps with dev packages as is stated)

I will add a warning and stop to make this clearer.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I discontinued making data packages, as I think it's now easy enough to grab some mods & maps from http://spring.unknown-files.net and use the base data that's in the SVN.
Post Reply

Return to “Linux”