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