]> git.donarmstrong.com Git - neurodebian.git/blob - Makefile
Replace a good chunk of code with the new bigmess
[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 WWW_UPLOAD_URI_STATIC=$(WWW_UPLOAD_URI)/_static
6
7 # Lentghy one due to updatedb
8 all: updatedb upload-website mirmon
9 # Quick one -- just rebuilds html if new changes and adjusts the status of the mirrors
10 refresh: upload-website-stamp mirmon
11
12
13 pics:
14         $(MAKE) -C artwork
15
16
17 html: pics source
18         rsync -rvlhpt sphinx/ build/src
19         cd artwork;     cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
20         cp 3rd/jquery.livetwitter/jquery.livetwitter.min.js build/src/_static
21         cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
22         mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
23         cp -r build/src/lists $(WWW_DIR)/
24         cp -r sphinx/survey/2011/figures/* $(WWW_DIR)/_images/
25         @echo "I: extracting header/trailer to be reused in non-sphinx pages"
26         sed -ne '1,/<!-- HEADNOTES -->/p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-header.ihtml
27         sed -ne '/<h2>Comments<\/h2>/,$$p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-trailer.ihtml
28
29 clean:
30         -rm html-stamp source-stamp upload-website-stamp
31         $(MAKE) -C artwork clean
32
33
34 distclean: clean
35         -rm -rf build
36
37
38 source: source-stamp
39 source-stamp: 
40         mkdir -p build/src/pkgs/
41         mkdir -p build/src/lists/
42         PYTHONPATH=.:../bigmess:$(PYTHONPATH) ../bigmess/bin/bigmess genpkgs -d build/src/pkgs/
43         PYTHONPATH=.:../bigmess:$(PYTHONPATH) ../bigmess/bin/bigmess genaptlists -d build/src/lists/
44         PYTHONPATH=.:../bigmess:$(PYTHONPATH) ../bigmess/bin/bigmess genmirrorselect > build/src/sources_lists
45 #       PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
46 #               --cfg neurodebian.cfg \
47 #               --db build/db.db \
48 #               --outdir build/src \
49 #               --pkgaddenum pkgs \
50 #               --extracts /home/www/neuro.debian.net/www/debian/extracts \
51 #               commandisirrelevant
52 #       rm -f html-stamp
53         touch $@
54
55
56 removecache:
57         -rm -rf build/cache
58
59 removedb:
60         -rm -f build/db.db
61
62
63 updatedb: removedb removecache build/db.db
64
65
66 build/db.db:
67         mkdir -p build
68         PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
69                 --cfg neurodebian.cfg \
70                 --db build/db.db \
71                 updatedb
72         -rm -f source-stamp
73
74
75 upload-website: html
76         rsync -rvzlhp --delete \
77         --exclude=debian --exclude=debian-local --exclude=_files \
78         --chmod=Dg+s,g+rw $(WWW_DIR) $(WWW_UPLOAD_URI)
79         : # Touch stamp here so we get it updated on every upload
80         touch $@-stamp
81
82 # call upload iff .git/index was modified, i.e. new changes got pulled in
83 upload-website-stamp: .git/index
84         $(MAKE) upload-website
85
86 mirmon:
87         # update and generate mirrors report
88         [ -x /usr/bin/mirmon ] && mirmon -q -get update -c mirmon-neurodebian.conf 2>&1 \
89         | grep -v 'date: invalid date.*DOCTYPE' || :
90         # [ -x $(WWW_UPLOAD_URI_STATIC)/mirrors-check.ihtml ] &&
91         # everything must be in place!
92         cat $(WWW_UPLOAD_URI_STATIC)/{index-header,mirrors-status,index-trailer}.ihtml \
93          >| $(WWW_UPLOAD_URI)/mirrors-status.html
94
95 .PHONY: removedb removecache updatedb upload-website clean distclean pics html mirmon
96