diff -urN childsplay_plugins-0.85.orig/install.sh childsplay_plugins-0.85/install.sh
--- childsplay_plugins-0.85.orig/install.sh 2007-01-04 19:49:21.249701568 +0000
+++ childsplay_plugins-0.85/install.sh 2007-01-04 20:45:36.058020934 +0000
@@ -15,7 +15,9 @@
#################################################################
if [ $1 ] && [ -e $1 ]
-then PREFIX=$1
+then
+PREFIX=$1
+DESTDIR=$2
fi
LOCALEDIR=$PREFIX/share/locale
@@ -31,10 +33,12 @@
SHARELIBDATADIR=$SHAREDIR/lib
SHAREDATADIR=$SHAREDIR/Data
+mkdir -p $DESTDIR$DOCDIR $DESTDIR$CPDIR/lib $DESTDIR$SHAREDATADIR/icons
+
##################################################
# Package text to be displayed as last step
# 0 = no readmes to display, 1 = there are readmes
-README=1
+README=0
# if README=1 then READMES=names of readmes in CWD
# like this READMES="README README2 README3"
READMES="README README-PACKID README.MT_users2csv"
@@ -45,13 +49,6 @@
# the names of which plugins are to be added to the score file
SCORE="Packid,Numbers,Soundmemory,Fallingletters,Findsound,Findsound2,Billiard,Puzzle"
-USERID=`id | sed -e 's/).*//; s/^.*(//;'`
-if [ "$USERID" != "root" ]; then
- echo " You must be root to install the plugins"
- echo " exit"
- exit 1
-fi
-
echo -e "\n>>>>>>>>>>> Install childsplay plugins >>>>>>>>>>>>>>>>>>>>"
echo -e "\n This release depends on childsplay version >= $DEPEN"
echo -n " Checking, version = "
@@ -60,73 +57,41 @@
VERSION=$($CP --version)
echo $VERSION
-if [ `expr $VERSION \< $DEPEN` -eq 1 ]
-then
- echo " Childsplay version incorrect, please upgrade to at least";
- echo " version $DEPEN";
- echo "exit";
- exit 1
-fi
-
-if [ ! -f $CP ]
-then echo "############# Can\`t find childsplay ###########" && \
- echo "Be sure to install childsplay first" && \
- exit 1
-fi
-
set -e
-echo -e "\n The path to install the plugins in is $CPDIR."
-echo " If you have installed childsplay in a other place, you can"
-echo " give the full path to childsplay, otherwise just hit enter"
-echo " Hit enter to install in $CPDIR, or give the full path"
-read path
-if [ $path ];then
- if [ -e $path/install.py ];then
- CPDIR=path
- else
- echo "*********** WARNING *************"
- echo " $path does not exists or is not the childsplay directory"
- echo " exit"
- exit 1
- fi
-fi
echo " Installing in $CPDIR"
-echo "Compiling modules to bytecode..."
-$PYTHON $CPDIR/install.py --compile $CWD/lib
-
echo " Copy libraries"
for DIR in `ls $CWD/lib`
do
if [ -d $CWD/lib/$DIR ]
- then cp -rf $CWD/lib/$DIR $SHARELIBDATADIR
- else cp -f $CWD/lib/$DIR $CPDIR/lib
+ then cp -rf $CWD/lib/$DIR $DESTDIR$SHARELIBDATADIR
+ else cp -f $CWD/lib/$DIR $DESTDIR$CPDIR/lib
fi
done
echo " Copy misc. data files"
-cp -rf $CWD/Data/*.icon.png $SHAREDATADIR/icons/
-cp -rf $CWD/Data/AlphabetSounds $SHAREDATADIR/
+cp -rf $CWD/Data/*.icon.png $DESTDIR$SHAREDATADIR/icons/
+cp -rf $CWD/Data/AlphabetSounds $DESTDIR$SHAREDATADIR/
echo " Copy assetml files"
-cp -rf $CWD/assetml/* $ASSETMLDIR
+cp -rf $CWD/assetml/* $DESTDIR$ASSETMLDIR
echo " Copy README's to the childsplay doc directory"
for name in $READMES;do
- cp -f $CWD/$name $DOCDIR/$name
+ cp -f $CWD/$name $DESTDIR$DOCDIR/$name
done
echo -e "\n Trying to add $SCORE to the childsplay score sheet"
echo " Start add-score.py"
-$PYTHON $CWD/add-score.py $SHAREDATADIR $SCORE
+$PYTHON $CWD/add-score.py $DESTDIR$SHAREDATADIR $SCORE
echo -e "\n Installing MT_users2cvs.py"
echo " Look at the file called README.MT_users2csv for info on how"
echo " to use it. It usage is intended for teachers who want to an"
echo " users resume of the multiplication tables users."
-cp -f $CWD/MT_users2csv.py $MTDIR/MT_users2csv.py
-chmod a+x $MTDIR/MT_users2csv.py
+cp -f $CWD/MT_users2csv.py $DESTDIR$MTDIR/MT_users2csv.py
+chmod a+x $DESTDIR$MTDIR/MT_users2csv.py
echo -e "\n Everything installed, enjoy\n"
echo -e "\n***************** IMPORTANT *************************"