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