]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd-vmsetupwizard
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd-vmsetupwizard
index 792f431f05ca515688b0f942b33d97c4c00abb90..43a58809fe4f174d36b5b5c4a40d9f74b64fa576 100755 (executable)
@@ -24,7 +24,7 @@ This is the first time you have started this virtual machine. We will now perfor
 fi
 
 if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
---text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizard at any time from the NeuroDebian menu.
+--text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizard at any time from the NeuroDebian menu. If you proceed you may have to enter the superuser password with is by default 'neurodebian'.
 
 Do you want to proceed with updating the system?
 "; then
@@ -32,35 +32,125 @@ Do you want to proceed with updating the system?
 fi
 
 # initialize apt
-update-manager -c
+#
+# update-manager (from update-manager-gnome) and
+# update-software-center (from software-center)
+# are present only in wheezy
+if which update-manager > /dev/null; then update-manager -c; fi
 
-if [ ! -e /etc/popularity-contest.conf ]; then
+if which update-software-center > /dev/null; then
+    sudo update-software-center --debug 2>&1 | \
+           zenity $icon_opt --title="Updating Software Center Repository"  \
+                  --progress  --pulsate --auto-close --auto-kill;
+else
+    sudo apt-get update 2>&1 | \
+           zenity $icon_opt --title="Running apt-get update" \
+                  --progress  --pulsate --auto-close --auto-kill;
+fi
+
+popconf=/etc/popularity-contest.conf
+if [ ! -e "$popconf" ] || grep -q -e '^PARTICIPATE.*no' "$popconf" ;
+then
        zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
                --text="You will now be given the choice to participate in the package survey. If enabled, a list of installed packages will be anonymously sent to Debian (http://popcon.debian.org). Your participation is important for two reasons:
 
 1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
 2) User statistics can help research software developers to acquire funding for continued development."
 
+       if [ -e "$popconf" ] ; then
+       # just reconfigure so user could get a chance to participate
+               sudo DEBIAN_FRONTEND=gnome dpkg-reconfigure popularity-contest
+       else
        # install, but do not fail if something goes wrong
-       nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
+               nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
+       fi
 fi
 
-# essential things are done -- let's mark sucess
+# install custom filter for synaptics
 if [ $first_run -eq 1 ]; then
+       sudo mkdir -p /root/.synaptic
+       sudo bash -c 'cat << EOT >> /root/.synaptic/filters
+filter "NeuroDebian" {
+  section {
+    inclusive false;
+    sections {
+    };
+  };
+  status {
+    flags 0x1ffff;
+  };
+  pattern {
+    andMode 0;
+    patterns {
+      Origin; "neuro.debian.net"; false;
+      Maintainer; "team@neuro.debian.net"; false;
+    };
+  };
+  priority {
+  };
+  reducedview {
+    enabled false;
+  };
+};
+EOT
+'
+       # essential things are done -- let's mark sucess
        sudo bash -c "mkdir -p $cfg_dir && touch $success_flag"
 fi
 
-packages=$(zenity --list --checklist --column="Install" --column="Description" \
+if ! grep -q '/etc/fsl/fsl.sh' $HOME/.profile && \
+   zenity --question $icon_opt --title="FSL/AFNI Environments" \
+--text="Packages, such as AFNI and FSL, provide large collections of command line tools which are available from their private directories, and require custom environment variables to be set for proper functioning.  Usually you need to source /etc/fsl/fsl.sh or /etc/afni/afni.sh in your environments.
+
+Do you want to get those files, if available, sourced automatically for your environment?
+"; then
+   for t in fsl afni cmtk freesurfer; do
+       cf="/etc/$t/$t.sh"
+       grep -q -e "$cf" $HOME/.profile || \
+               echo "[ -e \"$cf\" ] && . $cf" >> $HOME/.profile
+   done
+fi
+
+# create symlink to shared folder into homedir
+# note: -e check would exit 1 if link is broken
+#       ln -f is used for further robustness
+[ ! -L $HOME/host ] && ln -sf /media/sf_host $HOME/host
+
+# Figure out which version of IPython is available
+ipython_version=$(apt-cache policy ipython 2>/dev/null | sed -ne '/Version table:/ { n;s,^[ \*]*\(.*\) .*,\1,gp}')
+dpkg --compare-versions $ipython_version lt 0.13.1 && ipython=ipython01x || ipython=ipython,ipython-notebook,ipython-qtconsole
+
+# TODO: add PyMVPA:
+#   FALSE "PyMVPA" "python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorial-data" \
+# needs -doc and -tutorial-data package
+packages=$(zenity --height 450 --list $icon_opt --checklist --column="Install" --column="Description" \
           --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
-          --separator=' ' --text="This is the manual
-" \
-FALSE "one" "ipython" \
-FALSE "two" "vim" \
-FALSE "three" "bc dc" || true)
+          --separator=' ' --text="Please select any additional component that shall be installed.
+
+Please note that this selection will not affect packages already installed
+on the system. No installed packages will be reinstalled or removed, only
+additional components will be installed." \
+FALSE "Emacs" "emacs" \
+FALSE "Graphics (e.g. GIMP, Inscape)" "gimp,inkscape,svgtune,xzgv,vym" \
+FALSE "Octave" "qtoctave" \
+FALSE "OpenOffice.org" "openoffice.org" \
+FALSE "PyMVPA Tutorial" "$ipython,python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorialdata,spyder" \
+FALSE "Python: Electrophysiology & Modeling" "python-brian,python-pynn,python-pyentropy,stimfit" \
+FALSE "Python: Neuroimaging" "$ipython,spyder,nipy-suite,python-mvpa2" \
+FALSE "Python: Scientific stack" "$ipython,spyder,python-matplotlib,python-pandas,python-sympy,python-statsmodels,python-skimage" \
+FALSE "R" "r-recommended" \
+FALSE "TeX Live" "texlive" \
+FALSE "Adobe Flash browser plugin" "flashplugin-nonfree" \
+|| true)
 
 if [ -n "$packages" ]; then
-       nd-autoinstall -f -p "$packages" true
+       for pkgs in $packages; do
+               nd-autoinstall -f -p "${pkgs//,/ }" true
+       done
 fi
 
+# some sane ending
+zenity --info $icon_opt --text="Wizard has finished."
+
 # and start greeter
 x-www-browser http://neuro.debian.net/vm_welcome.html &