changeset 207:2652fa715b44

quickinstall/wikiconfig: make the env directory and python interpreter configurable
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 30 Apr 2011 21:28:25 +0200
parents 0ff3c43a0a26
children 321898d8273f
files quickinstall wikiconfig.py
diffstat 2 files changed, 39 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/quickinstall	Sat Apr 30 20:10:44 2011 +0200
+++ b/quickinstall	Sat Apr 30 21:28:25 2011 +0200
@@ -1,9 +1,13 @@
 #!/bin/bash
-# create a virtual environment in directory env/
+# create a virtual environment in directory $DIR/
 # needs: curl or wget, unzip, gzip, tar, pip
 
-virtualenv --no-site-packages env
-source env/bin/activate
+DIR=env
+PYTHON=python
+
+virtualenv --no-site-packages --python $PYTHON $DIR
+
+source $DIR/bin/activate
 
 download()
 {
@@ -18,36 +22,36 @@
     fi
 }
 
-# get some 3rd party stuff and unpack them into env/, where the default
+# get some 3rd party stuff and unpack them into $DIR/, where the default
 # wikiconfig.py expects them. should be replaced by packaging.
 # we do this FIRST, so that breakage with pip install is better visible.
 
-download env/ckeditor.tgz http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.5/ckeditor_3.5.tar.gz
-tar xz -C env/ -f env/ckeditor.tgz
-
-download env/twd.tgz http://static.moinmo.in/files/packages/TWikiDrawPlugin-moin.tar.gz
-tar xz -C env/ -f env/twd.tgz
-
-download env/svgedit.tgz http://static.moinmo.in/files/packages/svg-edit.tar.gz
-tar xz -C env/ -f env/svgedit.tgz
+download $DIR/ckeditor.tgz http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.5/ckeditor_3.5.tar.gz
+tar xz -C $DIR/ -f $DIR/ckeditor.tgz
 
-mkdir env/jquery.fu
-download env/jquery.fu/jquery.fileupload.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload.js
-download env/jquery.fu/jquery.fileupload-ui.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.js
-download env/jquery.fu/jquery.fileupload-ui.css https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.css
-download env/jquery.fu/pbar-ani.gif https://www.github.com/blueimp/jQuery-File-Upload/raw/master/pbar-ani.gif
+download $DIR/twd.tgz http://static.moinmo.in/files/packages/TWikiDrawPlugin-moin.tar.gz
+tar xz -C $DIR/ -f $DIR/twd.tgz
 
-mkdir env/jquery
-download env/jquery/jquery.min.js http://code.jquery.com/jquery-1.4.4.min.js
+download $DIR/svgedit.tgz http://static.moinmo.in/files/packages/svg-edit.tar.gz
+tar xz -C $DIR/ -f $DIR/svgedit.tgz
 
-download env/svgweb.zip http://svgweb.googlecode.com/files/svgweb-2010-08-10-Owlephant-1.zip
-unzip -q -o -d env/ env/svgweb.zip
+mkdir $DIR/jquery.fu
+download $DIR/jquery.fu/jquery.fileupload.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload.js
+download $DIR/jquery.fu/jquery.fileupload-ui.js https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.js
+download $DIR/jquery.fu/jquery.fileupload-ui.css https://www.github.com/blueimp/jQuery-File-Upload/raw/master/jquery.fileupload-ui.css
+download $DIR/jquery.fu/pbar-ani.gif https://www.github.com/blueimp/jQuery-File-Upload/raw/master/pbar-ani.gif
 
-DIR='AnyWikiDraw 0.14'
-download env/awd.zip 'http://downloads.sourceforge.net/project/anywikidraw/anywikidraw/anywikidraw-0.14/anywikidraw-0.14.zip?use_mirror=ignum'
-unzip -q -o -d env/ env/awd.zip
-cd env/
-ln -s "$DIR" AnyWikiDraw
+mkdir $DIR/jquery
+download $DIR/jquery/jquery.min.js http://code.jquery.com/jquery-1.4.4.min.js
+
+download $DIR/svgweb.zip http://svgweb.googlecode.com/files/svgweb-2010-08-10-Owlephant-1.zip
+unzip -q -o -d $DIR/ $DIR/svgweb.zip
+
+AWDDIR='AnyWikiDraw 0.14'
+download $DIR/awd.zip 'http://downloads.sourceforge.net/project/anywikidraw/anywikidraw/anywikidraw-0.14/anywikidraw-0.14.zip?use_mirror=ignum'
+unzip -q -o -d $DIR/ $DIR/awd.zip
+cd $DIR/
+ln -s "$AWDDIR" AnyWikiDraw
 cd ..
 
 # first install babel, moin's setup.py will emit a warning if it is not there
--- a/wikiconfig.py	Sat Apr 30 20:10:44 2011 +0200
+++ b/wikiconfig.py	Sat Apr 30 21:28:25 2011 +0200
@@ -52,16 +52,17 @@
 
     # for now we load some 3rd party stuff from the place within moin where it is currently located,
     # but soon we'll get rid of this stuff:
+    env_dir = 'env'
     serve_files = dict(
+        docs = os.path.join(wikiconfig_dir, 'docs', '_build', 'html'),
         # see "quickinstall" script about how to get those files there
-        ckeditor = os.path.join(wikiconfig_dir, 'env', 'ckeditor'),
-        jquery = os.path.join(wikiconfig_dir, 'env', 'jquery'),
-        svgweb = os.path.join(wikiconfig_dir, 'env', 'svgweb', 'src'),
-        anywikidraw = os.path.join(wikiconfig_dir, 'env', 'AnyWikiDraw', 'anywikidraw', 'moinmoin'),
-        twikidraw = os.path.join(wikiconfig_dir, 'env', 'TWikiDrawPlugin'),
-        svgedit = os.path.join(wikiconfig_dir, 'env', 'svg-edit'),
-        docs = os.path.join(wikiconfig_dir, 'docs', '_build', 'html'),
-        fileupload = os.path.join(wikiconfig_dir, 'env', 'jquery.fu'),
+        ckeditor = os.path.join(wikiconfig_dir, env_dir, 'ckeditor'),
+        jquery = os.path.join(wikiconfig_dir, env_dir, 'jquery'),
+        svgweb = os.path.join(wikiconfig_dir, env_dir, 'svgweb', 'src'),
+        anywikidraw = os.path.join(wikiconfig_dir, env_dir, 'AnyWikiDraw', 'anywikidraw', 'moinmoin'),
+        twikidraw = os.path.join(wikiconfig_dir, env_dir, 'TWikiDrawPlugin'),
+        svgedit = os.path.join(wikiconfig_dir, env_dir, 'svg-edit'),
+        fileupload = os.path.join(wikiconfig_dir, env_dir, 'jquery.fu'),
     )
 
     # ^^^ DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO ^^^