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