| | 1 | = Installation Guidelines: Linux - Developer (Script) = |
| | 2 | |
| | 3 | == Ubuntu == |
| | 4 | {{{ |
| | 5 | #!/bin/bash |
| | 6 | set -e |
| | 7 | |
| | 8 | # |
| | 9 | # Install a Sahana Eden Developer environment in Ubuntu |
| | 10 | # - tested on 11.10 |
| | 11 | # |
| | 12 | |
| | 13 | f_Quick() { |
| | 14 | MODE="quick" |
| | 15 | } |
| | 16 | f_Medium() { |
| | 17 | MODE="medium" |
| | 18 | } |
| | 19 | f_Full() { |
| | 20 | MODE="full" |
| | 21 | } |
| | 22 | |
| | 23 | if [[ -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 |
| | 43 | elif [[ "$1" = "quick" ]]; then |
| | 44 | # Set the option direct |
| | 45 | MODE="quick" |
| | 46 | elif [[ "$1" = "medium" ]]; then |
| | 47 | # Set the option direct |
| | 48 | MODE="medium" |
| | 49 | elif [[ "$1" = "full" ]]; then |
| | 50 | # Set the option direct |
| | 51 | MODE="full" |
| | 52 | else |
| | 53 | echo >&2 "$1 is not a valid option!\nPlease use either 'quick', 'medium' or 'full'" |
| | 54 | exit 1 |
| | 55 | fi |
| | 56 | |
| | 57 | # Install Python Libs |
| | 58 | #sudo apt-get install -y python2.7 python-dateutil |
| | 59 | sudo apt-get install -y python-lxml python-shapely bzr |
| | 60 | if [[ "$MODE" = "medium" ]]; then |
| | 61 | sudo apt-get -y install python-reportlab python-xlwt |
| | 62 | elif [[ "$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 |
| | 66 | fi |
| | 67 | |
| | 68 | # Install Web2Py |
| | 69 | cd |
| | 70 | if [[ "$MODE" = "full" ]]; then |
| | 71 | # Install Bzr Trunk |
| | 72 | bzr branch lp:~mdipierro/web2py/devel web2py |
| | 73 | else |
| | 74 | # Install the stable version |
| | 75 | wget http://www.web2py.com/examples/static/web2py_src.zip |
| | 76 | unzip web2py_src.zip |
| | 77 | fi |
| | 78 | |
| | 79 | cat << EOF > "~/web2py/routes.py" |
| | 80 | #!/usr/bin/python |
| | 81 | default_application = 'eden' |
| | 82 | default_controller = 'default' |
| | 83 | default_function = 'index' |
| | 84 | routes_onerror = [ |
| | 85 | ('eden/400', '!'), |
| | 86 | ('eden/401', '!'), |
| | 87 | ('eden/*', '/eden/errors/index'), |
| | 88 | ('*/*', '/eden/errors/index'), |
| | 89 | ] |
| | 90 | EOF |
| | 91 | |
| | 92 | # Install Eden |
| | 93 | cd ~/web2py/applications |
| | 94 | bzr branch lp:sahana-eden eden |
| | 95 | |
| | 96 | echo "Installation is now complete - you can run Sahana either by using the Eclipse debugger or else by running:" |
| | 97 | echo "cd ~/web2py ; python web2py.py -a eden" |
| | 98 | }}} |
| | 99 | |
| | 100 | == Install Eclipse == |
| | 101 | If you want a graphical debugger to set breakpoints & step through code then it is recommended to install Eclipse: |
| | 102 | * DeveloperGuidelinesEclipse |
| | 103 | |
| | 104 | == Developer Guidelines == |
| | 105 | Now, see how to put your installation to work: |
| | 106 | * DeveloperGuidelines |