forked from perfsonar/esmond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdevenv
executable file
·44 lines (37 loc) · 1.37 KB
/
mkdevenv
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
#!/bin/sh
export VENV_ROOT=`pwd`
export ESMOND_ROOT=${VENV_ROOT}/devel
export ESMOND_CONF=${ESMOND_ROOT}/esmond-devel.conf
export DJANGO_SETTINGS_MODULE=esmond.settings
# create a dummy TSDB
if [ ! -d ${ESMOND_ROOT}/tsdb-data ]; then
mkdir ${ESMOND_ROOT}/tsdb-data
touch ${ESMOND_ROOT}/tsdb-data/TSDB
fi
# create the virtualenv
virtualenv --prompt="(esmond)" .
. bin/activate
# Have pip upgrade install tools before installing
pip install -U pip
pip install -U setuptools
# XXX(jdugan) FreeBSD hack look for headers and libraries in /usr/local
# ObRant: WTF is with distutils/setuputils/pip not offerring a way to handle this?!?
# ObRantRant: OR maybe it's crappy behaviour on the part of pysqlite? dunno
if [ x`uname` = x"FreeBSD" ]; then
echo patching pysqlite to build under FreeBSD
pip install --no-install pysqlite
echo 'include_dirs=/usr/local/include' >> build/pysqlite/setup.cfg
echo 'library_dirs=/usr/local/lib' >> build/pysqlite/setup.cfg
fi
pip install -r requirements.txt
cat <<EOF > esmond.env
export ESMOND_ROOT=${ESMOND_ROOT}
export ESMOND_CONF=${ESMOND_CONF}
export ESMOND_CLUSTER_CONF=${ESMOND_CLUSTER_CONF}
export ESMOND_TESTING=1
export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
export VENV_ROOT=${VENV_ROOT}
. ${VENV_ROOT}/bin/activate
EOF
echo environment variables and activation put in ${VENV_ROOT}/esmond.env:
cat ${VENV_ROOT}/esmond.env