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