]> git.donarmstrong.com Git - neurodebian.git/blob - Makefile
Merge branch 'master' of git.debian.org:/git/pkg-exppsy/neurodebian
[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         cp neurodebian.cfg build/src/_static
22         cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
23         mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
24         cp -r build/src/lists $(WWW_DIR)/
25         cp -r sphinx/survey/2011/figures/* $(WWW_DIR)/_images/
26         @echo "I: extracting header/trailer to be reused in non-sphinx pages"
27         sed -ne '1,/<!-- HEADNOTES -->/p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-header.ihtml
28         sed -ne '/<h2>Comments<\/h2>/,$$p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-trailer.ihtml
29
30 clean:
31         -rm html-stamp source-stamp upload-website-stamp
32         $(MAKE) -C artwork clean
33
34
35 distclean: clean
36         -rm -rf build
37
38
39 source: source-stamp
40 source-stamp:
41         PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
42                 --cfg neurodebian.cfg \
43                 --db build/db.db \
44                 --outdir build/src \
45                 --pkgaddenum pkgs \
46                 --extracts /home/www/neuro.debian.net/www/debian/extracts \
47                 commandisirrelevant
48         rm -f html-stamp
49         touch $@
50
51
52 removecache:
53         -rm -rf build/cache
54
55 removedb:
56         -rm -f build/db.db
57
58
59 updatedb: removedb removecache build/db.db
60
61
62 build/db.db:
63         mkdir -p build
64         PYTHONPATH=.:$(PYTHONPATH) python neurodebian/dde.py \
65                 --cfg neurodebian.cfg \
66                 --db build/db.db \
67                 updatedb
68         -rm -f source-stamp
69
70
71 upload-website: html
72         rsync -rvzlhp --delete \
73         --exclude=debian --exclude=debian-local --exclude=debian-devel --exclude=_files \
74         --chmod=Dg+s,g+rw $(WWW_DIR) $(WWW_UPLOAD_URI)
75         : # Touch stamp here so we get it updated on every upload
76         touch $@-stamp
77
78 # call upload iff .git/index was modified, i.e. new changes got pulled in
79 upload-website-stamp: .git/index
80         $(MAKE) upload-website
81
82 mirmon:
83         # update and generate mirrors report
84         [ -x /usr/bin/mirmon ] && mirmon -q -get update -c mirmon-neurodebian.conf 2>&1 \
85         | grep -v 'date: invalid date.*DOCTYPE' || :
86         # [ -x $(WWW_UPLOAD_URI_STATIC)/mirrors-check.ihtml ] &&
87         # everything must be in place!
88         cat $(WWW_UPLOAD_URI_STATIC)/{index-header,mirrors-status,index-trailer}.ihtml \
89          >| $(WWW_UPLOAD_URI)/mirrors-status.html
90
91 .PHONY: removedb removecache updatedb upload-website clean distclean pics html mirmon
92