]> git.donarmstrong.com Git - neurodebian.git/blob - Makefile
Merge commit newdesign (web-20130424-72-g6662d1c)
[neurodebian.git] / Makefile
1 #WWW_UPLOAD_URI = neurodebian@neurodebian.ovgu.de:/home/neurodebian/www
2 WWW_UPLOAD_URI = ../../www
3 WWW_DIR = build/html/
4
5 WWW_UPLOAD_URI_STATIC=$(WWW_UPLOAD_URI)/_static
6
7 BIGMESS_OPTS = -c neurodebian.cfg
8 BIGMESS_CMD = PYTHONPATH=.:3rd/bigmess:$(PYTHONPATH) 3rd/bigmess/bin/bigmess
9 BIGMESS = $(BIGMESS_CMD) $(BIGMESS_OPTS)
10
11 # Lentghy one due to updatedb
12 all: updatedb upload-website mirmon
13 # Quick one -- just rebuilds html if new changes and adjusts the status of the mirrors
14 refresh: upload-website-stamp mirmon
15
16 website-build-depends:
17         : # Python modules
18         sudo apt-get install python-sphinx python-argparse python-xdg python-debian
19         : # JavaScripts
20         sudo apt-get install libjs-jquery-easing libjs-jquery-mousewheel libjs-jquery-fancybox
21
22
23 pics:
24         $(MAKE) -C artwork
25
26
27 html: pics source
28         rsync -rvlhpt sphinx/ build/src
29         cd artwork;     cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
30         cp 3rd/jquery.livetwitter/jquery.livetwitter.min.js build/src/_static
31         cp neurodebian.cfg build/src/_static
32         cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
33         ln -fs /usr/share/javascript build/html/
34         mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
35         cp -r build/src/lists $(WWW_DIR)/
36         cp -r sphinx/survey/2011/figures/* $(WWW_DIR)/_images/
37         @echo "I: extracting header/trailer to be reused in non-sphinx pages"
38         sed -ne '1,/<!-- HEADNOTES -->/p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-header.ihtml
39         sed -ne '/<h2>Comments<\/h2>/,$$p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-trailer.ihtml
40
41 clean:
42         -rm html-stamp source-stamp upload-website-stamp
43         $(MAKE) -C artwork clean
44
45
46 distclean: clean
47         -rm -rf build
48
49
50 source: source-stamp
51 source-stamp: 
52         mkdir -p build/src/pkgs/
53         mkdir -p build/src/lists/
54         mkdir -p build/src/pkglists/
55         $(BIGMESS) mkpkgs  -d build/src/pkgs/
56         $(BIGMESS) mkaptcfgs -d build/src/lists/
57         $(BIGMESS) mkrepocfg > build/src/sources_lists
58         $(BIGMESS) mkpkgtocs -d build/src/pkglists > build/src/pkgs.rst
59         touch $@
60
61 cachefiles:
62         $(BIGMESS) cachefiles -f
63
64 updatedb: cachefiles
65         $(BIGMESS) updatedb
66         -rm source-stamp
67
68 upload-website: html
69         rsync -rvzlhp --delete \
70         --exclude=debian --exclude=debian-local --exclude=debian-devel --exclude=_files \
71         --chmod=Dg+s,g+rw $(WWW_DIR) $(WWW_UPLOAD_URI)
72         : # Touch stamp here so we get it updated on every upload
73         touch $@-stamp
74
75 # call upload iff .git/index was modified, i.e. new changes got pulled in
76 upload-website-stamp: .git/index
77         $(MAKE) upload-website
78
79 mirmon:
80         # update and generate mirrors report
81         [ -x /usr/bin/mirmon ] && mirmon -q -get update -c mirmon-neurodebian.conf 2>&1 \
82         | grep -v 'date: invalid date.*DOCTYPE' || :
83         # [ -x $(WWW_UPLOAD_URI_STATIC)/mirrors-check.ihtml ] &&
84         # everything must be in place!
85         cat $(WWW_UPLOAD_URI_STATIC)/{index-header,mirrors-status,index-trailer}.ihtml \
86          >| $(WWW_UPLOAD_URI)/mirrors-status.html
87
88 .PHONY: removedb removecache cachefiles updatedb upload-website clean distclean pics html mirmon
89