Changes between Initial Version and Version 1 of InstallationGuidelines/Linux/Developer/Script


Ignore:
Timestamp:
12/02/11 12:00:08 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelines/Linux/Developer/Script

    v1 v1  
     1= Installation Guidelines: Linux - Developer (Script) =
     2
     3== Ubuntu ==
     4{{{
     5#!/bin/bash
     6set -e
     7
     8#
     9# Install a Sahana Eden Developer environment in Ubuntu
     10# - tested on 11.10
     11#
     12
     13f_Quick() {
     14    MODE="quick"
     15}
     16f_Medium() {
     17    MODE="medium"
     18}
     19f_Full() {
     20    MODE="full"
     21}
     22
     23if [[ -z "$1" ]]; then
     24    # Offer a menu
     25    echo "Welcome to the Sahana Eden Dev Installation script for Ubuntu."
     26    echo "This will install a working verion of Sahana Eden into ~/web2py."
     27    echo
     28    echo "Select the Installation Type:"
     29    echo
     30    echo "1. Medium - installs all mandatory and some common optional dependencies. It is the normal recommended option."
     31    echo "2. Quick - installs only mandatory dependencies. This is recommended if you are on a slow Internet connection or need to get operational quickly."
     32    echo "3. Full - installs all optional dependencies & the Eclipse debugger. It is only recommended if you are on a fast Internet connection & are prepared to be patient."
     33    echo
     34    echo -n "Your choice? : "
     35    read choice
     36
     37    case "$choice" in
     38      1) f_Medium ;;
     39      2) f_Quick ;;
     40      3) f_Full ;;
     41      *) echo "\"$choice\" is not valid" ; exit ;;
     42    esac
     43elif [[ "$1" = "quick" ]]; then
     44    # Set the option direct
     45    MODE="quick"
     46elif [[ "$1" = "medium" ]]; then
     47    # Set the option direct
     48    MODE="medium"
     49elif [[ "$1" = "full" ]]; then
     50    # Set the option direct
     51    MODE="full"
     52else
     53    echo >&2 "$1 is not a valid option!\nPlease use either 'quick', 'medium' or 'full'"
     54    exit 1
     55fi
     56
     57# Install Python Libs
     58#sudo apt-get install -y python2.7 python-dateutil
     59sudo apt-get install -y python-lxml python-shapely bzr
     60if [[ "$MODE" = "medium" ]]; then
     61    sudo apt-get -y install python-reportlab python-xlwt
     62elif [[ "$MODE" = "full" ]]; then
     63    sudo apt-get -y install python-reportlab python-xlwt
     64    sudo apt-get -y install matplotlib numpy scipy python-xlrd
     65    sudo apt-get -y install eclipse
     66fi
     67
     68# Install Web2Py
     69cd
     70if [[ "$MODE" = "full" ]]; then
     71    # Install Bzr Trunk
     72    bzr branch lp:~mdipierro/web2py/devel web2py
     73else
     74    # Install the stable version
     75    wget http://www.web2py.com/examples/static/web2py_src.zip
     76    unzip web2py_src.zip
     77fi
     78
     79cat << EOF > "~/web2py/routes.py"
     80#!/usr/bin/python
     81default_application = 'eden'
     82default_controller = 'default'
     83default_function = 'index'
     84routes_onerror = [
     85        ('eden/400', '!'),
     86        ('eden/401', '!'),
     87        ('eden/*', '/eden/errors/index'),
     88        ('*/*', '/eden/errors/index'),
     89    ]
     90EOF
     91
     92# Install Eden
     93cd ~/web2py/applications
     94bzr branch lp:sahana-eden eden
     95
     96echo "Installation is now complete - you can run Sahana either by using the Eclipse debugger or else by running:"
     97echo "cd ~/web2py ; python web2py.py -a eden"
     98}}}
     99
     100== Install Eclipse ==
     101If you want a graphical debugger to set breakpoints & step through code then it is recommended to install Eclipse:
     102 * DeveloperGuidelinesEclipse
     103
     104== Developer Guidelines ==
     105Now, see how to put your installation to work:
     106 * DeveloperGuidelines