]> git.donarmstrong.com Git - neurodebian.git/blob - Makefile
ENH: mirmon and refresh (the one to be called hourly from cron) Makefile rules
[neurodebian.git] / Makefile
1 #WWW_UPLOAD_URI = neuro.debian.net:/home/www/neuro.debian.net/www
2 WWW_UPLOAD_URI = ../www
3 WWW_DIR = build/html/
4
5 # Lentghy one due to updatedb
6 all: updatedb upload-website mirmon
7 # Quick one -- just rebuilds html if new changes and adjusts the status of the mirrors
8 refresh: upload-website-stamp mirmon
9
10
11 pics:
12         $(MAKE) -C artwork
13
14
15 html: pics source
16         rsync -rvlhpt sphinx/ build/src
17         cd artwork;     cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
18         cp 3rd/jquery.livetwitter/jquery.livetwitter.min.js build/src/_static
19         cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
20         mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
21         cp -r build/src/lists $(WWW_DIR)/
22         cp -r sphinx/survey/2011/figures/* $(WWW_DIR)/_images/
23
24
25 clean:
26         -rm html-stamp source-stamp upload-website-stamp
27         $(MAKE) -C artwork clean
28
29
30 distclean: clean
31         -rm -rf build
32
33
34 source: source-stamp
35 source-stamp: build/db.db
36         PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
37                 --cfg neurodebian.cfg \
38                 --db build/db.db \
39                 --outdir build/src \
40                 --pkgaddenum pkgs \
41                 --extracts /home/www/neuro.debian.net/www/debian/extracts \
42                 commandisirrelevant
43         rm -f html-stamp
44         touch $@
45
46
47 removecache:
48         -rm -rf build/cache
49
50 removedb:
51         -rm -f build/db.db
52
53
54 updatedb: removedb removecache build/db.db
55
56
57 build/db.db:
58         mkdir -p build
59         PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
60                 --cfg neurodebian.cfg \
61                 --db build/db.db \
62                 updatedb
63         -rm -f source-stamp
64
65
66 upload-website: html
67         rsync -rvzlhp --delete \
68         --exclude=debian --exclude=debian-local --exclude=_files \
69         --chmod=Dg+s,g+rw $(WWW_DIR) $(WWW_UPLOAD_URI)
70         : # Touch stamp here so we get it updated on every upload
71         touch $@-stamp
72
73 # call upload iff .git/index was modified, i.e. new changes got pulled in
74 upload-website-stamp: .git/index
75         $(MAKE) upload-website
76
77 mirmon:
78         # update and generate mirrors report
79         [ -x /usr/bin/mirmon ] && mirmon -q -get update -c mirmon-neurodebian.conf
80
81 .PHONY: removedb removecache updatedb upload-website clean distclean pics html mirmon
82