Page 1 of 1

Generic Spring SVN install script.

Posted: 03 Sep 2006, 12:16
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

Posted: 04 Mar 2007, 23:58
by pheldens
Updated to present situation and versions.

Posted: 05 Mar 2007, 00:00
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?

Posted: 05 Mar 2007, 00:22
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

Posted: 05 Mar 2007, 01:29
by pheldens
thx, fixed.

Posted: 05 Mar 2007, 08:40
by SupaSonic
Great stuff! I just tried it out, works like a charm.

Should be stickied.

Posted: 05 Mar 2007, 13:30
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)

Posted: 05 Mar 2007, 14:02
by Masse
gotta try this :) going to try in opensuse too ^^

Posted: 05 Mar 2007, 15:40
by AF
Be aware that svn trunk builds will most likely desync with windows users and people who use the debian packages.

Posted: 05 Mar 2007, 16:31
by Licho
Yeah don't use trunk Spring builds if you want to stay compatible.

Posted: 05 Mar 2007, 17:17
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.

Posted: 20 Mar 2007, 17:40
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

Posted: 20 Mar 2007, 18:27
by hollowsoul
@ Maxddark
Looks like something is still left from debspring.
Why u install a package thats over 1/2 year old ?

Posted: 20 Mar 2007, 18:42
by MAXDDARK
at that time this was the easiest way to install spring under Ubuntu.

Posted: 21 Mar 2007, 01:20
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.

Debian only?

Posted: 25 Mar 2007, 12:31
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....

Posted: 25 Mar 2007, 23:20
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.

Posted: 27 Mar 2007, 09:08
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.