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