]>
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 | 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 | ||
34 | STORAGE_TYPES= \ | |
35 | dir \ | |
36 | glusterfs \ | |
37 | iscsi \ | |
38 | iscsidirect \ | |
39 | lvm \ | |
40 | lvmthin \ | |
41 | nfs \ | |
42 | rbd \ | |
43 | zfspool | |
44 | ||
45 | COMMAND_LIST= \ | |
46 | pvesubscription \ | |
47 | pvecm \ | |
48 | qm \ | |
49 | qmrestore \ | |
50 | pveceph \ | |
51 | pct \ | |
52 | pveam \ | |
53 | pvesm \ | |
54 | pveum \ | |
55 | vzdump \ | |
56 | ha-manager | |
57 | ||
58 | SERVICE_LIST= \ | |
59 | pve-firewall \ | |
60 | pve-ha-crm \ | |
61 | pve-ha-lrm \ | |
62 | pvestatd \ | |
63 | pmxcfs \ | |
64 | pveproxy \ | |
65 | spiceproxy \ | |
66 | pvedaemon | |
67 | ||
68 | CONFIG_LIST=datacenter.cfg qm.conf pct.conf | |
69 | ||
70 | GEN_DEB_SOURCES= \ | |
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 \ | |
81 | pve-storage-lvmthin.adoc \ | |
82 | pve-storage-nfs.adoc \ | |
83 | pve-storage-rbd.adoc \ | |
84 | pve-storage-zfspool.adoc \ | |
85 | pmxcfs.8-cli.adoc \ | |
86 | pve-copyright.adoc \ | |
87 | docinfo.xml | |
88 | ||
89 | GEN_SCRIPTS= \ | |
90 | gen-datacenter.cfg.5-opts.pl \ | |
91 | gen-pct.conf.5-opts.pl \ | |
92 | gen-pct-network-opts.pl \ | |
93 | gen-pct-mountpoint-opts.pl \ | |
94 | gen-qm.conf.5-opts.pl \ | |
95 | gen-vzdump.conf.5-opts.pl \ | |
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 \ | |
100 | gen-pve-firewall-vm-opts.pl | |
101 | ||
102 | SYSADMIN_PARTS= \ | |
103 | getting-help \ | |
104 | pve-network \ | |
105 | pve-package-repos \ | |
106 | pve-installation \ | |
107 | system-software-updates \ | |
108 | local-lvm \ | |
109 | local-zfs | |
110 | ||
111 | SYSADMIN_SOURCES= \ | |
112 | $(addsuffix .adoc, ${SYSADMIN_PARTS}) \ | |
113 | sysadmin.adoc | |
114 | ||
115 | API_VIEWER_SOURCES= \ | |
116 | api-viewer/index.html \ | |
117 | api-viewer/apidoc.js | |
118 | ||
119 | PVE_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 \ | |
127 | pmxcfs.8-cli.adoc \ | |
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} \ | |
137 | ${PVESTATD_MAN8_SOURCES} \ | |
138 | ${PVEDAEMON_MAN8_SOURCES} \ | |
139 | ${PVEPROXY_MAN8_SOURCES} \ | |
140 | ${SPICEPROXY_MAN8_SOURCES} \ | |
141 | ${PVE_HA_CRM_MAN8_SOURCES} \ | |
142 | ${PVE_HA_LRM_MAN8_SOURCES} \ | |
143 | ${VZDUMP_MAN1_SOURCES} \ | |
144 | ${PVEAM_MAN1_SOURCES} \ | |
145 | ${PVESUBSCRIPTION_MAN1_SOURCES} \ | |
146 | ${PVECEPH_MAN1_SOURCES} \ | |
147 | pve-bibliography.adoc \ | |
148 | $(addsuffix .adoc, ${COMMAND_LIST}) \ | |
149 | $(addsuffix .adoc, ${SERVICE_LIST}) \ | |
150 | $(addsuffix .adoc, ${CONFIG_LIST}) \ | |
151 | GFDL.adoc \ | |
152 | attributes.txt | |
153 | ||
154 | WIKI_IMPORTS= \ | |
155 | $(addsuffix -plain.html, $(addprefix sysadmin-, ${SYSADMIN_PARTS})) \ | |
156 | $(addsuffix -plain.html, $(addprefix chapter-, ${CHAPTER_LIST})) \ | |
157 | $(addsuffix .5-plain.html, ${CONFIG_LIST}) \ | |
158 | $(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES})) | |
159 | ||
160 | INDEX_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}) \ | |
167 | $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST})) | |
168 | ||
169 | ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" | |
170 | ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} | |
171 | ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} | |
172 | ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} | |
173 | ||
174 | BROWSER?=xdg-open | |
175 | ||
176 | all: index.html | |
177 | ||
178 | %-nwdiag.svg: %.nwdiag | |
179 | nwdiag -T svg $*.nwdiag -o $@; | |
180 | ||
181 | sysadmin-%-plain.html: %.adoc | |
182 | asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ $*.adoc | |
183 | ||
184 | chapter-sysadmin.html chapter-sysadmin-plain.html: ${SYSADMIN_SOURCES} | |
185 | ||
186 | chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES} | |
187 | asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc | |
188 | ||
189 | chapter-%-plain.html: %.adoc ${PVE_COMMON_DOC_SOURCES} | |
190 | asciidoc -s -a wiki ${ADOC_STDARG} -o $@ $*.adoc | |
191 | ||
192 | pve-storage-%-plain.html: pve-storage-%.adoc ${PVE_COMMON_DOC_SOURCES} | |
193 | asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ pve-storage-$*.adoc | |
194 | ||
195 | %.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES} | |
196 | asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc | |
197 | ||
198 | pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES} | |
199 | asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc | |
200 | ||
201 | %.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES} | |
202 | asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc | |
203 | ||
204 | %.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES} | |
205 | asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc | |
206 | ||
207 | %.5-plain.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES} | |
208 | asciidoc -s ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc | |
209 | ||
210 | README.html: README.adoc | |
211 | asciidoc ${ADOC_STDARG} -o $@ $< | |
212 | ||
213 | .PHONY: index | |
214 | index: index.html | |
215 | $(BROWSER) index.html & | |
216 | ||
217 | index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES} | |
218 | asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc | |
219 | ||
220 | pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES} | |
221 | asciidoc -a pvelogo -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc | |
222 | ||
223 | pve-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 | |
226 | ||
227 | pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml | |
228 | inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg | |
229 | inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg | |
230 | grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false); | |
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 | |
232 | rm proxmox-logo.pdf proxmox-ci-header.pdf | |
233 | ||
234 | pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES} | |
235 | a2x -f epub pve-admin-guide.adoc | |
236 | ||
237 | api-viewer/apidata.js: extractapi.pl | |
238 | ./extractapi.pl >$@ | |
239 | ||
240 | api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js | |
241 | cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@ | |
242 | ||
243 | .PHONY: dinstall | |
244 | dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | |
245 | dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | |
246 | ||
247 | .PHONY: deb | |
248 | deb: | |
249 | rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}; | |
250 | make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}; | |
251 | ||
252 | ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} | |
253 | rm -rf build | |
254 | mkdir build | |
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 | |
263 | mkdir -p build/usr/share/${DOC_PACKAGE} | |
264 | mkdir -p build/usr/share/doc/${DOC_PACKAGE} | |
265 | install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE} | |
266 | install -m 0644 ${WIKI_IMPORTS} build/usr/share/${DOC_PACKAGE} | |
267 | # install api doc viewer | |
268 | mkdir build/usr/share/${DOC_PACKAGE}/api-viewer | |
269 | install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer | |
270 | # build Debian packages | |
271 | cd build; dpkg-buildpackage -rfakeroot -b -us -uc | |
272 | lintian ${GEN_DEB} | |
273 | lintian ${DOC_DEB} | |
274 | lintian ${MEDIAWIKI_DEB} | |
275 | ||
276 | .PHONY: upload | |
277 | upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | |
278 | tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh repoman@repo.proxmox.com upload | |
279 | ||
280 | .PHONY: update | |
281 | update: clean | |
282 | rm -f *.5-opts.adoc *.1-synopsis.adoc *.8-synopsis.adoc | |
283 | rm -f api-viewer/apidata.js | |
284 | rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc | |
285 | make all | |
286 | ||
287 | clean: | |
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 | |
289 | find . -name '*~' -exec rm {} ';' |