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