diff --git a/AUTHORS b/AUTHORS index cdfdd4c2fe..ca6e14b252 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,3 +72,4 @@ Giulio Gratta David Baumgold Jason Bau Frances Botsford +Slater Victoroff diff --git a/README.md b/README.md index ed52c21fb2..26ac04e499 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Installation The installation process is a bit messy at the moment. Here's a high-level overview of what you should do to get started. -**TLDR:** There is a `scripts/create-dev-env.sh` script that will attempt to set all -of this up for you. If you're in a hurry, run that script. Otherwise, I suggest +**TLDR:** There is a `scripts/create-dev-env.sh` that will attempt to set all of this up for you. +If you're in a hurry, run that script. Otherwise, I suggest that you understand what the script is doing, and why, by reading this document. Directory Hierarchy diff --git a/requirements/system/ubuntu/apt-packages.txt b/requirements/system/ubuntu/apt-packages.txt index 2635388757..c61c658111 100644 --- a/requirements/system/ubuntu/apt-packages.txt +++ b/requirements/system/ubuntu/apt-packages.txt @@ -1,12 +1,18 @@ python-software-properties pkg-config +gfortran +libatlas-dev +libblas-dev +liblapack-dev +liblapack3gf curl git python-virtualenv +python-scipy +python-numpy build-essential python-dev gfortran -liblapack-dev libfreetype6-dev libpng12-dev libjpeg-dev @@ -14,6 +20,7 @@ libxml2-dev libxslt-dev yui-compressor graphviz +libgraphviz-dev graphviz-dev mysql-server libmysqlclient-dev @@ -23,3 +30,7 @@ libreadline6-dev mongodb nodejs coffeescript +mysql +libmysqlclient-dev +virtualenvwrapper +libgeos-ruby1.8 diff --git a/scripts/create-dev-env.sh b/scripts/create-dev-env.sh index d387465c49..520ce05b5c 100755 --- a/scripts/create-dev-env.sh +++ b/scripts/create-dev-env.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash + +#Exit if any commands return a non-zero status set -e # posix compliant sanity check @@ -27,10 +29,17 @@ EOL } +#Setting error color to red before reset error() { printf '\E[31m'; echo "$@"; printf '\E[0m' } +#Setting warning color to magenta before reset +warning() { + printf '\E[35m'; echo "$@"; printf '\E[0m' +} + +#Setting output color to cyan before reset output() { printf '\E[36m'; echo "$@"; printf '\E[0m' } @@ -51,7 +60,7 @@ EO info() { cat<1.7 is # --no-site-packages - mkvirtualenv -a "$BASE/mitx" mitx || { + mkvirtualenv -a "$HOME/.virtualenvs" edx-platform || { error "mkvirtualenv exited with a non-zero error" return 1 } @@ -380,10 +442,30 @@ if [[ -n $compile ]]; then rm -rf numpy-${NUMPY_VER} scipy-${SCIPY_VER} fi +# building correct version of distribute from source +DISTRIBUTE_VER="0.6.28" +output "Building Distribute" +SITE_PACKAGES="$HOME/.virtualenvs/edx-platform/lib/python2.7/site-packages" +cd "$SITE_PACKAGES" +curl -O http://pypi.python.org/packages/source/d/distribute/distribute-${DISTRIBUTE_VER}.tar.gz +tar -xzvf distribute-${DISTRIBUTE_VER}.tar.gz +cd distribute-${DISTRIBUTE_VER} +python setup.py install +cd .. +rm distribute-${DISTRIBUTE_VER}.tar.gz + +DISTRIBUTE_VERSION=`pip freeze | grep distribute` + +if [[ "$DISTRIBUTE_VERSION" == "distribute==0.6.28" ]]; then + output "Distribute successfully installed" +else + error "Distribute failed to build correctly. This script requires a working version of Distribute 0.6.28 in your virtualenv's python installation" + exit 1 +fi + case `uname -s` in Darwin) # on mac os x get the latest distribute and pip - curl http://python-distribute.org/distribute_setup.py | python pip install -U pip # need latest pytz before compiling numpy and scipy pip install -U pytz @@ -395,18 +477,29 @@ case `uname -s` in ;; esac -output "Installing MITx pre-requirements" -pip install -r $BASE/mitx/pre-requirements.txt +output "Installing edX pre-requirements" +pip install -r $BASE/edx-platform/requirements/edx/pre.txt -output "Installing MITx requirements" -# Need to be in the mitx dir to get the paths to local modules right -cd $BASE/mitx -pip install -r requirements.txt +output "Installing edX requirements" +# Install prereqs +cd $BASE/edx-platform +rvm use $RUBY_VER +rake install_prereqs + +# Final dependecy +output "Finishing Touches" +cd $BASE +pip install argcomplete +cd $BASE/edx-platform +bundle install mkdir "$BASE/log" || true mkdir "$BASE/db" || true +mkdir "$BASE/data" || true - +rake django-admin[syncdb] +rake django-admin[migrate] +rake django-admin[update-templates] # Configure Git output "Fixing your git default settings" diff --git a/scripts/install-system-req.sh b/scripts/install-system-req.sh index 37bc6d1716..43e405524d 100755 --- a/scripts/install-system-req.sh +++ b/scripts/install-system-req.sh @@ -16,10 +16,11 @@ output() { ### START -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BREW_FILE=$DIR/"brew-formulas.txt" -APT_REPOS_FILE=$DIR/"apt-repos.txt" -APT_PKGS_FILE=$DIR/"apt-packages.txt" +SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +REQUIREMENTS_DIR="$SELF_DIR/../requirements/system" +BREW_FILE=$REQUIREMENTS_DIR/"mac_os_x/brew-formulas.txt" +APT_REPOS_FILE=$REQUIREMENTS_DIR/"ubuntu/apt-repos.txt" +APT_PKGS_FILE=$REQUIREMENTS_DIR/"ubuntu/apt-packages.txt" case `uname -s` in [Ll]inux) @@ -30,8 +31,9 @@ case `uname -s` in distro=`lsb_release -cs` case $distro in - maya|lisa|natty|oneiric|precise|quantal) - output "Installing Ubuntu requirements" + #Tries to install the same + squeeze|wheezy|jessie|maya|lisa|olivia|nadia|natty|oneiric|precise|quantal|raring) + output "Installing Debian family requirements" # DEBIAN_FRONTEND=noninteractive is required for silent mysql-server installation export DEBIAN_FRONTEND=noninteractive @@ -39,7 +41,10 @@ case `uname -s` in # add repositories cat $APT_REPOS_FILE | xargs -n 1 sudo add-apt-repository -y sudo apt-get -y update - + sudo apt-get -y install gfortran + sudo apt-get -y install graphviz libgraphviz-dev graphviz-dev + sudo apt-get -y install libatlas-dev libblas-dev + sudo apt-get -y install ruby-rvm # install packages listed in APT_PKGS_FILE cat $APT_PKGS_FILE | xargs sudo apt-get -y install ;; @@ -70,10 +75,13 @@ EO output "Installing OSX requirements" if [[ ! -r $BREW_FILE ]]; then - error "$BREW_FILE does not exist, needed to install brew" + error "$BREW_FILE does not exist, please include the brew formulas file in the requirements/system/mac_os_x directory" exit 1 fi + # for some reason openssl likes to be installed by itself first + brew install openssl + # brew errors if the package is already installed for pkg in $(cat $BREW_FILE); do grep $pkg <(brew list) &>/dev/null || {