]> git.donarmstrong.com Git - neurodebian.git/blobdiff - survey/Makefile
No automatic figure generation on the webserver
[neurodebian.git] / survey / Makefile
index 51c9bad450c313fffec0c3c5b1a96a25bb006fdc..8b60230c309c5f1f5e36e377d248f0ebc593f595 100644 (file)
@@ -1,7 +1,7 @@
 all: index.html
 
 clean:
-       -rm *.html *.js
+       -rm *.html *.js *.txt
 
 jquery.form.js:
        wget --no-check-certificate http://github.com/malsup/form/raw/master/jquery.form.js
@@ -9,6 +9,24 @@ jquery.form.js:
 index.html: survey.rst
        rst2html --link-stylesheet --stylesheet-path=survey.css survey.rst > $@
 
+results.html: results.rst
+       rst2html --link-stylesheet --stylesheet-path=survey.css results.rst > $@
+
+results_snippet.html: results.html
+       head -n$$(echo "$$(grep -n '</body>' < results.html | cut -d ':' -f 1,1) - 1" \
+               | bc ) results.html \
+               | tail -n$$(echo "$$(wc -l < results.html) - $$(grep -n '<body>' \
+               < results.html | cut -d ':' -f 1,1) - 2" | bc ) > $@
+
+statfigures: oslist.txt swlist.txt datamodlist.txt
+# create "lockfile'
+       @touch $@
+       @[ "$$(cat nsubmissions.stamp || true)" != "$$(ls -1 data |wc -l)" ] \
+               && ls -1 data |wc -l > nsubmissions.stamp \
+               && MVPA_MATPLOTLIB_BACKEND=agg ./makestats data figures || true
+# remove lockfile
+       @-rm $@
+
 getdata:
        rsync -rvzlhp --delete \
                neurodebian@www.pymvpa.org:/home/neurodebian/surveydata .
@@ -25,9 +43,9 @@ datamodlist.txt: survey.rst
        grep '"bg_datamod"' survey.rst | sed -e 's/.*name="bg_datamod" value="//' \
                -e 's," />,: ",' -e 's,<br />$$,",' -e 's/ "$$/ "Other"/' > $@
 
-upload: index.html jquery.form.js survey.css
+upload: index.html results.html results_snippet.html jquery.form.js survey.css surveycollector.cgi
        rsync -rvzlhp --delete  \
-        --exclude=Makefile --exclude='*.inc' --exclude='*.rst' --exclude='*.txt' \
-        --exclude=makestats --exclude=surveydata --exclude='*.cgi' \
-               --chmod=Dg+s,g+rw * neurodebian@www.pymvpa.org:/home/www/neuro.debian.net/www/survey/
+        --exclude='*.txt' --exclude=surveydata --exclude='*.cgi' --exclude=figures \
+               --chmod=Dg+s,g+rw * neurodebian@www.pymvpa.org:/home/neurodebian/survey/
+       scp surveycollector.cgi neurodebian@www.pymvpa.org:/srv/neuro.debian.net/cgi-bin/