samer@0: #!/bin/sh samer@0: # ---------------------- CONFIGURATION PART ---------------------- samer@0: samer@0: HAVE_MATLAB=yes samer@0: SWI_GUI=no samer@1: SETUP_X=yes samer@1: HEADLESS=yes samer@1: DRY_RUN=yes samer@1: samer@1: if [ $# -gt 0 ]; then samer@1: echo "Setting DRY_RUN to $1" 1>&2 samer@1: DRY_RUN=$1 samer@1: fi samer@1: samer@1: # If DRY_RUN=yes, then this script will do nothing, but will output the commands samer@1: # it would have done to stdout. samer@0: samer@0: # ------------------- END OF CONFIGURATION PART ------------------ samer@1: samer@1: if [ $DRY_RUN == yes ]; then samer@1: echo "I am doing a DRY RUN ONLY. The commands to be executed (as root) will" 1>&2 samer@1: echo "be output to stdout. Messages (such as this one) are output to stderr." 1>&2 samer@1: echo "Run the following to write a script to run later:" 1>&2 samer@1: echo 1>&2 samer@1: echo " \$ sh setup_as_root.sh > install.sh" 1>&2 samer@1: echo 1>&2 samer@1: echo "Alternatively, run" 1>&2 samer@1: echo 1>&2 samer@1: echo " \$ sh setup_as_root.sh no" 1>&2 samer@1: echo 1>&2 samer@1: DO=echo samer@1: else samer@1: echo "I am going to do everything FOR REAL. Type 'yes' and hit return to continue" samer@1: read CONTINUE samer@1: if [ $CONTINUE == yes ]; then samer@1: echo "Ok, going ahead with setup" samer@1: else samer@1: exit 1 samer@1: fi samer@1: DO= samer@1: fi samer@0: # APT GET installs samer@1: $DO apt-get install build-essential autoconf mercurial git pkg-config screen samer@1: $DO apt-get install libossp-uuid-dev libssl-dev zlib1g-dev unixodbc-dev libsmf-dev libsqlite3-dev samer@1: $DO apt-get install graphviz lilypond pdf2svg texlive-font-utils p7zip-full samer@1: $DO apt-get install vorbis-tools lame sox faad flac libsox-fmt-all fluidsynth samer@19: $DO apt-get install mysql-server-5 libmyodbc samer@0: samer@0: # Only if you want SWI Prolog GUI samer@1: if [ $SWI_GUI == yes ]; then samer@1: $DO apt-get install libxpm-dev libxt-dev libjpeg-dev libx11-dev libxft-dev libxinerama1 libfontconfig1-dev samer@1: fi samer@0: samer@0: # If you have MATLAB samer@0: if [ $HAVE_MATLAB == yes ]; then samer@30: DO=$DO DRY_RUN=$DRY_RUN as_root.d/init_matlab.sh samer@0: fi samer@0: samer@1: $DO install -bC rc.local /etc samer@0: samer@1: samer@1: if [ $SETUP_X == yes ]; then samer@1: echo "Setting up X server..." 1>&2 samer@1: if [ $HEADLESS == yes ]; then samer@1: echo "Installing dummy video driver for headless X server..." 1>&2 samer@1: $DO apt-get install xinit xserver-xorg-video-dummy samer@1: samer@1: $DO install --mode=644 -bC xorg.conf /etc/X11 samer@0: else samer@1: echo "Installing X server and window manager..." 1>&2 samer@1: $DO apt-get install xinit blackbox samer@0: fi samer@0: samer@1: if [ $DRY_RUN == yes ]; then samer@1: $DO dpkg-reconfigure x11-common samer@1: else samer@1: echo samer@1: echo "I am about to call dpkg-reconfigure x11-common." samer@1: echo "Please select 'Anybody' to allow dml to start the X server automatically." samer@1: echo "Press RETURN to continue." samer@1: read samer@1: $DO dpkg-reconfigure x11-common samer@1: fi samer@0: fi samer@1: