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