This is a bash shell script I am using while working on Crystal Core. It may be a little over-the-top, but I like automation. It keeps me from making (as many) stupid mistakes. It sets up my (project specific) cvs enviroment, automates configuration of the projects, sets up my run environment and downloads the crystal core data files (using wget). Also, by setting cdable vars in my shell, the variables make tree navigation easier. I put it in my project directory just above my checkouts and dot it in when starting work.
'cvscheck' (which this uses) is a shell function in my profile:
function cvscheck() {
cvs -f -qn update -d |grep -v '^?'
}
Anywho, if anyone finds it useful, they are free to play with it. Building/rebuilding cs is a bit of a pain; this makes it a bit easier.
# Environment settings for crystal space work.
# Dot this in before working (. ./dotme)
# Functions:
# For configuring packages: configure-cs, configure-cel, configure-ccore
# dlcoredata: downloads CrystalCore data from support website to correct dirs
# (needs wget)
# csupdates: checks for available updates in cvs (all three project trees)
# NOTE: these functions, except csupdate all leave you in their working
# directory when done.
# Change options for configuring here:
#_____________________________________
private_inst_dir=/Users/evought/local
fink_dir=/sw
sourceforge_user=ericvought
export AUTOCONF_PREFIX=$private_inst_dir
export WHERE_JPEG=$fink_dir
export WHERE_PNG=$fink_dir
export WHERE_CPP_UNIT=$private_inst_dir
export WHERE_ODE=$private_inst_dir
#_____________________________________
# Project locations
# suggest: "shopt -s cdable_vars" in your bash startup script
export CRYSTAL=$PWD/cs
export CEL=$PWD/cel
export CCORE=$PWD/crystalcore
export CSTREE=$PWD
# CVS ROOTs
export CVS_CRYSTAL=:ext:$sourceforge_user@cvs.sourceforge.net:/cvsroot/crystal
export CVS_CEL=:ext:$sourceforge_user@cvs.sourceforge.net:/cvsroot/cel
export CCORE_DATA_URL='
http://www.crystalspace3d.org/support/crystalcore'
export CCORE_DATA="entities.zip models.zip game_textures.zip"
export CCORE_LEVELS="textures.zip cc_comcenter_in.zip cc_ground.zip cc_ground_terr.zip cc_lab.zip"
#_____________________________________
# Shell functions to configure packages
function configure-cs() {
cd $CRYSTAL
./configure \
--prefix=$AUTOCONF_PREFIX \
--with-jpeg=$WHERE_JPEG --with-png=$WHERE_PNG \
--with-ode=$WHERE_ODE \
--with-cppunit=$WHERE_CPP_UNIT
} # configure-cs
function configure-cel() {
cd $CEL
./configure \
--prefix=$AUTOCONF_PREFIX \
--with-cppunit=$WHERE_CPP_UNIT
} # configure-cel
function configure-ccore() {
cd $CCORE
./configure \
--prefix=$AUTOCONF_PREFIX \
--with-cppunit=$WHERE_CPP_UNIT
} # configure-ccore
#_______________________________________
# Downloads game files from cs support site to correct ccore directories
function dlcoredata() {
cd $CCORE/data
for archive in $CCORE_DATA
do
wget -nc $CCORE_DATA_URL/$archive
done
cd levels
for archive in $CCORE_LEVELS
do
wget -nc $CCORE_DATA_URL/$archive
done
} # dlcoredata
#_____________________________________
# Check for updates in all three packages
# Returns to starting directory.
function csupdates() {
pushd $CRYSTAL
echo
echo "[CRYSTAL]:"
echo
cvscheck
popd
pushd $CEL
echo
echo "[CEL]"
echo
popd
pushd $CCORE
echo
echo "[CCORE]"
echo
popd
} # csupdates