InstallationGuidelines/Linux/Developer/Script: install_eden_fedora.2.sh

File install_eden_fedora.2.sh, 3.0 KB (added by Arnav Sharma, 10 years ago)

Installation Script for Fedora after moving templates

Line 
1#!/bin/bash
2set -e
3
4#
5# Install a Sahana Eden Developer environment in Fedora/RHEL
6# - tested on Fedora 20
7#
8
9f_Quick() {
10 MODE="quick"
11}
12f_Medium() {
13 MODE="medium"
14}
15f_Full() {
16 MODE="full"
17}
18if [[ -z "$1" ]]; then
19 # Offer a menu
20 echo "Welcome to the Sahana Eden Dev Installation script for Ubuntu/Debian."
21 echo "This will install a working verion of Sahana Eden into /home/web2py"
22 echo
23 echo "Select the Installation Type:"
24 echo
25 echo "1. Medium - installs all mandatory and some common optional dependencies. It is the normal recommended option."
26 echo "2. Quick - installs only mandatory dependencies. This is recommended if you are on a slow Internet connection or need to get operational quickly."
27 echo "3. Full - installs all optional dependencies"
28 echo
29 echo -n "Your choice (Enter 1/2/3 depending on your requirements) ? : "
30 read choice
31 case "$choice" in
32 1) f_Medium ;;
33 2) f_Quick ;;
34 3) f_Full ;;
35 *) echo "\"$choice\" is not valid" ; exit ;;
36 esac
37elif [[ "$1" = "quick" ]]; then
38 MODE="quick"
39elif [[ "$1" = "medium" ]]; then
40 MODE="medium"
41elif [[ "$1" = "full" ]]; then
42 MODE="full"
43else
44 echo >&2 "$1 is not a valid option!\nPlease use either 'quick', 'medium' or 'full'"
45 exit 1
46fi
47
48# Install Git
49sudo yum install -y git
50
51# Install Python Libs
52sudo yum install -y python-lxml python-shapely python-dateutil
53if [[ "$MODE" = "medium" ]]; then
54 sudo yum -y install python-reportlab python-xlrd python-xlwt
55elif [[ "$MODE" = "full" ]]; then
56 sudo yum -y install python-reportlab python-xlrd python-xlwt
57 sudo yum -y install python-matplotlib numpy
58fi
59
60# Install Web2Py
61cd ~
62
63# In case the user has already tried installing but had stopped in between
64# A better solution would be to add a check if the dir exists and
65# ask the user if he wants to delete it or not
66# rm -rf web2py
67
68git clone git://github.com/web2py/web2py.git
69
70cat << EOF > /home/web2py/routes.py
71#!/usr/bin/python
72default_application = 'eden'
73default_controller = 'default'
74default_function = 'index'
75routes_onerror = [
76 ('eden/400', '!'),
77 ('eden/401', '!'),
78 ('eden/*', '/eden/errors/index'),
79 ('*/*', '/eden/errors/index'),
80 ]
81EOF
82
83# Install Eden
84cd /home/web2py/applications
85git clone git://github.com/flavour/eden.git
86cp /home/web2py/applications/eden/modules/templates/000_config.py /home/web2py/applications/eden/models
87sed -i 's|EDITING_CONFIG_FILE = False|EDITING_CONFIG_FILE = True|' /home/web2py/applications/eden/models/000_config.py
88echo -n "What is your username (Please enter your computer's username, and not your web2py username)? : "
89
90read username
91if id -u $username >/dev/null 2>&1; then
92 chown -R $username /home/web2py
93 echo "Installation is now complete - you can run Sahana by running:"
94 echo "cd /home/web2py; python web2py.py -a eden"
95 echo "Then run Sahana by pointing your web browser at http://127.0.0.1:8000"
96 echo "Be patient on the 1st run as the database needs to be created"
97else
98 echo "username entered doesn't seem to be valid."
99fi