]> git.donarmstrong.com Git - neurodebian.git/blob - Makefile
Final upload URL and wording fix.
[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_repo.cfg
8 BIGMESS_CMD = PYTHONPATH=.:../bigmess:$(PYTHONPATH) ../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
17 pics:
18         $(MAKE) -C artwork
19
20
21 html: pics source
22         rsync -rvlhpt sphinx/ build/src
23         cd artwork;     cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
24         cp 3rd/jquery.livetwitter/jquery.livetwitter.min.js build/src/_static
25         cp neurodebian.cfg build/src/_static
26         cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
27         ln -fs /usr/share/javascript build/html/
28         mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
29         cp -r build/src/lists $(WWW_DIR)/
30         cp -r sphinx/survey/2011/figures/* $(WWW_DIR)/_images/
31         @echo "I: extracting header/trailer to be reused in non-sphinx pages"
32         sed -ne '1,/<!-- HEADNOTES -->/p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-header.ihtml
33         sed -ne '/<h2>Comments<\/h2>/,$$p' $(WWW_DIR)/index.html >| $(WWW_DIR)/_static/index-trailer.ihtml
34
35 clean:
36         -rm html-stamp source-stamp upload-website-stamp
37         $(MAKE) -C artwork clean
38
39
40 distclean: clean
41         -rm -rf build
42
43
44 source: source-stamp
45 source-stamp: 
46         mkdir -p build/src/pkgs/
47         mkdir -p build/src/lists/
48         mkdir -p build/src/pkglists/
49         $(BIGMESS) mkpkgs  -d build/src/pkgs/
50         $(BIGMESS) mkaptcfgs -d build/src/lists/
51         $(BIGMESS) mkrepocfg > build/src/sources_lists
52         $(BIGMESS) mkpkgtocs -d build/src/pkglists > build/src/pkgs.rst
53         touch $@
54
55
56 updatedb:
57         $(BIGMESS) cachefiles
58         $(BIGMESS) updatedb
59
60 upload-website: html
61         rsync -rvzlhp --delete \
62         --exclude=debian --exclude=debian-local --exclude=debian-devel --exclude=_files \
63         --chmod=Dg+s,g+rw $(WWW_DIR) $(WWW_UPLOAD_URI)
64         : # Touch stamp here so we get it updated on every upload
65         touch $@-stamp
66
67 # call upload iff .git/index was modified, i.e. new changes got pulled in
68 upload-website-stamp: .git/index
69         $(MAKE) upload-website
70
71 mirmon:
72         # update and generate mirrors report
73         [ -x /usr/bin/mirmon ] && mirmon -q -get update -c mirmon-neurodebian.conf 2>&1 \
74         | grep -v 'date: invalid date.*DOCTYPE' || :
75         # [ -x $(WWW_UPLOAD_URI_STATIC)/mirrors-check.ihtml ] &&
76         # everything must be in place!
77         cat $(WWW_UPLOAD_URI_STATIC)/{index-header,mirrors-status,index-trailer}.ihtml \
78          >| $(WWW_UPLOAD_URI)/mirrors-status.html
79
80 .PHONY: removedb removecache updatedb upload-website clean distclean pics html mirmon
81