export pvesm.1 with pve-doc-generator.mk
[pve-docs.git] / Makefile
CommitLineData
bef0c1b4
DM
1DGDIR=.
2
3include ./pve-doc-generator.mk
deb7f2ea 4
9344ee0d
DM
5PACKAGE=pve-doc-generator
6
7# also update debian/changelog
8PKGREL=1
9
bef0c1b4 10DEB=${PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb
9344ee0d
DM
11
12
13DEB_SOURCES= \
14 pve-doc-generator.mk \
15 attributes.txt \
16 pvesm.adoc \
828a27f5
DM
17 pve-storage-dir.adoc \
18 pve-storage-glusterfs.adoc \
19 pve-storage-iscsi.adoc \
20 pve-storage-iscsidirect.adoc \
21 pve-storage-lvm.adoc \
22 pve-storage-nfs.adoc \
23 pve-storage-rbd.adoc \
24 pve-storage-zfspool.adoc \
9344ee0d
DM
25 pveum.adoc \
26 vzdump.adoc \
27 pve-firewall.adoc \
28 qm.adoc \
29 pct.adoc \
30 pveam.adoc \
31 ha-manager.adoc \
32 pve-copyright.adoc \
33 docinfo.xml
34
35GEN_SCRIPTS= \
36 gen-datacenter-cfg-opts-adoc.pl \
37 gen-pct-conf-opts-adoc.pl \
38 gen-pve-firewall-cluster-opts.pl \
39 gen-pve-firewall-host-opts.pl \
40 gen-pve-firewall-macros-adoc.pl \
41 gen-pve-firewall-rules-opts.pl \
42 gen-pve-firewall-vm-opts.pl \
43 gen-vm-conf-opts-adoc.pl
44
deb7f2ea
DM
45PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc
46VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
deb7f2ea
DM
47QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc
48PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc
d61bab51 49PVEAM_SOURCES=attributes.txt pveam.adoc pveam.1-synopsis.adoc
22653ac8 50HA_SOURCES=attributes.txt ha-manager.1-synopsis.adoc ha-manager.adoc
deb7f2ea 51
d91f8c1e
DM
52SYSADMIN_SOURCES= \
53 getting-help.adoc \
54 pve-package-repos.adoc \
55 pve-installation.adoc \
56 system-software-updates.adoc \
57 sysadmin.adoc
58
deb7f2ea 59PVE_ADMIN_GUIDE_SOURCES= \
c016ebb7
DM
60 datacenter.cfg.adoc \
61 datacenter.cfg.5-opts.adoc \
7b2c36ae
DM
62 vm.conf.adoc \
63 vm.conf.5-opts.adoc \
71e16346
DM
64 pct.conf.adoc \
65 pct.conf.5-opts.adoc \
d91f8c1e 66 ${SYSADMIN_SOURCES} \
deb7f2ea
DM
67 pve-admin-guide.adoc \
68 pve-intro.adoc \
69 pmxcfs.adoc \
70 pve-faq.adoc \
9344ee0d 71 ${PVE_FIREWALL_MAN8_SOURCES} \
828a27f5 72 ${PVESM_MAN1_SOURCES} \
deb7f2ea
DM
73 ${QM_SOURCES} \
74 ${PCT_SOURCES} \
d61bab51 75 ${PVEAM_SOURCES} \
deb7f2ea 76 ${PVEUM_SOURCES} \
deb7f2ea 77 ${VZDUMP_SOURCES} \
22653ac8 78 ${HA_SOURCES} \
deb7f2ea
DM
79 images/cluster-nwdiag.svg \
80 images/node-nwdiag.svg \
81 pve-bibliography.adoc \
caf01dfc 82 GFDL.adoc \
deb7f2ea
DM
83 attributes.txt
84
85ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
bef0c1b4
DM
86ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
87ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
88ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
deb7f2ea 89
fc1090ef 90BROWSER?=xdg-open
df41beec 91
7b2c36ae
DM
92all: pve-admin-guide.html
93
deb7f2ea
DM
94%-nwdiag.svg: %.nwdiag
95 nwdiag -T svg $*.nwdiag -o $@;
96
bef0c1b4
DM
97%.1: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
98 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
9344ee0d 99 test -n "$${NOVIEW}" || man -l $@
deb7f2ea 100
bef0c1b4 101%.1.html: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
deb7f2ea 102 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
9344ee0d 103 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
104
105
106%.8-synopsis.adoc:
107 perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
108 mv $@.tmp $@
109
110%.8: %.adoc %.8-synopsis.adoc docinfo.xml
bef0c1b4 111 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
9344ee0d 112 test -n "$${NOVIEW}" || man -l $@
deb7f2ea
DM
113
114%.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
115 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
9344ee0d 116 test -n "$${NOVIEW}" || $(BROWSER) $@ &
71e16346 117
c016ebb7 118%.5: %.adoc %.5-opts.adoc docinfo.xml
bef0c1b4 119 a2x -a docinfo1 -a "manvolnum=5" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
9344ee0d 120 test -n "$${NOVIEW}" || man -l $@
c016ebb7
DM
121
122%.5.html: %.adoc %.5-opts.adoc docinfo.xml
123 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
9344ee0d 124 test -n "$${NOVIEW}" || $(BROWSER) $@ &
c016ebb7 125
deb7f2ea
DM
126index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
127 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
71e16346 128 $(MAKE) NOVIEW=1 qm.1.html pct.1.html pveam.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html ha-manager.1.html datacenter.cfg.5.html vm.conf.5.html pct.conf.5.html
bef0c1b4 129 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
9344ee0d 130 test -n "$${NOVIEW}" || $(BROWSER) index.html &
deb7f2ea
DM
131
132pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
bef0c1b4 133 asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
9344ee0d 134 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 135
2296c490 136pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
bef0c1b4 137 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
27125931 138 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 139 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
140
141pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
142 a2x -f epub pve-admin-guide.adoc
9344ee0d
DM
143 test -n "$${NOVIEW}" || $(BROWSER) $@ &
144
145.PHONY: dinstall
146dinstall: ${DEB}
147 dpkg -i ${DEB}
148
149.PHONY: deb
150${DEB} deb:
151 rm -rf build
152 mkdir build
153 rsync -a debian/ build/debian
154 mkdir -p build/usr/share/${PACKAGE}
155 install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
156 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
157 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
158 lintian ${DEB}
159
89e93b38
DM
160.PHONY: upload
161upload: ${DEB}
162 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
163 mkdir -p /pve/${DOCRELEASE}/extra
164 rm -f /pve/${DOCRELEASE}/extra/${PACKAGE}_*.deb
165 rm -f /pve/${DOCRELEASE}/extra/Packages*
166 cp ${DEB} /pve/${DOCRELEASE}/extra
167 cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
168 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
deb7f2ea 169
c016ebb7
DM
170update: clean
171 rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
172 make all
deb7f2ea
DM
173
174clean:
9344ee0d
DM
175 rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
176