]>
Commit | Line | Data |
---|---|---|
bef0c1b4 | 1 | DGDIR=. |
c38115e9 | 2 | ASCIIDOC_PVE=./asciidoc-pve |
bef0c1b4 | 3 | |
9015f48f DM |
4 | GEN_PACKAGE=pve-doc-generator |
5 | DOC_PACKAGE=pve-docs | |
cfabc2e9 | 6 | MEDIAWIKI_PACKAGE=pve-docs-mediawiki |
9344ee0d DM |
7 | |
8 | # also update debian/changelog | |
4bd9bffc | 9 | PKGREL=9 |
9344ee0d | 10 | |
60955877 | 11 | GITVERSION:=$(shell git rev-parse HEAD) |
b4f3c18a | 12 | |
0a3c58e0 TL |
13 | ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) |
14 | ||
15 | GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb | |
ceb4ea5b | 16 | DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb |
cfabc2e9 | 17 | MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb |
9344ee0d | 18 | |
b965ad63 FG |
19 | export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) |
20 | SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}") | |
516d1f2f | 21 | |
63a01806 DM |
22 | all: index.html |
23 | ||
7515acaf DM |
24 | .PHONY: verify-images |
25 | verify-images: | |
26 | for i in ./images/screenshot/*.png; do ./png-verify.pl $$i; done | |
516d1f2f DM |
27 | |
28 | ADOC_SOURCES_GUESS=$(filter-out %-synopsis.adoc %-opts.adoc %-table.adoc, $(wildcard *.adoc)) | |
29 | .pve-doc-depends link-refs.json: ${ADOC_SOURCES_GUESS} scan-adoc-refs | |
e6fc3b0c DM |
30 | ./scan-adoc-refs *.adoc --depends .pve-doc-depends.tmp > link-refs.json.tmp |
31 | @cmp --quiet .pve-doc-depends .pve-doc-depends.tmp || mv .pve-doc-depends.tmp .pve-doc-depends | |
32 | @cmp --quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json | |
63a01806 | 33 | |
1ed794c8 DM |
34 | pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in |
35 | cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp | |
36 | mv $@.tmp $@ | |
37 | ||
fd880d44 | 38 | -include ./pve-doc-generator.mk |
672abac1 | 39 | |
9015f48f | 40 | GEN_DEB_SOURCES= \ |
672abac1 | 41 | pve-doc-generator.mk \ |
63a01806 | 42 | ${MANUAL_SOURCES} \ |
54079101 | 43 | pmxcfs.8-synopsis.adoc \ |
9344ee0d DM |
44 | docinfo.xml |
45 | ||
46 | GEN_SCRIPTS= \ | |
8942fab2 DM |
47 | gen-ha-groups-opts.pl \ |
48 | gen-ha-resources-opts.pl \ | |
f6b81378 DM |
49 | gen-datacenter.cfg.5-opts.pl \ |
50 | gen-pct.conf.5-opts.pl \ | |
bac8c385 | 51 | gen-pct-network-opts.pl \ |
fe154a4f | 52 | gen-pct-mountpoint-opts.pl \ |
9b4799ab | 53 | gen-qm.conf.5-opts.pl \ |
8eb81ff6 | 54 | gen-qm-cloud-init-opts.pl \ |
500f1e1f | 55 | gen-vzdump.conf.5-opts.pl \ |
9344ee0d DM |
56 | gen-pve-firewall-cluster-opts.pl \ |
57 | gen-pve-firewall-host-opts.pl \ | |
58 | gen-pve-firewall-macros-adoc.pl \ | |
59 | gen-pve-firewall-rules-opts.pl \ | |
441ae628 DM |
60 | gen-pve-firewall-vm-opts.pl \ |
61 | gen-output-format-opts.pl | |
9344ee0d | 62 | |
356064f4 DM |
63 | API_VIEWER_SOURCES= \ |
64 | api-viewer/index.html \ | |
65 | api-viewer/apidoc.js | |
66 | ||
aa99b349 DM |
67 | asciidoc-pve: asciidoc-pve.in link-refs.json |
68 | cat asciidoc-pve.in link-refs.json >asciidoc-pve.tmp | |
835dd63b | 69 | sed -e s/@RELEASE@/${DOCRELEASE}/ -i asciidoc-pve.tmp |
aa99b349 DM |
70 | chmod +x asciidoc-pve.tmp |
71 | mv asciidoc-pve.tmp asciidoc-pve | |
72 | ||
b489b02c DM |
73 | pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json |
74 | cat pve-docs-mediawiki-import.in link-refs.json > pve-docs-mediawiki-import.tmp | |
75 | chmod +x pve-docs-mediawiki-import.tmp | |
76 | mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import | |
77 | ||
f4defaeb DM |
78 | INDEX_INCLUDES= \ |
79 | pve-admin-guide.pdf \ | |
f4defaeb | 80 | pve-admin-guide.epub \ |
941ab9c7 DM |
81 | chapter-index-table.adoc \ |
82 | man1-index-table.adoc \ | |
83 | man5-index-table.adoc \ | |
84 | man8-index-table.adoc \ | |
63a01806 | 85 | $(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST}) |
f4defaeb | 86 | |
b965ad63 | 87 | ADOC_STDARG=-b $(shell pwd)/asciidoc/pve-html -f asciidoc/asciidoc-pve.conf -a icons -a data-uri -a "date=${SOURCE_DATE_HUMAN}" -a "revnumber=${DOCRELEASE}" -a footer-style=revdate |
deb7f2ea | 88 | |
fc1090ef | 89 | BROWSER?=xdg-open |
df41beec | 90 | |
9d17dbac | 91 | README.html: README.adoc |
6b70c786 | 92 | asciidoc -a toc ${ADOC_STDARG} -o $@ $< |
9d17dbac | 93 | |
8ace7110 DM |
94 | .PHONY: index |
95 | index: index.html | |
3f559975 DM |
96 | $(BROWSER) index.html & |
97 | ||
fd02ab90 DM |
98 | chapter-index-table.adoc: asciidoc-pve |
99 | ./asciidoc-pve chapter-table >$@.tmp | |
941ab9c7 DM |
100 | mv $@.tmp $@ |
101 | ||
fd02ab90 DM |
102 | man1-index-table.adoc: asciidoc-pve |
103 | ./asciidoc-pve man1page-table >$@.tmp | |
941ab9c7 DM |
104 | mv $@.tmp $@ |
105 | ||
fd02ab90 DM |
106 | man5-index-table.adoc: asciidoc-pve |
107 | ./asciidoc-pve man5page-table >$@.tmp | |
941ab9c7 DM |
108 | mv $@.tmp $@ |
109 | ||
fd02ab90 DM |
110 | man8-index-table.adoc: asciidoc-pve |
111 | ./asciidoc-pve man8page-table >$@.tmp | |
941ab9c7 DM |
112 | mv $@.tmp $@ |
113 | ||
114 | index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES} | |
c65b00e2 | 115 | asciidoc ${ADOC_STDARG} -o $@ index.adoc |
deb7f2ea | 116 | |
63a01806 | 117 | pve-admin-guide.html: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} |
ae0ad291 | 118 | asciidoc -a pvelogo ${ADOC_STDARG} -o $@ pve-admin-guide.adoc |
deb7f2ea | 119 | |
63a01806 | 120 | pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} |
959bc81c FG |
121 | rm -rf $@.tmp $@ |
122 | mkdir $@.tmp | |
123 | a2x -D $@.tmp -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc | |
124 | mv $@.tmp/$@ $@ | |
59d89a51 | 125 | |
2522a624 | 126 | PVE_DOCBOOK_CONF=-b $(shell pwd)/asciidoc/pve-docbook -f asciidoc/asciidoc-pve.conf |
789c5c57 | 127 | PVE_DBLATEX_OPTS='-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf' |
2522a624 | 128 | |
384871f2 DM |
129 | pve-admin-guide-docinfo.xml: pve-admin-guide-docinfo.xml.in |
130 | sed -e 's/@RELEASE@/${DOCRELEASE}/' <$< >$@ | |
131 | ||
63a01806 | 132 | pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide-docinfo.xml |
789c5c57 TL |
133 | rsvg-convert -f pdf -o proxmox-logo.pdf images/proxmox-logo.svg |
134 | rsvg-convert -f pdf -o proxmox-ci-header.pdf images/proxmox-ci-header.svg | |
bef0c1b4 | 135 | grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false); |
789c5c57 | 136 | a2x -a docinfo -a docinfo1 -f pdf -L --asciidoc-opts="${PVE_DOCBOOK_CONF}" --dblatex-opts ${PVE_DBLATEX_OPTS} pve-admin-guide.adoc |
34ef065a | 137 | rm proxmox-logo.pdf proxmox-ci-header.pdf |
deb7f2ea | 138 | |
63a01806 | 139 | pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} |
959bc81c FG |
140 | rm -rf $@.tmp $@ |
141 | mkdir $@.tmp | |
142 | a2x -D $@.tmp -f epub --asciidoc-opts="${PVE_DOCBOOK_CONF}" pve-admin-guide.adoc | |
143 | mv $@.tmp/$@ $@ | |
9344ee0d | 144 | |
356064f4 | 145 | api-viewer/apidata.js: extractapi.pl |
61568a65 DM |
146 | ./extractapi.pl >$@ |
147 | ||
356064f4 DM |
148 | api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js |
149 | cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@ | |
61568a65 | 150 | |
9344ee0d | 151 | .PHONY: dinstall |
cfabc2e9 DM |
152 | dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} |
153 | dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | |
9015f48f | 154 | |
9344ee0d | 155 | .PHONY: deb |
fa764571 FG |
156 | deb: $(DOC_DEB) |
157 | $(MEDIAWIKI_DEB) $(GEN_DEB): $(DOC_DEB) | |
158 | $(DOC_DEB): | |
c8bdafbd | 159 | rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} |
fa764571 FG |
160 | rm -rf build |
161 | rsync -a * build/ | |
162 | echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE | |
163 | cd build; dpkg-buildpackage -b -us -uc | |
164 | lintian $(DOC_DEB) $(GEN_DEB) $(MEDIAWIKI_DEB) | |
f0d25f0d | 165 | |
c8bdafbd WB |
166 | .PHONY: clean-build |
167 | clean-build: | |
9015f48f | 168 | rm -rf build |
c8bdafbd | 169 | |
fa764571 FG |
170 | .PHONY: install |
171 | install: gen-install doc-install mediawiki-install | |
172 | ||
173 | .PHONY: gen-install | |
174 | gen-install: $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf | |
175 | install -dm755 $(DESTDIR)/usr/share/$(GEN_PACKAGE) | |
176 | install -dm755 $(DESTDIR)/usr/share/doc/$(GEN_PACKAGE) | |
177 | install -dm755 $(DESTDIR)/usr/bin | |
c8bdafbd | 178 | # install files |
fa764571 FG |
179 | install -m 0644 ${GEN_DEB_SOURCES} $(DESTDIR)/usr/share/${GEN_PACKAGE} |
180 | install -m 0755 ${GEN_SCRIPTS} $(DESTDIR)/usr/share/${GEN_PACKAGE} | |
de7022fb | 181 | # install asciidoc-pve |
fa764571 FG |
182 | install -m 0755 asciidoc-pve $(DESTDIR)/usr/bin/ |
183 | install -D -m 0644 asciidoc/mediawiki.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf | |
184 | install -m 0644 asciidoc/asciidoc-pve.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/ | |
185 | install -m 0644 asciidoc/pve-html.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/ | |
186 | ||
187 | .PHONY: doc-install | |
188 | doc-install: index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images | |
189 | install -dm755 $(DESTDIR)/usr/share/$(DOC_PACKAGE) | |
190 | install -dm755 $(DESTDIR)/usr/share/doc/$(DOC_PACKAGE) | |
ceb4ea5b | 191 | # install files for pvedocs package |
fa764571 FG |
192 | install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE} |
193 | install -dm755 $(DESTDIR)/usr/share/doc/${DOC_PACKAGE} | |
194 | install -m 0644 index.html ${INDEX_INCLUDES} $(DESTDIR)/usr/share/${DOC_PACKAGE} | |
195 | install -m 0644 ${WIKI_IMPORTS} $(DESTDIR)/usr/share/${DOC_PACKAGE} | |
50f88938 | 196 | # install images |
fa764571 | 197 | make -C images install |
8c8ae224 | 198 | # install screenshot images |
fa764571 FG |
199 | install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot |
200 | install -m 0644 images/screenshot/*.png $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot | |
61568a65 | 201 | # install api doc viewer |
fa764571 FG |
202 | install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer |
203 | install -m 0644 ${API_VIEWER_SOURCES} $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer | |
204 | ||
205 | .PHONY: mediawiki-install | |
206 | mediawiki-install: pve-docs-mediawiki-import | |
207 | install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE) | |
208 | install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE) | |
209 | install -dm755 $(DESTDIR)/usr/bin | |
210 | install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE) | |
211 | install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE) | |
212 | install -m 0755 pve-docs-mediawiki-import $(DESTDIR)/usr/bin/ | |
9344ee0d | 213 | |
89e93b38 | 214 | .PHONY: upload |
cfabc2e9 | 215 | upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} |
821cf643 | 216 | tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch |
deb7f2ea | 217 | |
56122987 | 218 | .PHONY: update |
0fa28023 DM |
219 | update: |
220 | make clean clean-static | |
221 | make update-static | |
5cb4ef63 TL |
222 | make all |
223 | ||
224 | .PHONY: update-static | |
0fa28023 DM |
225 | update-static: |
226 | make clean-static | |
227 | make $(filter %-synopsis.adoc %-opts.adoc, ${PVE_ADMIN_GUIDE_ADOCDEPENDS}) pve-firewall-macros.adoc api-viewer/apidata.js | |
5cb4ef63 TL |
228 | |
229 | .PHONY: clean-static | |
230 | clean-static: | |
5bf279bd | 231 | find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -exec rm -f \{\} \; |
56122987 | 232 | rm -f api-viewer/apidata.js |
fe154a4f | 233 | rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc |
deb7f2ea | 234 | |
5cb4ef63 | 235 | clean: |
f00afaef WB |
236 | rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 |
237 | rm -f *.deb *.changes *.buildinfo | |
5cb4ef63 TL |
238 | rm -f api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import |
239 | rm -rf .pve-doc-depends | |
f00afaef | 240 | rm -f pve-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pve-admin-guide-docinfo.xml |
c8bdafbd | 241 | rm -rf build-* |