1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
#!/bin/bash
DEFAULT_BINDIR=/usr/local/bin
DEFAULT_DATADIR=/usr/local/lib/circus
echo
echo " :::::: ::: :::::: :::::: ::: ::: :::::"
echo " :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:"
echo " +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+"
echo " +#+ +#+ +#++#+ +#+ +#+ +#+ +#+"
echo " #+# #+# #+# #+# #+# #+# #+# #+##+# #+# #+#"
echo " ###### ### ### ### ###### #### #####"
echo
echo cIRCus 0.43 installation
echo
echo
echo
echo "This script will install cIRCus on your system. Make sure you have"
echo "enough privileges to install cIRCus in the directories you select"
echo "below."
echo
echo "At any time, you can abort this script by hitting Control-C."
echo
echo "You can also use this script to install over a previous version"
echo "of cIRCus."
echo
echo "The default answers are the preferred ones. If you don't know what"
echo "to type, just hit ENTER."
echo
echo "When entering paths, please type the full path! ~ expansion doesn't"
echo "work..."
echo
echo "This script does some input checking, but it's not foolproof! - Be"
echo "careful with what you type. If you can write something better, let"
echo "us know!"
echo
echo "Press any key to continue, or Control-C to quit"
read
#
# Part 1: The script location
done=no
while [ "$done" != "yes" ]; do
echo
echo "Where would you like to install the script that starts cIRCus?"
echo -n "[$DEFAULT_BINDIR] > "
read BINLOC
if [ "$BINLOC" = "" ]; then
BINLOC=$DEFAULT_BINDIR
fi
if [ ! -d $BINLOC ]; then
if [ -e $BINLOC ]; then
echo "$BINLOC exists but is not a directory!"
echo "Please try again..."
else
echo -n "$BINLOC does not exist. Create (y/n)? "
read answer
case $answer in
y|Y)
echo "Creating $BINLOC..."
if mkdir -p $BINLOC; then
done=yes
else
echo -n "mkdir $BINLOC failed, "
echo "please try again"
fi
;;
*)
echo "Please select another directory"
;;
esac
fi
else
done=yes
fi
done
echo "Fine.. I will use $BINLOC"
#
# Part 2: The location of systemfiles
done=no
while [ "$done" != "yes" ]; do
echo
echo "Where would you like to install cIRCus' datafiles (pictures etc)?"
echo -n "[$DEFAULT_DATADIR] > "
read SCRIPTLOC
if [ "$SCRIPTLOC" = "" ]; then
SCRIPTLOC=$DEFAULT_DATADIR
fi
if [ ! -d $SCRIPTLOC ]; then
if [ -e $SCRIPTLOC ]; then
echo "$SCRIPTLOC exists but is not a directory!"
echo "Please try again..."
else
echo -n "$SCRIPTLOC does not exist. Create (y/n)? "
read answer
case $answer in
[yY]*)
echo "Creating $SCRIPTLOC..."
if mkdir -p $SCRIPTLOC; then
done=yes
else
echo -n "mkdir $SCRIPTLOC "
echo "failed, please try again"
fi
;;
*)
echo "Please select another directory"
;;
esac
fi
else
done=yes
fi
done
echo "Fine.. I will use $SCRIPTLOC"
echo "Creating cIRCus script"
cat > $BINLOC/circus << _EOF
#!/bin/sh
CIRCUS_LIBDIR=$SCRIPTLOC
TCL_LIBRARY=\$CIRCUS_LIBDIR/tcl
TK_LIBRARY=\$CIRCUS_LIBDIR/tk
HUSH_LIBRARY=\$CIRCUS_LIBDIR/hush
export TCL_LIBRARY TK_LIBRARY HUSH_LIBRARY
echo "cIRCus 0.43 by Ivo van der Wijk and Mark de Boer"
echo "For more information check:"
echo
echo " http://www.nijenrode.nl/~ivo/circus/"
echo
\$CIRCUS_LIBDIR/circus-bin -root \$CIRCUS_LIBDIR \$* < /dev/null
_EOF
chmod 755 $BINLOC/circus
echo "Copying files and fixing permissions"
cp -r * $SCRIPTLOC
chmod 644 $SCRIPTLOC/{CHANGES,COPYING,README,system.circusrc}
chmod 644 $SCRIPTLOC/{tk,tcl,hush,scripts,pics}/*
chmod 755 $SCRIPTLOC/circus-bin
echo
echo "Everything should be installed by now. You should be able to start"
echo "cIRCus by typing $BINLOC/circus from your command prompt."
echo "If this command fails, check the above script output carefully for any"
echo "errors, and try to correct them."
echo
echo "Common errors are:"
echo " Using ~ expansion - type the full path (sorry)"
echo " Installing in a directory where you do not have access "
echo " (make sure you are root in that case)"
echo " Making typo's"
echo
echo "You can change default settings such as nick, ircserver, etc. by"
echo "copying $SCRIPTLOC/system.circusrc to $HOME/.circusrc,"
echo "and editing the bottom few lines."
echo
echo "We hope you enjoy using cIRCus! Don't forget to check the cIRCus"
echo "homepage at http://www.nijenrode.nl/~ivo/circus/"
echo
|