forked from beaker-project/beaker-project.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
130 lines (108 loc) · 4.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
SHELL = /bin/bash
MAJOR_VERSION = 0
BEAKER ?= ../beaker
SPHINXBUILD = $(shell command -v sphinx-1.0-build sphinx-build)
SPHINXBUILDOPTS = -W
ARTICLES = COPYING.html dev-guide.html cobbler-migration.html
include releases.mk
OLD_TARBALLS = \
releases/beaker-0.6.16.tar.bz2 \
releases/beaker-0.6.1.tar.gz \
releases/beaker-0.6.1.tar.bz2 \
releases/beaker-0.5.7.tar.bz2 \
releases/beaker-0.4.75.tar.bz2 \
releases/beaker-0.4.3.tar.bz2 \
releases/beaker-0.4.tar.bz2
.PHONY: all
all: guide server-api man yum \
schema/beaker-job.rng \
releases/SHA1SUM \
releases/index.html \
releases/index.atom \
$(DOWNLOADS) \
in-a-box/beaker.ks.html \
in-a-box/beaker-setup.html \
in-a-box/beaker-distros.html \
in-a-box/beaker-virt.html \
$(ARTICLES)
guide::
# publican doesn't let us specify source or dest dirs, grumble
( cd $(BEAKER)/pub_doc/Beaker_Guide && \
publican clean --common_content=../publican-brand && \
publican build --publish --common_content=../publican-brand --formats=html --langs=en-US ) && \
rm -rf $@ && \
cp -r $(BEAKER)/pub_doc/Beaker_Guide/publish/en-US/Beaker/$(MAJOR_VERSION)/html/Beaker_Guide $@
# This __requires__ insanity is needed in Fedora if multiple versions of CherryPy are installed.
server-api::
env BEAKER=$(abspath $(BEAKER)) PYTHONPATH=$(BEAKER)/Common:$(BEAKER)/Server \
python -c '__requires__ = ["TurboGears"]; import pkg_resources; execfile("$(SPHINXBUILD)")' \
$(SPHINXBUILDOPTS) -c $@ -b html $(BEAKER)/Server/apidoc/ $@/
man::
env BEAKER=$(abspath $(BEAKER)) PYTHONPATH=$(BEAKER)/Common:$(BEAKER)/Client/src \
$(SPHINXBUILD) $(SPHINXBUILDOPTS) -c $@ -b html $(BEAKER)/Client/doc/ $@/
schema/beaker-job.rng: $(BEAKER)/Common/bkr/common/schema/beaker-job.rng
mkdir -p $(dir $@)
cp -p $< $@
releases.mk: $(BEAKER)/beaker.spec generate-releases-mk.py changelog.py
./generate-releases-mk.py <$< >$@
releases/index.html: $(BEAKER)/beaker.spec releases/SHA1SUM generate-releases-index.py changelog.py
mkdir -p $(dir $@)
./generate-releases-index.py --format=html $< >$@
releases/index.atom: $(BEAKER)/beaker.spec releases/SHA1SUM generate-releases-index.py changelog.py
mkdir -p $(dir $@)
./generate-releases-index.py --format=atom $< >$@
$(OLD_TARBALLS):
mkdir -p $(dir $@)
cd $(dir $@) && curl -# -R -f -O http://beaker-project.org/$@
# Release artefacts (tarballs and patches) must never change once they have
# been published. So when "building" one, we always first try to grab it from
# the public web site in case it has already been published. Only if it doesn't
# exist should we *actually* build it from scratch here.
releases/%.tar.gz:
mkdir -p $(dir $@)
@echo "Trying to fetch release artefact $@" ; \
curl -# -R -f -o$@ http://beaker-project.org/$@ ; result=$$? ; \
if [ $$result -ne 22 ] ; then exit $$result ; fi ; \
echo "Release artefact $@ not published, building it" ; \
( cd $(BEAKER) && flock /tmp/tito tito build --tgz --tag=$*-1 ) && cp /tmp/tito/$*.tar.gz $@
releases/%.tar.xz: releases/%.tar.gz
mkdir -p $(dir $@)
@echo "Trying to fetch release artefact $@" ; \
curl -# -R -f -o$@ http://beaker-project.org/$@ ; result=$$? ; \
if [ $$result -ne 22 ] ; then exit $$result ; fi ; \
echo "Release artefact $@ not published, building it" ; \
gunzip -c $< | xz >$@
releases/%.patch:
mkdir -p $(dir $@)
@echo "Trying to fetch release artefact $@" ; \
curl -# -R -f -o$@ http://beaker-project.org/$@ ; result=$$? ; \
if [ $$result -ne 22 ] ; then exit $$result ; fi ; \
echo "Release artefact $@ not published, building it" ; \
( cd $(BEAKER) && flock /tmp/tito tito build --tgz --tag=$* ) && cp /tmp/tito/$*.patch $@
releases/SHA1SUM: $(DOWNLOADS) releases.mk
mkdir -p $(dir $@)
( cd $(dir $@) && ls -rv $(notdir $(DOWNLOADS)) $(notdir $(OLD_TARBALLS)) | xargs sha1sum ) >$@
yum::
./build-yum-repos.py --config yum-repos.conf --dest $@
in-a-box/%.html: in-a-box/%
./shocco.sh $< >$@
# This is annoying... at some point pandoc started ignoring the -5 option,
# instead you have to specify -t html5 to select HTML5 output.
PANDOC_OUTPUT_OPTS=$(if $(shell pandoc --help | grep 'Output formats:.*html5'),-t html5,-t html -5)
%.html: %.txt pandoc-before-body.html pandoc-after-body.html
pandoc -f markdown $(PANDOC_OUTPUT_OPTS) --standalone --section-divs \
--smart --variable=lang=en --css=style.css \
--include-in-header=pandoc-header.html \
--toc \
--include-before-body=pandoc-before-body.html \
--include-after-body=pandoc-after-body.html \
<$< | ./pandoc-fixes.py >$@
.PHONY: check
check:
# ideas: spell check everything, validate HTML, check for broken links
./check-yum-repos.py
.PHONY: publish
publish:
git fetch beaker-project.org:/srv/www/beaker-project.org/git master:published
git fetch beaker-project.org:/srv/www/stage.beaker-project.org/git master:published
env BEAKER="$(abspath $(BEAKER))" ./publish.sh published