forked from imkevinxu/django-projectbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_dependencies.sh
74 lines (62 loc) · 2.23 KB
/
install_dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Kevin Xu / imkevinxu
# 2012.08.23
# Basic script to install all the dependencies for Django Project Builder
# Tested on a Mac OSX 10.7 (Lion) and 10.8 (Mountain Lion)
PYTHON_VERSION=`python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'`
# Adds GCC ARCHFLAGS if none detected
if [ -z "$ARCHFLAGS" ]
then
echo "export ARCHFLAGS='-arch i386 -arch x86_64'" >> ~/.bash_profile
fi
# Installing pip, distribute, django, virtualenv, virtualenvwrapper
if [ -z `which pip` ]
then
echo "Installing pip..."
sudo easy_install pip
fi
# Installs Distribute http://pypi.python.org/pypi/distribute
curl -O https://raw.github.com/imkevinxu/django-projectbuilder/master/distribute_setup.py
sudo python distribute_setup.py
rm -f distribute*
if [ -z `which django-admin.py` ]
then
echo "Installing django..."
sudo pip install django
fi
if [ -z `which virtualenv` ]
then
echo "Installing virtualenv..."
sudo pip install virtualenv
fi
if [ -z `which virtualenvwrapper.sh` ]
then
echo "Installing virtualenvwrapper..."
sudo pip install virtualenvwrapper
fi
# Adds lines to the shell startup file so that virtualenvwrapper can work
# http://virtualenvwrapper.readthedocs.org/en/latest/install.html#shell-startup-file
if [ -z "$WORKON_HOME" ]
then
echo "Adding virtualenvwrapper variables to ~/.bash_profile"
echo source `which virtualenvwrapper.sh` >> ~/.bash_profile
source `which virtualenvwrapper.sh`
fi
# Fixes problem that occurs on OSX 10.7 Lion when making a new virtualenv,
# it goes looking for disutils but crashes if it can't find one
# http://stackoverflow.com/questions/3129852/python-cant-locate-distutils-path-on-mac-osx
if [ `echo $PYTHON_VERSION | grep -c "2.7" ` -gt 0 ]
then
sudo touch /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py
fi
# Detects if the user has git installed and prompts them to install it if not
if [ -z `which git` ]
then
echo
echo "[WARNING] Detected git has not been installed"
echo "INSTALL git here http://git-scm.com/downloads"
fi
echo
echo " ヽ(^o^)丿 yaaaaaaaay"
echo
echo " All dependencies installed!"