wolffd@81: #!/bin/bash samer@0: # ---------------------- CONFIGURATION PART ---------------------- samer@0: wolffd@80: HAVE_MATLAB=no samer@0: SWI_GUI=no samer@1: SETUP_X=yes samer@1: HEADLESS=yes wolffd@84: DRY_RUN=yes samer@1: wolffd@84: if [ $# -gt 0 ]; then wolffd@84: echo "Setting DRY_RUN to $1" 1>&2 wolffd@84: DRY_RUN=$1 wolffd@84: 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 wolffd@80: echo "I am going to do everything FOR REAL." wolffd@80: #read CONTINUE wolffd@80: #if [ $CONTINUE == yes ]; then wolffd@80: # echo "Ok, going ahead with setup" wolffd@80: #else wolffd@80: # exit 1 wolffd@80: #fi samer@1: DO= samer@1: fi samer@0: # APT GET installs wolffd@105: wolffd@105: # add more up-to-date source for R wolffd@105: # wolffd@105: $DO apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 wolffd@105: $DO add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu trusty/' wolffd@105: wolffd@103: $DO apt-get update wolffd@98: $DO apt-get install -y build-essential autoconf mercurial git pkg-config screen curl wolffd@81: $DO apt-get install -y libossp-uuid-dev libssl-dev zlib1g-dev unixodbc-dev libsmf-dev libsqlite3-dev wolffd@81: $DO apt-get install -y graphviz lilypond pdf2svg texlive-font-utils p7zip-full wolffd@81: $DO apt-get install -y vorbis-tools lame sox faad flac libsox-fmt-all fluidsynth wolffd@100: $DO apt-get install -y libasound2-dev libgmp3-dev libreadline-dev zip unzip libarchive-dev # needed for prolog install in setup_dml wolffd@105: $DO apt-get install -y software-properties-common apt-transport-https r-base # R support, wolffd@106: wolffd@106: # install R packages wolffd@106: $DO R -e 'install.packages(c("pracma"))' wolffd@106: wolffd@106: wolffd@94: # below may not be necessary wolffd@94: #sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password $DML_MYSQL_PASS' wolffd@94: #sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password $DML_MYSQL_PASS' wolffd@85: $DO apt-get install -y mysql-server-5.5 libmyodbc samer@0: samer@0: # Only if you want SWI Prolog GUI samer@1: if [ $SWI_GUI == yes ]; then wolffd@81: $DO apt-get install -y 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 wolffd@81: $DO apt-get install -y 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 wolffd@81: $DO apt-get install -y xinit blackbox samer@0: fi samer@0: samer@1: if [ $DRY_RUN == yes ]; then wolffd@81: $DO sudo sed -i \ wolffd@81: 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config wolffd@81: samer@1: else samer@1: echo wolffd@80: echo "I am about to configure x11-common." wolffd@80: #echo "Please select 'Anybody' to allow dml to start the X server automatically." wolffd@80: #echo "Press RETURN to continue." wolffd@80: #read wolffd@80: #$DO dpkg-reconfigure x11-common wolffd@81: $DO sudo sed -i \ wolffd@80: 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config samer@1: fi samer@0: fi wolffd@84: echo "ALL DONE"