home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- echo "Welcome to the Linux BFRIS demo installation program."
- echo "No files will be installed until after a final warning."
- echo
- echo "Please read the following license agreement. If you do"
- echo "agree to this license, you may press Control-C at any time"
- echo "to abort this installation."
- echo
- echo -n "Press enter to see the license agreement:"
-
- read ans
-
- more license.txt
- echo
- ans=x
-
- while [ $ans != y -a $ans != n ]; do
- echo -n "Do you agree to the terms of this license agreement? [n] "
- read ans
- ans=`echo ${ans}n | sed -e 'y/YN/yn/' -e 's/^\(.\).*/\1/'`
- done
-
- if [ $ans != y ]; then
- echo "Installation aborted"
- exit 1
- fi
-
-
- if [ $EUID != 0 ]; then
- echo "You must run the BFRIS demo install program as root."
- exit 1
- fi
-
- dest=/usr/local/games/bfrisdemo
- echo -n "Where would you like the BFRIS demo installed? [$dest] "
- read ans
- if [ x$ans != "x" ]; then
- dest=$ans
- fi
-
- instvar=y
- echo
- echo "The BFRIS launcher can be installed in /usr/local/bin. To use it,"
- echo "you must set the BFRISDIR environment variable to point to "
- echo -n $dest
- echo ", where you will install BFRIS. We can set this for you"
- echo "in your .cshrc and .bashrc files; would you like to install the BFRIS"
- echo -n "launcher and set this variable automatically upon login? [y] "
- read ans
- ans=`echo ${ans}y | sed -e 'y/YN/yn/' -e 's/^\(.\).*/\1/'`
- if [ $ans = n ]; then
- installvar=n
- fi
- echo
-
- intro=n
-
- echo
- echo "This archive includes Linux binaries for both glibc and libc5 systems."
- echo "By default, this setup program will install glibc binaries. glibc"
- echo "binaries should be installed if you are running Redhat 5.0 or newer"
- echo "or Debian Linux distributions."
- echo
- installGlibc=y
- ans=x
- while [ $ans != y -a $ans != n ]; do
- echo -n "Do you want to install glibc binaries? [y] "
- read ans
- ans=`echo ${ans}y | sed -e 'y/YN/yn/' -e 's/^\(.\).*/\1/'`
- done
- if [ $ans = n ]; then
- installGlibc=n
- fi
-
- echo
- echo "BFRIS requires hardware-accelerated OpenGL. BFRIS ships with Mesa 3.0"
- echo "compiled with support for 3Dfx Voodoo Graphics, Voodoo Rush, and Voodoo2"
- echo "chipsets. Depending upon your previous selection, the setup script"
- echo "can install glibc or libc5 Mesa libraries."
- echo
- installMesa=y
- ans=x
- while [ $ans != y -a $ans != n ]; do
- echo -n "Do you want to install Mesa 3.0 libraries packaged with BFRIS? [y] "
- read ans
- ans=`echo ${ans}y | sed -e 'y/YN/yn/' -e 's/^\(.\).*/\1/'`
- done
- if [ $ans = n ]; then
- installMesa=n
- fi
-
- mesaDest=$dest/lib
-
- echo
- echo -n "About to begin installation. Press enter to proceed, or control-C to abort."
- read ans
-
- echo "(You may see warnings about three directories that are not copied, and if you"
- echo "elected to install the Mesa libraries, you may see a warning about ldconfig;"
- echo "these messages can usually be safely ignored.)"
- echo
-
- if [ ! -d $dest ]; then
- mkdir -p $dest
- if [ ! -d $dest ]; then
- echo "Failed to make bfris directory $dest"
- exit 1
- fi
- fi
- if [ $installMesa = y -a ! -d $mesaDest ]; then
- mkdir -p $mesaDest
- if [ ! -d $mesaDest ]; then
- echo "Failed to make Mesa directory $mesaDest"
- exit 1
- fi
- fi
-
-
- cp -f disk1/* $dest
-
- if [ $intro = y ]; then
- cp disk1/intro/intro.mvy $dest
- fi
-
- if [ $installGlibc = y ]; then
- cp disk1/glibc/* $dest
- else
- cp disk1/libc5/* $dest
- fi
-
- if [ $installMesa = y ]; then
- mv $dest/libMesa* $mesaDest
- fi
-
- if [ $instvar = y ]; then
- cp $dest/bfris /usr/local/bin
- chmod a+rx /usr/local/bin/bfris $dest/bfrisc $dest/bfrisd $dest/bfris $dest/lnx_sdrv
- egrep "^$dest/lib$" $HOME/.bashrc >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "export BFRISDIR="$dest >> $HOME/.bashrc
- fi
- egrep "^$dest/lib$" $HOME/.cshrc >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "setenv BFRISDIR "$dest >> $HOME/.cshrc
- fi
- fi
-
- ldConfig=n
- if [ $installMesa = y ]; then
- egrep "^$dest/lib$" /etc/ld.so.conf >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo $dest/lib >> /etc/ld.so.conf
- ldConfig=y
- fi
- fi
- if [ $ldConfig = y ]; then
- /sbin/ldconfig
- fi
-
- echo
- echo
- echo "Installation complete. Make sure you are logged in as root,"
- echo "then change to $dest and type ./bfris to play."
- echo
-
-