add pvedaemon 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=pvecm qm qmrestore pct pveam pvesm pveum vzdump ha-manager
15
16 SERVICE_LIST=pve-firewall pve-ha-crm pve-ha-lrm pvestatd pmxcfs pvedaemon
17
18 CONFIG_LIST=datacenter.cfg qm.conf pct.conf
19
20 DEB_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                \
34         pmxcfs.8-cli.adoc                       \
35         pve-copyright.adoc                      \
36         docinfo.xml
37
38 GEN_SCRIPTS=                                    \
39         gen-datacenter.cfg.5-opts.pl            \
40         gen-pct.conf.5-opts.pl                  \
41         gen-qm.conf.5-opts.pl                   \
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          \
46         gen-pve-firewall-vm-opts.pl
47
48 VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
49 PVEAM_SOURCES=attributes.txt pveam.adoc pveam.1-synopsis.adoc
50
51 SYSADMIN_SOURCES=                               \
52         getting-help.adoc                       \
53         pve-package-repos.adoc                  \
54         pve-installation.adoc                   \
55         system-software-updates.adoc            \
56         sysadmin.adoc
57
58 PVE_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                             \
66         pmxcfs.8-cli.adoc                       \
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                               \
87         attributes.txt
88
89 ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
90 ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
91 ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
92 ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
93
94 BROWSER?=xdg-open
95
96 all: pve-admin-guide.html
97
98 %-nwdiag.svg: %.nwdiag
99         nwdiag -T svg $*.nwdiag -o $@;
100
101 %.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
102         asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
103         test -n "$${NOVIEW}" || $(BROWSER) $@ &
104
105
106 pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES}
107         asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc
108         test -n "$${NOVIEW}" || $(BROWSER) $@ &
109
110 %.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
111         asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
112         test -n "$${NOVIEW}" || $(BROWSER) $@ &
113
114 %.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
115         asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
116         test -n "$${NOVIEW}" || $(BROWSER) $@ &
117
118 index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
119         $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
120         $(MAKE) NOVIEW=1 $(addsuffix .1.html, ${COMMAND_LIST}) $(addsuffix .8.html, ${SERVICE_LIST}) $(addsuffix .5.html, ${CONFIG_LIST})
121         asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
122         test -n "$${NOVIEW}" || $(BROWSER) index.html &
123
124 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
125         asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
126         test -n "$${NOVIEW}" || $(BROWSER) $@ &
127
128 pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
129         grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in  pve-admin-guide-docinfo.xml" && false);
130         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
131         test -n "$${NOVIEW}" || $(BROWSER) $@ &
132
133 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
134         a2x -f epub pve-admin-guide.adoc
135         test -n "$${NOVIEW}" || $(BROWSER) $@ &
136
137 .PHONY: dinstall
138 dinstall: ${DEB}
139         dpkg -i ${DEB}
140
141 .PHONY: deb
142 ${DEB} deb:
143         rm -rf build
144         mkdir build
145         rsync -a debian/ build/debian
146         mkdir -p build/usr/share/${PACKAGE}
147         mkdir -p build/usr/share/doc/${PACKAGE}
148         echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${PACKAGE}/SOURCE
149         install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
150         install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
151         cd build; dpkg-buildpackage -rfakeroot -b -us -uc
152         lintian ${DEB}
153
154 .PHONY: upload
155 upload: ${DEB}
156         umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
157         mkdir -p /pve/${DOCRELEASE}/extra
158         rm -f /pve/${DOCRELEASE}/extra/${PACKAGE}_*.deb
159         rm -f /pve/${DOCRELEASE}/extra/Packages*
160         cp ${DEB} /pve/${DOCRELEASE}/extra
161         cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
162         umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
163
164 update: clean
165         rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
166         make all
167
168 clean:
169         rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
170