summaryrefslogtreecommitdiffstats
path: root/virtualenv/build_virtualenv.sh
blob: d874444d67e604c946453fdf69e44f6766485f7a (plain)
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
#!/usr/local/bin/bash

LOCAL=/usr/local
VE=univnautes

BASE_DIR=/home/pfsense
BUILDER_TOOLS=$BASE_DIR/tools
BUILDER_SCRIPTS=$BUILDER_TOOLS/builder_scripts
BUILDER_PROFILES=$BUILDER_SCRIPTS/builder_profiles
UNIVNAUTES=$BUILDER_PROFILES/univnautes

echo "** building virtualenv in $LOCAL/$VE"

if [ -e $LOCAL/$VE ]
then
	echo "$0: $LOCAL/$VE already exists... using it..." 1>&2
	exit 0
fi

cd $LOCAL
virtualenv $VE

echo "** activate virtualenv"
cd $VE
. bin/activate

pip install pip==1.4.1

echo "** install packages"
for p in flup http://isos.univnautes.entrouvert.com/authentic2/authentic2-2.1.1.12.ge5caca7.tar.gz
do
	pip install "$p"
done

for f in pffedportal pfidp bin etc rc.d pkg www
do
	echo "** create `pwd`/`basename $f`"
	cp -a $UNIVNAUTES/virtualenv/$f .
done

echo "** populate www directory"
touch www/index.html
mkdir www/media
ln -s /var/db/cpelements www/media/local

echo "*** manually add lasso and sqlite3 modules"
cp -av /usr/local/lib/python2.7/site-packages/*lasso* ./lib/python2.7/site-packages/
cp -av /usr/local/lib/python2.7/sqlite3 ./lib/python2.7/

echo "** cleaning pyc/pyo"
find . -name "*.pyc" -exec rm {} \;
find . -name "*.pyo" -exec rm {} \;
cd $LOCAL
virtualenv --relocatable $VE

cd $VE
echo "** $LOCAL/$VE is ready"