]> git.proxmox.com Git - pve-docs.git/blame - Makefile
bump version to 4.4-3
[pve-docs.git] / Makefile
CommitLineData
bef0c1b4 1DGDIR=.
c38115e9 2ASCIIDOC_PVE=./asciidoc-pve
bef0c1b4 3
9015f48f
DM
4GEN_PACKAGE=pve-doc-generator
5DOC_PACKAGE=pve-docs
cfabc2e9 6MEDIAWIKI_PACKAGE=pve-docs-mediawiki
9344ee0d
DM
7
8# also update debian/changelog
97adfee4 9PKGREL=3
9344ee0d 10
b4f3c18a
DM
11GITVERSION:=$(shell cat .git/refs/heads/master)
12
0a3c58e0
TL
13ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
14
15GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
ceb4ea5b 16DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
cfabc2e9 17MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
9344ee0d 18
516d1f2f 19
63a01806
DM
20all: index.html
21
7515acaf
DM
22.PHONY: verify-images
23verify-images:
24 for i in ./images/screenshot/*.png; do ./png-verify.pl $$i; done
516d1f2f
DM
25
26ADOC_SOURCES_GUESS=$(filter-out %-synopsis.adoc %-opts.adoc %-table.adoc, $(wildcard *.adoc))
27.pve-doc-depends link-refs.json: ${ADOC_SOURCES_GUESS} scan-adoc-refs
e6fc3b0c
DM
28 ./scan-adoc-refs *.adoc --depends .pve-doc-depends.tmp > link-refs.json.tmp
29 @cmp --quiet .pve-doc-depends .pve-doc-depends.tmp || mv .pve-doc-depends.tmp .pve-doc-depends
30 @cmp --quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
63a01806 31
1ed794c8
DM
32pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in
33 cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp
34 mv $@.tmp $@
35
36include ./pve-doc-generator.mk
672abac1 37
9015f48f 38GEN_DEB_SOURCES= \
672abac1 39 pve-doc-generator.mk \
63a01806 40 ${MANUAL_SOURCES} \
54079101 41 pmxcfs.8-synopsis.adoc \
9344ee0d
DM
42 docinfo.xml
43
44GEN_SCRIPTS= \
8942fab2
DM
45 gen-ha-groups-opts.pl \
46 gen-ha-resources-opts.pl \
f6b81378
DM
47 gen-datacenter.cfg.5-opts.pl \
48 gen-pct.conf.5-opts.pl \
bac8c385 49 gen-pct-network-opts.pl \
fe154a4f 50 gen-pct-mountpoint-opts.pl \
9b4799ab 51 gen-qm.conf.5-opts.pl \
500f1e1f 52 gen-vzdump.conf.5-opts.pl \
9344ee0d
DM
53 gen-pve-firewall-cluster-opts.pl \
54 gen-pve-firewall-host-opts.pl \
55 gen-pve-firewall-macros-adoc.pl \
56 gen-pve-firewall-rules-opts.pl \
f6b81378 57 gen-pve-firewall-vm-opts.pl
9344ee0d 58
356064f4
DM
59API_VIEWER_SOURCES= \
60 api-viewer/index.html \
61 api-viewer/apidoc.js
62
aa99b349
DM
63asciidoc-pve: asciidoc-pve.in link-refs.json
64 cat asciidoc-pve.in link-refs.json >asciidoc-pve.tmp
835dd63b 65 sed -e s/@RELEASE@/${DOCRELEASE}/ -i asciidoc-pve.tmp
aa99b349
DM
66 chmod +x asciidoc-pve.tmp
67 mv asciidoc-pve.tmp asciidoc-pve
68
b489b02c
DM
69pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json
70 cat pve-docs-mediawiki-import.in link-refs.json > pve-docs-mediawiki-import.tmp
71 chmod +x pve-docs-mediawiki-import.tmp
72 mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import
73
f4defaeb
DM
74INDEX_INCLUDES= \
75 pve-admin-guide.pdf \
f4defaeb 76 pve-admin-guide.epub \
941ab9c7
DM
77 chapter-index-table.adoc \
78 man1-index-table.adoc \
79 man5-index-table.adoc \
80 man8-index-table.adoc \
63a01806 81 $(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
f4defaeb 82
ae0ad291 83ADOC_STDARG=-b $(shell pwd)/asciidoc/pve-html -f asciidoc/asciidoc-pve.conf -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
deb7f2ea 84
fc1090ef 85BROWSER?=xdg-open
df41beec 86
7b2c36ae 87
deb7f2ea
DM
88%-nwdiag.svg: %.nwdiag
89 nwdiag -T svg $*.nwdiag -o $@;
90
9d17dbac 91README.html: README.adoc
6b70c786 92 asciidoc -a toc ${ADOC_STDARG} -o $@ $<
9d17dbac 93
8ace7110
DM
94.PHONY: index
95index: index.html
3f559975
DM
96 $(BROWSER) index.html &
97
fd02ab90
DM
98chapter-index-table.adoc: asciidoc-pve
99 ./asciidoc-pve chapter-table >$@.tmp
941ab9c7
DM
100 mv $@.tmp $@
101
fd02ab90
DM
102man1-index-table.adoc: asciidoc-pve
103 ./asciidoc-pve man1page-table >$@.tmp
941ab9c7
DM
104 mv $@.tmp $@
105
fd02ab90
DM
106man5-index-table.adoc: asciidoc-pve
107 ./asciidoc-pve man5page-table >$@.tmp
941ab9c7
DM
108 mv $@.tmp $@
109
fd02ab90
DM
110man8-index-table.adoc: asciidoc-pve
111 ./asciidoc-pve man8page-table >$@.tmp
941ab9c7
DM
112 mv $@.tmp $@
113
114index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
c65b00e2 115 asciidoc ${ADOC_STDARG} -o $@ index.adoc
deb7f2ea 116
63a01806 117pve-admin-guide.html: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
ae0ad291 118 asciidoc -a pvelogo ${ADOC_STDARG} -o $@ pve-admin-guide.adoc
deb7f2ea 119
63a01806 120pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
59d89a51
DM
121 rm -rf pve-admin-guide.chunked
122 a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc
59d89a51 123
2522a624
DM
124PVE_DOCBOOK_CONF=-b $(shell pwd)/asciidoc/pve-docbook -f asciidoc/asciidoc-pve.conf
125
384871f2
DM
126pve-admin-guide-docinfo.xml: pve-admin-guide-docinfo.xml.in
127 sed -e 's/@RELEASE@/${DOCRELEASE}/' <$< >$@
128
63a01806 129pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide-docinfo.xml
34ef065a 130 inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg
333a2f49 131 inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg
bef0c1b4 132 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
2522a624 133 a2x -a docinfo -a docinfo1 -f pdf -L --asciidoc-opts="${PVE_DOCBOOK_CONF}" --dblatex-opts "-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty" pve-admin-guide.adoc
34ef065a 134 rm proxmox-logo.pdf proxmox-ci-header.pdf
deb7f2ea 135
63a01806 136pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
2522a624 137 a2x -f epub --asciidoc-opts="${PVE_DOCBOOK_CONF}" pve-admin-guide.adoc
9344ee0d 138
356064f4 139api-viewer/apidata.js: extractapi.pl
61568a65
DM
140 ./extractapi.pl >$@
141
356064f4
DM
142api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js
143 cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
61568a65 144
9344ee0d 145.PHONY: dinstall
cfabc2e9
DM
146dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
147 dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
9015f48f 148
9344ee0d 149.PHONY: deb
9015f48f 150deb:
cfabc2e9
DM
151 rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
152 make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
9015f48f 153
f250356f 154${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import asciidoc/mediawiki.conf verify-images
9015f48f
DM
155 rm -rf build
156 mkdir build
ceb4ea5b 157 rsync -a debian/ build/debian
b489b02c 158 cp pve-docs-mediawiki-import build/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import
ceb4ea5b
DM
159 echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
160 # install files for pve-doc-generator package
161 mkdir -p build/usr/share/${GEN_PACKAGE}
162 mkdir -p build/usr/share/doc/${GEN_PACKAGE}
bb3c27a7 163 mkdir -p build/usr/bin
ceb4ea5b
DM
164 install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
165 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
de7022fb 166 # install asciidoc-pve
bb3c27a7 167 install -m 0755 asciidoc-pve build/usr/bin/
de7022fb
DM
168 install -D -m 0644 asciidoc/mediawiki.conf build/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf
169 install -m 0644 asciidoc/asciidoc-pve.conf build/usr/share/${GEN_PACKAGE}/asciidoc/
ae0ad291 170 install -m 0644 asciidoc/pve-html.conf build/usr/share/${GEN_PACKAGE}/asciidoc/
ceb4ea5b 171 # install files for pvedocs package
9015f48f
DM
172 mkdir -p build/usr/share/${DOC_PACKAGE}
173 mkdir -p build/usr/share/doc/${DOC_PACKAGE}
ad2bfc41 174 install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE}
251666be 175 install -m 0644 ${WIKI_IMPORTS} build/usr/share/${DOC_PACKAGE}
8c8ae224
DM
176 # install screenshot images
177 mkdir -p build/usr/share/${DOC_PACKAGE}/images/screenshot
178 install -m 0644 images/screenshot/*.png build/usr/share/${DOC_PACKAGE}/images/screenshot
61568a65 179 # install api doc viewer
356064f4
DM
180 mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
181 install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
cfabc2e9 182 # build Debian packages
9344ee0d 183 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
9015f48f 184 lintian ${GEN_DEB}
ceb4ea5b 185 lintian ${DOC_DEB}
cfabc2e9 186 lintian ${MEDIAWIKI_DEB}
9344ee0d 187
89e93b38 188.PHONY: upload
cfabc2e9 189upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
d7b4925a 190 tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh repoman@repo.proxmox.com upload
deb7f2ea 191
56122987 192.PHONY: update
c016ebb7 193update: clean
5bf279bd 194 find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -exec rm -f \{\} \;
56122987 195 rm -f api-viewer/apidata.js
fe154a4f 196 rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc
c016ebb7 197 make all
deb7f2ea 198
bca311e4 199clean:
384871f2 200 rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build 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 .pve-doc-depends 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
de9cbbd6 201 find . -name '*~' -exec rm {} ';'