bump pve-docs version to 4.2-2
[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
5bee3225
DM
9GEN_PKGREL=1
10# also update doc-debian/changelog
11DOC_PKGREL=2
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
ebd2a7fb
DM
18COMMAND_LIST= \
19 pvesubscription \
20 pvecm \
21 qm \
22 qmrestore \
0840a663 23 pveceph \
ebd2a7fb
DM
24 pct \
25 pveam \
26 pvesm \
27 pveum \
28 vzdump \
29 ha-manager
672abac1 30
96f2beeb
DM
31SERVICE_LIST= \
32 pve-firewall \
33 pve-ha-crm \
34 pve-ha-lrm \
35 pvestatd \
36 pmxcfs \
37 pveproxy \
2d8f1c92 38 spiceproxy \
96f2beeb 39 pvedaemon
672abac1
DM
40
41CONFIG_LIST=datacenter.cfg qm.conf pct.conf
42
9015f48f 43GEN_DEB_SOURCES= \
672abac1
DM
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 \
bd88f9d9 57 pmxcfs.8-cli.adoc \
672abac1 58 pve-copyright.adoc \
9344ee0d
DM
59 docinfo.xml
60
61GEN_SCRIPTS= \
f6b81378
DM
62 gen-datacenter.cfg.5-opts.pl \
63 gen-pct.conf.5-opts.pl \
9b4799ab 64 gen-qm.conf.5-opts.pl \
500f1e1f 65 gen-vzdump.conf.5-opts.pl \
9344ee0d
DM
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 \
f6b81378 70 gen-pve-firewall-vm-opts.pl
9344ee0d 71
672abac1
DM
72SYSADMIN_SOURCES= \
73 getting-help.adoc \
74 pve-package-repos.adoc \
75 pve-installation.adoc \
76 system-software-updates.adoc \
d91f8c1e
DM
77 sysadmin.adoc
78
356064f4
DM
79API_VIEWER_SOURCES= \
80 api-viewer/index.html \
81 api-viewer/apidoc.js
82
672abac1
DM
83PVE_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 \
bd88f9d9 91 pmxcfs.8-cli.adoc \
672abac1
DM
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} \
2d8f1c92
DM
101 ${PVESTATD_MAN8_SOURCES} \
102 ${PVEDAEMON_MAN8_SOURCES} \
103 ${PVEPROXY_MAN8_SOURCES} \
104 ${SPICEPROXY_MAN8_SOURCES} \
672abac1
DM
105 ${PVE_HA_CRM_MAN8_SOURCES} \
106 ${PVE_HA_LRM_MAN8_SOURCES} \
6198e7c5
DM
107 ${VZDUMP_MAN1_SOURCES} \
108 ${PVEAM_MAN1_SOURCES} \
ebd2a7fb 109 ${PVESUBSCRIPTION_MAN1_SOURCES} \
0840a663 110 ${PVECEPH_MAN1_SOURCES} \
672abac1
DM
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 \
deb7f2ea
DM
118 attributes.txt
119
120ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
bef0c1b4
DM
121ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
122ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
123ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
deb7f2ea 124
fc1090ef 125BROWSER?=xdg-open
df41beec 126
7b2c36ae
DM
127all: pve-admin-guide.html
128
deb7f2ea
DM
129%-nwdiag.svg: %.nwdiag
130 nwdiag -T svg $*.nwdiag -o $@;
131
bd88f9d9 132%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 133 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
9344ee0d 134 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
135
136
7c40c631
DM
137pmxcfs.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) $@ &
deb7f2ea 140
7c40c631 141%.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
deb7f2ea 142 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
9344ee0d 143 test -n "$${NOVIEW}" || $(BROWSER) $@ &
71e16346 144
7c40c631 145%.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
c016ebb7 146 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
9344ee0d 147 test -n "$${NOVIEW}" || $(BROWSER) $@ &
c016ebb7 148
356064f4 149index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} ${API_VIEWER_SOURCES}
deb7f2ea 150 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
672abac1 151 $(MAKE) NOVIEW=1 $(addsuffix .1.html, ${COMMAND_LIST}) $(addsuffix .8.html, ${SERVICE_LIST}) $(addsuffix .5.html, ${CONFIG_LIST})
bef0c1b4 152 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
9344ee0d 153 test -n "$${NOVIEW}" || $(BROWSER) index.html &
deb7f2ea
DM
154
155pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
bef0c1b4 156 asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
9344ee0d 157 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 158
2296c490 159pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
bef0c1b4 160 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
27125931 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
9344ee0d 162 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
163
164pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
165 a2x -f epub pve-admin-guide.adoc
9344ee0d
DM
166 test -n "$${NOVIEW}" || $(BROWSER) $@ &
167
356064f4 168api-viewer/apidata.js: extractapi.pl
61568a65
DM
169 ./extractapi.pl >$@
170
356064f4
DM
171api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js
172 cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
61568a65 173
9344ee0d 174.PHONY: dinstall
f8866417
DM
175dinstall: ${GEN_DEB} ${DOC_DEB}
176 dpkg -i ${GEN_DEB} ${DOC_DEB}
9015f48f 177
9344ee0d
DM
178
179.PHONY: deb
9015f48f
DM
180deb:
181 rm -f ${GEN_DEB} ${DOC_DEB};
182 make ${GEN_DEB};
183 make ${DOC_DEB};
184
185DOC_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
356064f4 194${DOC_DEB}: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} ${API_VIEWER_SOURCES}
9015f48f
DM
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}
61568a65 206 # install api doc viewer
356064f4
DM
207 mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
208 install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
9015f48f
DM
209 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
210 lintian ${DOC_DEB}
211
212${GEN_DEB}: ${GEN_DEB_SOURCES}
9344ee0d
DM
213 rm -rf build
214 mkdir build
215 rsync -a debian/ build/debian
9015f48f
DM
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}
9344ee0d 221 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
9015f48f 222 lintian ${GEN_DEB}
9344ee0d 223
89e93b38 224.PHONY: upload
9015f48f 225upload: ${GEN_DEB} ${DOC_DEB}
89e93b38
DM
226 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
227 mkdir -p /pve/${DOCRELEASE}/extra
9015f48f
DM
228 rm -f /pve/${DOCRELEASE}/extra/${GEN_PACKAGE}_*.deb
229 rm -f /pve/${DOCRELEASE}/extra/${DOC_PACKAGE}_*.deb
89e93b38 230 rm -f /pve/${DOCRELEASE}/extra/Packages*
9015f48f 231 cp ${GEN_DEB} ${DOC_DEB} /pve/${DOCRELEASE}/extra
89e93b38
DM
232 cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
233 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
deb7f2ea 234
c016ebb7
DM
235update: clean
236 rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
237 make all
deb7f2ea
DM
238
239clean:
356064f4 240 rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidata.js api-viewer/apidoc.js
9344ee0d 241