wolffd@81
|
1 #!/bin/bash
|
samer@0
|
2 # ---------------------- CONFIGURATION PART ----------------------
|
samer@0
|
3
|
wolffd@80
|
4 HAVE_MATLAB=no
|
samer@0
|
5 SWI_GUI=no
|
samer@1
|
6 SETUP_X=yes
|
samer@1
|
7 HEADLESS=yes
|
wolffd@84
|
8 DRY_RUN=yes
|
samer@1
|
9
|
wolffd@84
|
10 if [ $# -gt 0 ]; then
|
wolffd@84
|
11 echo "Setting DRY_RUN to $1" 1>&2
|
wolffd@84
|
12 DRY_RUN=$1
|
wolffd@84
|
13 fi
|
samer@1
|
14
|
samer@1
|
15 # If DRY_RUN=yes, then this script will do nothing, but will output the commands
|
samer@1
|
16 # it would have done to stdout.
|
samer@0
|
17
|
samer@0
|
18 # ------------------- END OF CONFIGURATION PART ------------------
|
samer@1
|
19
|
samer@1
|
20 if [ $DRY_RUN == yes ]; then
|
samer@1
|
21 echo "I am doing a DRY RUN ONLY. The commands to be executed (as root) will" 1>&2
|
samer@1
|
22 echo "be output to stdout. Messages (such as this one) are output to stderr." 1>&2
|
samer@1
|
23 echo "Run the following to write a script to run later:" 1>&2
|
samer@1
|
24 echo 1>&2
|
samer@1
|
25 echo " \$ sh setup_as_root.sh > install.sh" 1>&2
|
samer@1
|
26 echo 1>&2
|
samer@1
|
27 echo "Alternatively, run" 1>&2
|
samer@1
|
28 echo 1>&2
|
samer@1
|
29 echo " \$ sh setup_as_root.sh no" 1>&2
|
samer@1
|
30 echo 1>&2
|
samer@1
|
31 DO=echo
|
samer@1
|
32 else
|
wolffd@80
|
33 echo "I am going to do everything FOR REAL."
|
wolffd@80
|
34 #read CONTINUE
|
wolffd@80
|
35 #if [ $CONTINUE == yes ]; then
|
wolffd@80
|
36 # echo "Ok, going ahead with setup"
|
wolffd@80
|
37 #else
|
wolffd@80
|
38 # exit 1
|
wolffd@80
|
39 #fi
|
samer@1
|
40 DO=
|
samer@1
|
41 fi
|
samer@0
|
42 # APT GET installs
|
wolffd@98
|
43 $DO apt-get install -y build-essential autoconf mercurial git pkg-config screen curl
|
wolffd@81
|
44 $DO apt-get install -y libossp-uuid-dev libssl-dev zlib1g-dev unixodbc-dev libsmf-dev libsqlite3-dev
|
wolffd@81
|
45 $DO apt-get install -y graphviz lilypond pdf2svg texlive-font-utils p7zip-full
|
wolffd@81
|
46 $DO apt-get install -y vorbis-tools lame sox faad flac libsox-fmt-all fluidsynth
|
wolffd@100
|
47 $DO apt-get install -y libasound2-dev libgmp3-dev libreadline-dev zip unzip libarchive-dev # needed for prolog install in setup_dml
|
wolffd@100
|
48 $DO apt-get install -y r-base # R support, may need more modern version
|
wolffd@94
|
49 # below may not be necessary
|
wolffd@94
|
50 #sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password $DML_MYSQL_PASS'
|
wolffd@94
|
51 #sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password $DML_MYSQL_PASS'
|
wolffd@85
|
52 $DO apt-get install -y mysql-server-5.5 libmyodbc
|
samer@0
|
53
|
samer@0
|
54 # Only if you want SWI Prolog GUI
|
samer@1
|
55 if [ $SWI_GUI == yes ]; then
|
wolffd@81
|
56 $DO apt-get install -y libxpm-dev libxt-dev libjpeg-dev libx11-dev libxft-dev libxinerama1 libfontconfig1-dev
|
samer@1
|
57 fi
|
samer@0
|
58
|
samer@0
|
59 # If you have MATLAB
|
samer@0
|
60 if [ $HAVE_MATLAB == yes ]; then
|
samer@30
|
61 DO=$DO DRY_RUN=$DRY_RUN as_root.d/init_matlab.sh
|
samer@0
|
62 fi
|
samer@0
|
63
|
samer@1
|
64 $DO install -bC rc.local /etc
|
samer@0
|
65
|
samer@1
|
66
|
samer@1
|
67 if [ $SETUP_X == yes ]; then
|
samer@1
|
68 echo "Setting up X server..." 1>&2
|
samer@1
|
69 if [ $HEADLESS == yes ]; then
|
samer@1
|
70 echo "Installing dummy video driver for headless X server..." 1>&2
|
wolffd@81
|
71 $DO apt-get install -y xinit xserver-xorg-video-dummy
|
samer@1
|
72
|
samer@1
|
73 $DO install --mode=644 -bC xorg.conf /etc/X11
|
samer@0
|
74 else
|
samer@1
|
75 echo "Installing X server and window manager..." 1>&2
|
wolffd@81
|
76 $DO apt-get install -y xinit blackbox
|
samer@0
|
77 fi
|
samer@0
|
78
|
samer@1
|
79 if [ $DRY_RUN == yes ]; then
|
wolffd@81
|
80 $DO sudo sed -i \
|
wolffd@81
|
81 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
|
wolffd@81
|
82
|
samer@1
|
83 else
|
samer@1
|
84 echo
|
wolffd@80
|
85 echo "I am about to configure x11-common."
|
wolffd@80
|
86 #echo "Please select 'Anybody' to allow dml to start the X server automatically."
|
wolffd@80
|
87 #echo "Press RETURN to continue."
|
wolffd@80
|
88 #read
|
wolffd@80
|
89 #$DO dpkg-reconfigure x11-common
|
wolffd@81
|
90 $DO sudo sed -i \
|
wolffd@80
|
91 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
|
samer@1
|
92 fi
|
samer@0
|
93 fi
|
wolffd@84
|
94 echo "ALL DONE"
|