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