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