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