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