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