]> git.proxmox.com Git - pve-docs.git/blame - Makefile
create debian package with all sources to generate pve manual pages
[pve-docs.git] / Makefile
CommitLineData
a4346554 1RELEASE=4.1
deb7f2ea 2
9344ee0d
DM
3PACKAGE=pve-doc-generator
4
5# also update debian/changelog
6PKGREL=1
7
8DEB=${PACKAGE}_${RELEASE}-${PKGREL}_amd64.deb
9
10DGDIR=.
11
12include ./pve-doc-generator.mk
13
14
15DEB_SOURCES= \
16 pve-doc-generator.mk \
17 attributes.txt \
18 pvesm.adoc \
19 pveum.adoc \
20 vzdump.adoc \
21 pve-firewall.adoc \
22 qm.adoc \
23 pct.adoc \
24 pveam.adoc \
25 ha-manager.adoc \
26 pve-copyright.adoc \
27 docinfo.xml
28
29GEN_SCRIPTS= \
30 gen-datacenter-cfg-opts-adoc.pl \
31 gen-pct-conf-opts-adoc.pl \
32 gen-pve-firewall-cluster-opts.pl \
33 gen-pve-firewall-host-opts.pl \
34 gen-pve-firewall-macros-adoc.pl \
35 gen-pve-firewall-rules-opts.pl \
36 gen-pve-firewall-vm-opts.pl \
37 gen-vm-conf-opts-adoc.pl
38
deb7f2ea
DM
39PVESM_SOURCES=attributes.txt pvesm.adoc pvesm.1-synopsis.adoc $(shell ls pve-storage-*.adoc)
40PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc
41VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
deb7f2ea
DM
42QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc
43PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc
d61bab51 44PVEAM_SOURCES=attributes.txt pveam.adoc pveam.1-synopsis.adoc
22653ac8 45HA_SOURCES=attributes.txt ha-manager.1-synopsis.adoc ha-manager.adoc
deb7f2ea 46
d91f8c1e
DM
47SYSADMIN_SOURCES= \
48 getting-help.adoc \
49 pve-package-repos.adoc \
50 pve-installation.adoc \
51 system-software-updates.adoc \
52 sysadmin.adoc
53
deb7f2ea 54PVE_ADMIN_GUIDE_SOURCES= \
c016ebb7
DM
55 datacenter.cfg.adoc \
56 datacenter.cfg.5-opts.adoc \
7b2c36ae
DM
57 vm.conf.adoc \
58 vm.conf.5-opts.adoc \
71e16346
DM
59 pct.conf.adoc \
60 pct.conf.5-opts.adoc \
d91f8c1e 61 ${SYSADMIN_SOURCES} \
deb7f2ea
DM
62 pve-admin-guide.adoc \
63 pve-intro.adoc \
64 pmxcfs.adoc \
65 pve-faq.adoc \
9344ee0d 66 ${PVE_FIREWALL_MAN8_SOURCES} \
deb7f2ea
DM
67 ${QM_SOURCES} \
68 ${PCT_SOURCES} \
d61bab51 69 ${PVEAM_SOURCES} \
deb7f2ea
DM
70 ${PVEUM_SOURCES} \
71 ${PVESM_SOURCES} \
72 ${VZDUMP_SOURCES} \
22653ac8 73 ${HA_SOURCES} \
deb7f2ea
DM
74 images/cluster-nwdiag.svg \
75 images/node-nwdiag.svg \
76 pve-bibliography.adoc \
caf01dfc 77 GFDL.adoc \
deb7f2ea
DM
78 attributes.txt
79
80ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
db3cc8fc 81ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${RELEASE}"
c016ebb7 82ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${RELEASE}"
db3cc8fc 83ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${RELEASE}"
deb7f2ea 84
fc1090ef 85BROWSER?=xdg-open
df41beec 86
7b2c36ae
DM
87all: pve-admin-guide.html
88
deb7f2ea
DM
89%-nwdiag.svg: %.nwdiag
90 nwdiag -T svg $*.nwdiag -o $@;
91
92%.1-synopsis.adoc:
93 perl -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
94 mv $@.tmp $@
95
96%.1: %.adoc %.1-synopsis.adoc docinfo.xml
db3cc8fc 97 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc
9344ee0d 98 test -n "$${NOVIEW}" || man -l $@
deb7f2ea
DM
99
100%.1.html: %.adoc %.1-synopsis.adoc docinfo.xml
101 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
9344ee0d 102 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
103
104
105%.8-synopsis.adoc:
106 perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
107 mv $@.tmp $@
108
109%.8: %.adoc %.8-synopsis.adoc docinfo.xml
db3cc8fc 110 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc
9344ee0d 111 test -n "$${NOVIEW}" || man -l $@
deb7f2ea
DM
112
113%.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
114 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
9344ee0d 115 test -n "$${NOVIEW}" || $(BROWSER) $@ &
71e16346 116
c016ebb7
DM
117%.5: %.adoc %.5-opts.adoc docinfo.xml
118 a2x -a docinfo1 -a "manvolnum=5" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc
9344ee0d 119 test -n "$${NOVIEW}" || man -l $@
c016ebb7
DM
120
121%.5.html: %.adoc %.5-opts.adoc docinfo.xml
122 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
9344ee0d 123 test -n "$${NOVIEW}" || $(BROWSER) $@ &
c016ebb7 124
deb7f2ea
DM
125index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
126 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
71e16346 127 $(MAKE) NOVIEW=1 qm.1.html pct.1.html pveam.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html ha-manager.1.html datacenter.cfg.5.html vm.conf.5.html pct.conf.5.html
c016ebb7 128 asciidoc -a "date=$(shell date)" -a "revnumber=${RELEASE}" index.adoc
9344ee0d 129 test -n "$${NOVIEW}" || $(BROWSER) index.html &
deb7f2ea
DM
130
131pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
c016ebb7 132 asciidoc -a "revnumber=${RELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
9344ee0d 133 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 134
2296c490 135pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
8f13ba5f 136 grep ">Release ${RELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
27125931 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
9344ee0d 138 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
139
140pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
141 a2x -f epub pve-admin-guide.adoc
9344ee0d
DM
142 test -n "$${NOVIEW}" || $(BROWSER) $@ &
143
144.PHONY: dinstall
145dinstall: ${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 install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
155 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
156 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
157 lintian ${DEB}
158
deb7f2ea 159
c016ebb7
DM
160update: clean
161 rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
162 make all
deb7f2ea
DM
163
164clean:
9344ee0d
DM
165 rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
166