add more to vzdump lxc snapshot section
[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
9344ee0d
DM
7
8# also update debian/changelog
5bee3225
DM
9GEN_PKGREL=1
10# also update doc-debian/changelog
11DOC_PKGREL=2
9344ee0d 12
b4f3c18a
DM
13GITVERSION:=$(shell cat .git/refs/heads/master)
14
5bee3225
DM
15GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${GEN_PKGREL}_amd64.deb
16DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${DOC_PKGREL}_all.deb
9344ee0d 17
f96bdfd8
DM
18CHAPTER_LIST= \
19 sysadmin \
20 pvecm \
21 pmxcfs \
22 pvesm \
23 qm \
24 pve-firewall \
25 pveum \
26 pct \
27 ha-manager \
28 vzdump \
29 pve-faq \
30 pve-bibliography
31
32
ebd2a7fb
DM
33COMMAND_LIST= \
34 pvesubscription \
35 pvecm \
36 qm \
37 qmrestore \
0840a663 38 pveceph \
ebd2a7fb
DM
39 pct \
40 pveam \
41 pvesm \
42 pveum \
43 vzdump \
44 ha-manager
672abac1 45
96f2beeb
DM
46SERVICE_LIST= \
47 pve-firewall \
48 pve-ha-crm \
49 pve-ha-lrm \
50 pvestatd \
51 pmxcfs \
52 pveproxy \
2d8f1c92 53 spiceproxy \
96f2beeb 54 pvedaemon
672abac1
DM
55
56CONFIG_LIST=datacenter.cfg qm.conf pct.conf
57
9015f48f 58GEN_DEB_SOURCES= \
672abac1
DM
59 pve-doc-generator.mk \
60 attributes.txt \
61 $(addsuffix .adoc, ${COMMAND_LIST}) \
62 $(addsuffix .adoc, ${SERVICE_LIST}) \
63 $(addsuffix .adoc, ${CONFIG_LIST}) \
64 pve-storage-dir.adoc \
65 pve-storage-glusterfs.adoc \
66 pve-storage-iscsi.adoc \
67 pve-storage-iscsidirect.adoc \
68 pve-storage-lvm.adoc \
69 pve-storage-nfs.adoc \
70 pve-storage-rbd.adoc \
71 pve-storage-zfspool.adoc \
bd88f9d9 72 pmxcfs.8-cli.adoc \
672abac1 73 pve-copyright.adoc \
9344ee0d
DM
74 docinfo.xml
75
76GEN_SCRIPTS= \
f6b81378
DM
77 gen-datacenter.cfg.5-opts.pl \
78 gen-pct.conf.5-opts.pl \
9b4799ab 79 gen-qm.conf.5-opts.pl \
500f1e1f 80 gen-vzdump.conf.5-opts.pl \
9344ee0d
DM
81 gen-pve-firewall-cluster-opts.pl \
82 gen-pve-firewall-host-opts.pl \
83 gen-pve-firewall-macros-adoc.pl \
84 gen-pve-firewall-rules-opts.pl \
f6b81378 85 gen-pve-firewall-vm-opts.pl
9344ee0d 86
672abac1
DM
87SYSADMIN_SOURCES= \
88 getting-help.adoc \
89 pve-package-repos.adoc \
90 pve-installation.adoc \
91 system-software-updates.adoc \
d91f8c1e
DM
92 sysadmin.adoc
93
356064f4
DM
94API_VIEWER_SOURCES= \
95 api-viewer/index.html \
96 api-viewer/apidoc.js
97
672abac1
DM
98PVE_ADMIN_GUIDE_SOURCES= \
99 ${DATACENTER_CONF_MAN5_SOURCES} \
100 ${QM_CONF_MAN5_SOURCES} \
101 ${PCT_CONF_MAN5_SOURCES} \
102 ${SYSADMIN_SOURCES} \
103 pve-admin-guide.adoc \
104 pve-intro.adoc \
105 pmxcfs.adoc \
bd88f9d9 106 pmxcfs.8-cli.adoc \
672abac1
DM
107 pve-faq.adoc \
108 ${PVE_FIREWALL_MAN8_SOURCES} \
109 ${PVESM_MAN1_SOURCES} \
110 ${PCT_MAN1_SOURCES} \
111 ${PVECM_MAN1_SOURCES} \
112 ${PVEUM_MAN1_SOURCES} \
113 ${QM_MAN1_SOURCES} \
114 ${QMRESTORE_MAN1_SOURCES} \
115 ${HA_MANAGER_MAN1_SOURCES} \
2d8f1c92
DM
116 ${PVESTATD_MAN8_SOURCES} \
117 ${PVEDAEMON_MAN8_SOURCES} \
118 ${PVEPROXY_MAN8_SOURCES} \
119 ${SPICEPROXY_MAN8_SOURCES} \
672abac1
DM
120 ${PVE_HA_CRM_MAN8_SOURCES} \
121 ${PVE_HA_LRM_MAN8_SOURCES} \
6198e7c5
DM
122 ${VZDUMP_MAN1_SOURCES} \
123 ${PVEAM_MAN1_SOURCES} \
ebd2a7fb 124 ${PVESUBSCRIPTION_MAN1_SOURCES} \
0840a663 125 ${PVECEPH_MAN1_SOURCES} \
672abac1
DM
126 pve-bibliography.adoc \
127 $(addsuffix .adoc, ${COMMAND_LIST}) \
128 $(addsuffix .adoc, ${SERVICE_LIST}) \
129 $(addsuffix .adoc, ${CONFIG_LIST}) \
130 GFDL.adoc \
deb7f2ea
DM
131 attributes.txt
132
133ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
bef0c1b4
DM
134ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
135ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
136ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
deb7f2ea 137
fc1090ef 138BROWSER?=xdg-open
df41beec 139
56122987 140all: index.html
7b2c36ae 141
deb7f2ea
DM
142%-nwdiag.svg: %.nwdiag
143 nwdiag -T svg $*.nwdiag -o $@;
144
f96bdfd8 145chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
d01fa25d 146 asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc
f96bdfd8
DM
147 test -n "$${NOVIEW}" || $(BROWSER) $@ &
148
bd88f9d9 149%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 150 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
9344ee0d 151 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
152
153
7c40c631
DM
154pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES}
155 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc
156 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 157
7c40c631 158%.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 159 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
9344ee0d 160 test -n "$${NOVIEW}" || $(BROWSER) $@ &
71e16346 161
7c40c631 162%.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
c016ebb7 163 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
9344ee0d 164 test -n "$${NOVIEW}" || $(BROWSER) $@ &
c016ebb7 165
8ace7110
DM
166.PHONY: index
167index: index.html
168 test -n "$${NOVIEW}" || $(BROWSER) index.html &
169
356064f4 170index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} ${API_VIEWER_SOURCES}
deb7f2ea 171 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
672abac1 172 $(MAKE) NOVIEW=1 $(addsuffix .1.html, ${COMMAND_LIST}) $(addsuffix .8.html, ${SERVICE_LIST}) $(addsuffix .5.html, ${CONFIG_LIST})
f96bdfd8 173 $(MAKE) NOVIEW=1 $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST}))
bef0c1b4 174 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
deb7f2ea
DM
175
176pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
bef0c1b4 177 asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
9344ee0d 178 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 179
59d89a51
DM
180pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_SOURCES}
181 rm -rf pve-admin-guide.chunked
182 a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc
183 test -n "$${NOVIEW}" || $(BROWSER) $@/index.html &
184
2296c490 185pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
bef0c1b4 186 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
27125931 187 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" pve-admin-guide.adoc
9344ee0d 188 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
189
190pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
191 a2x -f epub pve-admin-guide.adoc
9344ee0d
DM
192 test -n "$${NOVIEW}" || $(BROWSER) $@ &
193
356064f4 194api-viewer/apidata.js: extractapi.pl
61568a65
DM
195 ./extractapi.pl >$@
196
356064f4
DM
197api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js
198 cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
61568a65 199
9344ee0d 200.PHONY: dinstall
f8866417
DM
201dinstall: ${GEN_DEB} ${DOC_DEB}
202 dpkg -i ${GEN_DEB} ${DOC_DEB}
9015f48f 203
9344ee0d
DM
204
205.PHONY: deb
9015f48f
DM
206deb:
207 rm -f ${GEN_DEB} ${DOC_DEB};
208 make ${GEN_DEB};
209 make ${DOC_DEB};
210
f96bdfd8
DM
211DOC_DEB_FILES= \
212 $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST})) \
213 $(addsuffix .1.html, ${COMMAND_LIST}) \
214 $(addsuffix .8.html, ${SERVICE_LIST}) \
215 $(addsuffix .5.html, ${CONFIG_LIST}) \
9015f48f
DM
216 pve-admin-guide.pdf \
217 pve-admin-guide.html \
218 pve-admin-guide.epub \
219 index.html
220
8ace7110 221${DOC_DEB}: index.html
9015f48f
DM
222 rm -rf build
223 mkdir build
224 rsync -a doc-debian/ build/debian
225 mkdir -p build/usr/share/${DOC_PACKAGE}
226 mkdir -p build/usr/share/doc/${DOC_PACKAGE}
227 echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${DOC_PACKAGE}/SOURCE
228 # install doc files
229 install -m 0644 ${DOC_DEB_FILES} build/usr/share/${DOC_PACKAGE}
61568a65 230 # install api doc viewer
356064f4
DM
231 mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
232 install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
9015f48f
DM
233 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
234 lintian ${DOC_DEB}
235
236${GEN_DEB}: ${GEN_DEB_SOURCES}
9344ee0d
DM
237 rm -rf build
238 mkdir build
239 rsync -a debian/ build/debian
9015f48f
DM
240 mkdir -p build/usr/share/${GEN_PACKAGE}
241 mkdir -p build/usr/share/doc/${GEN_PACKAGE}
242 echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${GEN_PACKAGE}/SOURCE
243 install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
244 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
9344ee0d 245 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
9015f48f 246 lintian ${GEN_DEB}
9344ee0d 247
89e93b38 248.PHONY: upload
9015f48f 249upload: ${GEN_DEB} ${DOC_DEB}
89e93b38
DM
250 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
251 mkdir -p /pve/${DOCRELEASE}/extra
9015f48f
DM
252 rm -f /pve/${DOCRELEASE}/extra/${GEN_PACKAGE}_*.deb
253 rm -f /pve/${DOCRELEASE}/extra/${DOC_PACKAGE}_*.deb
89e93b38 254 rm -f /pve/${DOCRELEASE}/extra/Packages*
9015f48f 255 cp ${GEN_DEB} ${DOC_DEB} /pve/${DOCRELEASE}/extra
89e93b38
DM
256 cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
257 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
deb7f2ea 258
56122987 259.PHONY: update
c016ebb7 260update: clean
7aacca6f 261 rm -f *.5-opts.adoc *.1-synopsis.adoc *.8-synopsis.adoc
56122987 262 rm -f api-viewer/apidata.js
7aacca6f 263 rm -f pve-firewall-macros.adoc
c016ebb7 264 make all
deb7f2ea
DM
265
266clean:
56122987 267 rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html pve-admin-guide.chunked
de9cbbd6 268 find . -name '*~' -exec rm {} ';'