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