3 include .
/pve-doc-generator.mk
5 PACKAGE
=pve-doc-generator
7 # also update debian/changelog
10 GITVERSION
:=$(shell cat .git
/refs
/heads
/master
)
12 DEB
=${PACKAGE}_
${DOCRELEASE}-${PKGREL}_amd64.deb
14 COMMAND_LIST
=pvecm qm qmrestore pct pveam pvesm pveum vzdump ha-manager
16 SERVICE_LIST
=pve-firewall pve-ha-crm pve-ha-lrm pvestatd
18 CONFIG_LIST
=datacenter.cfg qm.conf pct.conf
21 pve-doc-generator.mk \
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 \
38 gen-datacenter.cfg
.5-opts.pl \
39 gen-pct.conf
.5-opts.pl \
40 gen-qm.conf
.5-opts.pl \
41 gen-pve-firewall-cluster-opts.pl \
42 gen-pve-firewall-host-opts.pl \
43 gen-pve-firewall-macros-adoc.pl \
44 gen-pve-firewall-rules-opts.pl \
45 gen-pve-firewall-vm-opts.pl
47 VZDUMP_SOURCES
=attributes.txt vzdump.adoc vzdump
.1-synopsis.adoc
48 PVEAM_SOURCES
=attributes.txt pveam.adoc pveam
.1-synopsis.adoc
52 pve-package-repos.adoc \
53 pve-installation.adoc \
54 system-software-updates.adoc \
57 PVE_ADMIN_GUIDE_SOURCES
= \
58 ${DATACENTER_CONF_MAN5_SOURCES} \
59 ${QM_CONF_MAN5_SOURCES} \
60 ${PCT_CONF_MAN5_SOURCES} \
62 pve-admin-guide.adoc \
66 ${PVE_FIREWALL_MAN8_SOURCES} \
67 ${PVESM_MAN1_SOURCES} \
69 ${PVECM_MAN1_SOURCES} \
70 ${PVEUM_MAN1_SOURCES} \
72 ${QMRESTORE_MAN1_SOURCES} \
73 ${HA_MANAGER_MAN1_SOURCES} \
74 ${PVE_HA_CRM_MAN8_SOURCES} \
75 ${PVE_HA_LRM_MAN8_SOURCES} \
78 images
/cluster-nwdiag.svg \
79 images
/node-nwdiag.svg \
80 pve-bibliography.adoc \
81 $(addsuffix .adoc
, ${COMMAND_LIST}) \
82 $(addsuffix .adoc
, ${SERVICE_LIST}) \
83 $(addsuffix .adoc
, ${CONFIG_LIST}) \
87 ADOC_STDARG
= -a icons
-a data-uri
-a
"date=$(shell date)"
88 ADOC_MAN1_HTML_ARGS
=-a
"manvolnum=1" ${ADOC_STDARG} -a
"revnumber=${DOCRELEASE}"
89 ADOC_MAN5_HTML_ARGS
=-a
"manvolnum=5" ${ADOC_STDARG} -a
"revnumber=${DOCRELEASE}"
90 ADOC_MAN8_HTML_ARGS
=-a
"manvolnum=8" ${ADOC_STDARG} -a
"revnumber=${DOCRELEASE}"
94 all: pve-admin-guide.html
96 %-nwdiag.svg
: %.nwdiag
97 nwdiag
-T svg
$*.nwdiag
-o
$@
;
99 %.1: %.adoc
%.1-synopsis.adoc docinfo.xml attributes.txt
100 a2x
-a docinfo1
-a
"manvolnum=1" -a
"manversion=Release ${DOCRELEASE}" -f manpage
$*.adoc
101 test -n
"$${NOVIEW}" || man
-l
$@
103 %.1.html
: %.adoc
%.1-synopsis.adoc docinfo.xml attributes.txt
104 asciidoc
${ADOC_MAN1_HTML_ARGS} -o
$@
$*.adoc
105 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
109 perl
-e
"use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
112 %.8: %.adoc
%.8-synopsis.adoc docinfo.xml
113 a2x
-a docinfo1
-a
"manvolnum=8" -a
"manversion=Release ${DOCRELEASE}" -f manpage
$*.adoc
114 test -n
"$${NOVIEW}" || man
-l
$@
116 %.8.html
: %.adoc
%.8-synopsis.adoc docinfo.xml
117 asciidoc
${ADOC_MAN8_HTML_ARGS} -o
$@
$*.adoc
118 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
120 %.5.html
: %.adoc
%.5-opts.adoc docinfo.xml
121 asciidoc
${ADOC_MAN5_HTML_ARGS} -o
$@
$*.adoc
122 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
124 index.html
: index.adoc
${PVE_ADMIN_GUIDE_SOURCES}
125 $(MAKE
) NOVIEW
=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
126 $(MAKE
) NOVIEW
=1 $(addsuffix .1.html
, ${COMMAND_LIST}) $(addsuffix .8.html
, ${SERVICE_LIST}) $(addsuffix .5.html
, ${CONFIG_LIST})
127 asciidoc
-a
"date=$(shell date)" -a
"revnumber=${DOCRELEASE}" index.adoc
128 test -n
"$${NOVIEW}" ||
$(BROWSER
) index.html
&
130 pve-admin-guide.html
: ${PVE_ADMIN_GUIDE_SOURCES}
131 asciidoc
-a
"revnumber=${DOCRELEASE}" -a
"date=$(shell date)" pve-admin-guide.adoc
132 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
134 pve-admin-guide.pdf
: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
135 grep
">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml ||
(echo
"wrong release in pve-admin-guide-docinfo.xml" && false
);
136 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
137 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
139 pve-admin-guide.epub
: ${PVE_ADMIN_GUIDE_SOURCES}
140 a2x
-f epub pve-admin-guide.adoc
141 test -n
"$${NOVIEW}" ||
$(BROWSER
) $@
&
151 rsync
-a debian
/ build
/debian
152 mkdir
-p build
/usr
/share
/${PACKAGE}
153 mkdir
-p build
/usr
/share
/doc
/${PACKAGE}
154 echo
"git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build
/usr
/share
/doc
/${PACKAGE}/SOURCE
155 install -m
0644 ${DEB_SOURCES} build
/usr
/share
/${PACKAGE}
156 install -m
0755 ${GEN_SCRIPTS} build
/usr
/share
/${PACKAGE}
157 cd build
; dpkg-buildpackage
-rfakeroot
-b
-us
-uc
162 umount
/pve
/${DOCRELEASE}; mount
/pve
/${DOCRELEASE} -o rw
163 mkdir
-p
/pve
/${DOCRELEASE}/extra
164 rm -f
/pve
/${DOCRELEASE}/extra
/${PACKAGE}_
*.deb
165 rm -f
/pve
/${DOCRELEASE}/extra
/Packages
*
166 cp
${DEB} /pve
/${DOCRELEASE}/extra
167 cd
/pve
/${DOCRELEASE}/extra
; dpkg-scanpackages .
/dev
/null
> Packages
; gzip
-9c Packages
> Packages.gz
168 umount
/pve
/${DOCRELEASE}; mount
/pve
/${DOCRELEASE} -o ro
171 rm -f
*.5-opts.adoc
.1-synopsis.adoc
.8-synopsis.adoc
175 rm -rf
*~
*.html
*.pdf
*.epub
*.tmp
*.1 *.5 *.8 *.deb
*.changes build