bump version to 4.3-4
[pve-docs.git] / Makefile
CommitLineData
bef0c1b4
DM
1DGDIR=.
2
3include ./pve-doc-generator.mk
deb7f2ea 4
9015f48f
DM
5GEN_PACKAGE=pve-doc-generator
6DOC_PACKAGE=pve-docs
cfabc2e9 7MEDIAWIKI_PACKAGE=pve-docs-mediawiki
9344ee0d
DM
8
9# also update debian/changelog
44a1fe38 10PKGREL=4
9344ee0d 11
b4f3c18a
DM
12GITVERSION:=$(shell cat .git/refs/heads/master)
13
0a3c58e0
TL
14ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
15
16GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
ceb4ea5b 17DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
cfabc2e9 18MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
9344ee0d 19
f96bdfd8 20CHAPTER_LIST= \
6b5fc47b 21 pve-installation \
f96bdfd8
DM
22 sysadmin \
23 pvecm \
24 pmxcfs \
25 pvesm \
26 qm \
27 pve-firewall \
28 pveum \
29 pct \
30 ha-manager \
31 vzdump \
32 pve-faq \
33 pve-bibliography
34
251666be
DM
35STORAGE_TYPES= \
36 dir \
37 glusterfs \
38 iscsi \
39 iscsidirect \
40 lvm \
41 lvmthin \
42 nfs \
43 rbd \
44 zfspool
f96bdfd8 45
ebd2a7fb
DM
46COMMAND_LIST= \
47 pvesubscription \
48 pvecm \
49 qm \
50 qmrestore \
0840a663 51 pveceph \
ebd2a7fb
DM
52 pct \
53 pveam \
54 pvesm \
55 pveum \
56 vzdump \
fcace69a
FG
57 ha-manager \
58 pveperf
672abac1 59
96f2beeb
DM
60SERVICE_LIST= \
61 pve-firewall \
62 pve-ha-crm \
63 pve-ha-lrm \
64 pvestatd \
65 pmxcfs \
66 pveproxy \
2d8f1c92 67 spiceproxy \
96f2beeb 68 pvedaemon
672abac1
DM
69
70CONFIG_LIST=datacenter.cfg qm.conf pct.conf
71
9015f48f 72GEN_DEB_SOURCES= \
672abac1
DM
73 pve-doc-generator.mk \
74 attributes.txt \
75 $(addsuffix .adoc, ${COMMAND_LIST}) \
76 $(addsuffix .adoc, ${SERVICE_LIST}) \
77 $(addsuffix .adoc, ${CONFIG_LIST}) \
78 pve-storage-dir.adoc \
79 pve-storage-glusterfs.adoc \
80 pve-storage-iscsi.adoc \
81 pve-storage-iscsidirect.adoc \
82 pve-storage-lvm.adoc \
82141a78 83 pve-storage-lvmthin.adoc \
672abac1
DM
84 pve-storage-nfs.adoc \
85 pve-storage-rbd.adoc \
86 pve-storage-zfspool.adoc \
bd88f9d9 87 pmxcfs.8-cli.adoc \
672abac1 88 pve-copyright.adoc \
9344ee0d
DM
89 docinfo.xml
90
91GEN_SCRIPTS= \
f6b81378
DM
92 gen-datacenter.cfg.5-opts.pl \
93 gen-pct.conf.5-opts.pl \
bac8c385 94 gen-pct-network-opts.pl \
fe154a4f 95 gen-pct-mountpoint-opts.pl \
9b4799ab 96 gen-qm.conf.5-opts.pl \
500f1e1f 97 gen-vzdump.conf.5-opts.pl \
9344ee0d
DM
98 gen-pve-firewall-cluster-opts.pl \
99 gen-pve-firewall-host-opts.pl \
100 gen-pve-firewall-macros-adoc.pl \
101 gen-pve-firewall-rules-opts.pl \
f6b81378 102 gen-pve-firewall-vm-opts.pl
9344ee0d 103
6b5fc47b 104INSTALLATION_SOURCES= \
5c6cf7ac 105 pve-usbstick.adoc \
bc1c71d4 106 pve-system-requirements.adoc \
6b5fc47b
DM
107 pve-installation.adoc
108
8c80c3fc 109SYSADMIN_PARTS= \
8c80c3fc
DM
110 pve-network \
111 pve-package-repos \
8c80c3fc 112 system-software-updates \
897abbde 113 pve-disk-health-monitoring \
8b849dc3 114 local-lvm \
8c80c3fc
DM
115 local-zfs
116
672abac1 117SYSADMIN_SOURCES= \
8c80c3fc 118 $(addsuffix .adoc, ${SYSADMIN_PARTS}) \
d91f8c1e
DM
119 sysadmin.adoc
120
356064f4
DM
121API_VIEWER_SOURCES= \
122 api-viewer/index.html \
123 api-viewer/apidoc.js
124
672abac1
DM
125PVE_ADMIN_GUIDE_SOURCES= \
126 ${DATACENTER_CONF_MAN5_SOURCES} \
127 ${QM_CONF_MAN5_SOURCES} \
128 ${PCT_CONF_MAN5_SOURCES} \
129 ${SYSADMIN_SOURCES} \
130 pve-admin-guide.adoc \
131 pve-intro.adoc \
86f58817 132 getting-help.adoc \
6b5fc47b 133 ${INSTALLATION_SOURCES} \
672abac1 134 pmxcfs.adoc \
bd88f9d9 135 pmxcfs.8-cli.adoc \
672abac1
DM
136 pve-faq.adoc \
137 ${PVE_FIREWALL_MAN8_SOURCES} \
138 ${PVESM_MAN1_SOURCES} \
139 ${PCT_MAN1_SOURCES} \
140 ${PVECM_MAN1_SOURCES} \
141 ${PVEUM_MAN1_SOURCES} \
142 ${QM_MAN1_SOURCES} \
143 ${QMRESTORE_MAN1_SOURCES} \
144 ${HA_MANAGER_MAN1_SOURCES} \
2d8f1c92
DM
145 ${PVESTATD_MAN8_SOURCES} \
146 ${PVEDAEMON_MAN8_SOURCES} \
147 ${PVEPROXY_MAN8_SOURCES} \
148 ${SPICEPROXY_MAN8_SOURCES} \
672abac1
DM
149 ${PVE_HA_CRM_MAN8_SOURCES} \
150 ${PVE_HA_LRM_MAN8_SOURCES} \
6198e7c5
DM
151 ${VZDUMP_MAN1_SOURCES} \
152 ${PVEAM_MAN1_SOURCES} \
ebd2a7fb 153 ${PVESUBSCRIPTION_MAN1_SOURCES} \
0840a663 154 ${PVECEPH_MAN1_SOURCES} \
fcace69a 155 ${PVEPERF_MAN1_SOURCES} \
672abac1
DM
156 pve-bibliography.adoc \
157 $(addsuffix .adoc, ${COMMAND_LIST}) \
158 $(addsuffix .adoc, ${SERVICE_LIST}) \
159 $(addsuffix .adoc, ${CONFIG_LIST}) \
160 GFDL.adoc \
deb7f2ea
DM
161 attributes.txt
162
aa99b349
DM
163link-refs.json: scan-adoc-refs ${PVE_ADMIN_GUIDE_SOURCES}
164 ./scan-adoc-refs ${PVE_ADMIN_GUIDE_SOURCES} >link-refs.json
165
166asciidoc-pve: asciidoc-pve.in link-refs.json
167 cat asciidoc-pve.in link-refs.json >asciidoc-pve.tmp
168 chmod +x asciidoc-pve.tmp
169 mv asciidoc-pve.tmp asciidoc-pve
170
8c80c3fc 171WIKI_IMPORTS= \
5c6cf7ac 172 section-pve-usbstick-plain.html \
86f58817 173 section-getting-help-plain.html \
bc1c71d4 174 section-pve-system-requirements-plain.html \
8c80c3fc
DM
175 $(addsuffix -plain.html, $(addprefix sysadmin-, ${SYSADMIN_PARTS})) \
176 $(addsuffix -plain.html, $(addprefix chapter-, ${CHAPTER_LIST})) \
177 $(addsuffix .5-plain.html, ${CONFIG_LIST}) \
251666be
DM
178 $(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES}))
179
f4defaeb
DM
180INDEX_INCLUDES= \
181 pve-admin-guide.pdf \
182 pve-admin-guide.html \
183 pve-admin-guide.epub \
184 $(addsuffix .1.html, ${COMMAND_LIST}) \
185 $(addsuffix .8.html, ${SERVICE_LIST}) \
186 $(addsuffix .5.html, ${CONFIG_LIST}) \
251666be 187 $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST}))
f4defaeb 188
0e25828e
DM
189ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
190ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG}
191ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG}
192ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG}
deb7f2ea 193
fc1090ef 194BROWSER?=xdg-open
df41beec 195
56122987 196all: index.html
7b2c36ae 197
deb7f2ea
DM
198%-nwdiag.svg: %.nwdiag
199 nwdiag -T svg $*.nwdiag -o $@;
200
8c80c3fc 201sysadmin-%-plain.html: %.adoc
52bc5baa 202 asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ $*.adoc
8c80c3fc 203
5c6cf7ac
DM
204section-%-plain.html: %.adoc
205 asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ $*.adoc
206
9ee94323
DM
207chapter-sysadmin.html chapter-sysadmin-plain.html: ${SYSADMIN_SOURCES}
208
f96bdfd8 209chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
d01fa25d 210 asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc
f96bdfd8 211
0e25828e 212chapter-%-plain.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
251666be
DM
213 asciidoc -s -a wiki ${ADOC_STDARG} -o $@ $*.adoc
214
215pve-storage-%-plain.html: pve-storage-%.adoc ${PVE_COMMON_DOC_SOURCES}
216 asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ pve-storage-$*.adoc
0e25828e 217
bd88f9d9 218%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 219 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
deb7f2ea 220
7c40c631
DM
221pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES}
222 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc
deb7f2ea 223
7c40c631 224%.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 225 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
71e16346 226
7c40c631 227%.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
c016ebb7 228 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
c016ebb7 229
1496dbe5
DM
230%.5-plain.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
231 asciidoc -s ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
1496dbe5 232
9d17dbac
DM
233README.html: README.adoc
234 asciidoc ${ADOC_STDARG} -o $@ $<
235
8ace7110
DM
236.PHONY: index
237index: index.html
3f559975
DM
238 $(BROWSER) index.html &
239
f4defaeb 240index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
bef0c1b4 241 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
deb7f2ea
DM
242
243pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
683e3b93 244 asciidoc -a pvelogo -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
deb7f2ea 245
59d89a51
DM
246pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_SOURCES}
247 rm -rf pve-admin-guide.chunked
248 a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc
59d89a51 249
66f81679 250pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
34ef065a 251 inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg
333a2f49 252 inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg
bef0c1b4 253 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
72470ed6 254 a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc-dblatex-custom.sty" pve-admin-guide.adoc
34ef065a 255 rm proxmox-logo.pdf proxmox-ci-header.pdf
deb7f2ea
DM
256
257pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
258 a2x -f epub pve-admin-guide.adoc
9344ee0d 259
356064f4 260api-viewer/apidata.js: extractapi.pl
61568a65
DM
261 ./extractapi.pl >$@
262
356064f4
DM
263api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js
264 cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
61568a65 265
9344ee0d 266.PHONY: dinstall
cfabc2e9
DM
267dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
268 dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
9015f48f 269
9344ee0d 270.PHONY: deb
9015f48f 271deb:
cfabc2e9
DM
272 rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
273 make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
9015f48f 274
cfabc2e9 275${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES}
9015f48f
DM
276 rm -rf build
277 mkdir build
ceb4ea5b
DM
278 rsync -a debian/ build/debian
279 echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
280 # install files for pve-doc-generator package
281 mkdir -p build/usr/share/${GEN_PACKAGE}
282 mkdir -p build/usr/share/doc/${GEN_PACKAGE}
283 install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
284 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
285 # install files for pvedocs package
9015f48f
DM
286 mkdir -p build/usr/share/${DOC_PACKAGE}
287 mkdir -p build/usr/share/doc/${DOC_PACKAGE}
ad2bfc41 288 install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE}
251666be 289 install -m 0644 ${WIKI_IMPORTS} build/usr/share/${DOC_PACKAGE}
61568a65 290 # install api doc viewer
356064f4
DM
291 mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
292 install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
cfabc2e9 293 # build Debian packages
9344ee0d 294 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
9015f48f 295 lintian ${GEN_DEB}
ceb4ea5b 296 lintian ${DOC_DEB}
cfabc2e9 297 lintian ${MEDIAWIKI_DEB}
9344ee0d 298
89e93b38 299.PHONY: upload
cfabc2e9 300upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
d7b4925a 301 tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh repoman@repo.proxmox.com upload
deb7f2ea 302
56122987 303.PHONY: update
c016ebb7 304update: clean
7aacca6f 305 rm -f *.5-opts.adoc *.1-synopsis.adoc *.8-synopsis.adoc
56122987 306 rm -f api-viewer/apidata.js
fe154a4f 307 rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc
c016ebb7 308 make all
deb7f2ea 309
bca311e4 310clean:
aa99b349 311 rm -rf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json
de9cbbd6 312 find . -name '*~' -exec rm {} ';'