1 include /usr
/share
/dpkg
/pkg-info.mk
3 # overwriting below ensures that we can build without full PVE installed
5 ASCIIDOC_PVE
=.
/asciidoc-pve
7 BUILDDIR ?
= $(DEB_SOURCE
)-$(DEB_VERSION
)
8 DSC
=$(DEB_SOURCE
)_
$(DEB_VERSION
).dsc
10 GEN_PACKAGE
=pve-doc-generator
12 MEDIAWIKI_PACKAGE
=pve-docs-mediawiki
14 GITVERSION
:=$(shell git rev-parse HEAD
)
16 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
18 GEN_DEB
=$(GEN_PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_
$(ARCH
).deb
19 DOC_DEB
=$(DOC_PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_all.deb
20 MEDIAWIKI_DEB
=$(MEDIAWIKI_PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_all.deb
22 export SOURCE_DATE_EPOCH ?
= $(shell dpkg-parsechangelog
-STimestamp
)
23 SOURCE_DATE_HUMAN
:= $(shell date
-d
"@$(SOURCE_DATE_EPOCH)")
29 for i in .
/images
/screenshot
/*.png
; do .
/png-verify.pl
$$i; done
31 ADOC_SOURCES_GUESS
=$(filter-out %-synopsis.adoc
%-opts.adoc
%-table.adoc
, $(wildcard *.adoc
))
32 .pve-doc-depends link-refs.json
: $(ADOC_SOURCES_GUESS
) scan-adoc-refs
33 .
/scan-adoc-refs
*.adoc
--depends .pve-doc-depends.tmp
> link-refs.json.tmp
34 @cmp
--quiet .pve-doc-depends .pve-doc-depends.tmp || mv .pve-doc-depends.tmp .pve-doc-depends
35 @cmp
--quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
37 pve-doc-generator.mk
: .pve-doc-depends pve-doc-generator.mk.in
38 cat pve-doc-generator.mk.in .pve-doc-depends
> $@.tmp
39 sed
-i
"s/@RELEASE@$$/$(DEB_VERSION_UPSTREAM)/" $@.tmp
42 -include .
/pve-doc-generator.mk
45 pve-doc-generator.mk \
47 pmxcfs
.8-synopsis.adoc \
48 qmeventd
.8-synopsis.adoc \
52 gen-ha-groups-opts.pl \
53 gen-ha-resources-opts.pl \
54 gen-datacenter.cfg
.5-opts.pl \
55 gen-pct.conf
.5-opts.pl \
56 gen-pct-network-opts.pl \
57 gen-pct-mountpoint-opts.pl \
58 gen-qm.conf
.5-opts.pl \
59 gen-cpu-models.conf
.5-opts.pl \
60 gen-qm-cloud-init-opts.pl \
61 gen-vzdump.conf
.5-opts.pl \
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 \
66 gen-pve-firewall-vm-opts.pl \
67 gen-output-format-opts.pl
70 api-viewer
/apidata.js \
71 api-viewer
/PVEAPI.js \
72 /usr
/share
/javascript
/proxmox-widget-toolkit-dev
/APIViewer.js
75 api-viewer
/index.html \
78 asciidoc-pve
: asciidoc-pve.in link-refs.json
79 cat asciidoc-pve.in link-refs.json
>asciidoc-pve.tmp
80 sed
-e s
/@RELEASE@
/$(DOCRELEASE
)/ -i asciidoc-pve.tmp
81 chmod
+x asciidoc-pve.tmp
82 mv asciidoc-pve.tmp asciidoc-pve
84 pve-docs-mediawiki-import
: pve-docs-mediawiki-import.in link-refs.json
85 cat pve-docs-mediawiki-import.in link-refs.json
> pve-docs-mediawiki-import.tmp
86 chmod
+x pve-docs-mediawiki-import.tmp
87 mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import
91 pve-admin-guide.epub \
92 chapter-index-table.adoc \
93 man1-index-table.adoc \
94 man5-index-table.adoc \
95 man8-index-table.adoc \
96 $(sort $(addsuffix .html
, $(MANUAL_PAGES
)) $(CHAPTER_LIST
))
98 ADOC_STDARG
=-b
$(shell pwd
)/asciidoc
/pve-html
-f asciidoc
/asciidoc-pve.conf
-a icons
-a data-uri
-a
"date=$(SOURCE_DATE_HUMAN)" -a
"revnumber=$(DOCRELEASE)" -a footer-style
=revdate
102 README.html
: README.adoc
103 asciidoc
-a toc
$(ADOC_STDARG
) -o
$@
$<
107 test -z
"$${PVE_DOC_INSTANTVIEW}" ||
$(BROWSER
) index.html
&
109 chapter-index-table.adoc
: asciidoc-pve
110 .
/asciidoc-pve chapter-table
>$@.tmp
113 man1-index-table.adoc
: asciidoc-pve
114 .
/asciidoc-pve man1page-table
>$@.tmp
117 man5-index-table.adoc
: asciidoc-pve
118 .
/asciidoc-pve man5page-table
>$@.tmp
121 man8-index-table.adoc
: asciidoc-pve
122 .
/asciidoc-pve man8page-table
>$@.tmp
125 index.html
: index.adoc
$(API_VIEWER_SOURCES
) $(INDEX_INCLUDES
)
126 asciidoc
$(ADOC_STDARG
) -o
$@ index.adoc
128 pve-admin-guide.html
: $(PVE_ADMIN_GUIDE_ADOCDEPENDS
)
129 asciidoc
-a pvelogo
$(ADOC_STDARG
) -o
$@ pve-admin-guide.adoc
131 pve-admin-guide.chunked
: $(PVE_ADMIN_GUIDE_ADOCDEPENDS
)
134 a2x
-D
$@.tmp
-a docinfo
-a docinfo1
-a icons
-f chunked pve-admin-guide.adoc
137 PVE_DOCBOOK_CONF
=-b
$(shell pwd
)/asciidoc
/pve-docbook
-f asciidoc
/asciidoc-pve.conf
138 PVE_DBLATEX_OPTS
='-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf'
140 YEAR
:=$(shell date
'+%Y')
141 pve-admin-guide-docinfo.xml
: pve-admin-guide-docinfo.xml.in
142 sed
-e
's/@RELEASE@/$(DOCRELEASE)/' -e
's/@YEAR@/$(YEAR)/' <$< >$@
144 pve-admin-guide.pdf
: $(PVE_ADMIN_GUIDE_ADOCDEPENDS
) docinfo.xml pve-admin-guide-docinfo.xml
145 rsvg-convert
-f pdf
-o proxmox-logo.pdf images
/proxmox-logo.svg
146 rsvg-convert
-f pdf
-o proxmox-ci-header.pdf images
/proxmox-ci-header.svg
147 grep
">Release $(DOCRELEASE)<" pve-admin-guide-docinfo.xml ||
(echo
"wrong release in pve-admin-guide-docinfo.xml" && false
);
148 a2x
-a docinfo
-a docinfo1
-f pdf
-L
--asciidoc-opts
="$(PVE_DOCBOOK_CONF)" --dblatex-opts
$(PVE_DBLATEX_OPTS
) pve-admin-guide.adoc
149 rm proxmox-logo.pdf proxmox-ci-header.pdf
151 pve-admin-guide.epub
: $(PVE_ADMIN_GUIDE_ADOCDEPENDS
)
154 a2x
-D
$@.tmp
-f epub
--asciidoc-opts
="$(PVE_DOCBOOK_CONF)" pve-admin-guide.adoc
157 api-viewer
/apidata.js
: extractapi.pl
160 api-viewer
/apidoc.js
: $(API_VIEWER_FILES
)
161 cat
$(API_VIEWER_FILES
) >$@.tmp
167 echo
"git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout $(GITVERSION)" > $@.tmp
/debian
/SOURCE
173 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
180 rm -f
$(GEN_DEB
) $(DOC_DEB
) $(MEDIAWIKI_DEB
)
184 $(MEDIAWIKI_DEB
) $(GEN_DEB
): $(DOC_DEB
)
185 $(DOC_DEB
): $(BUILDDIR
)
186 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
187 lintian
$(DOC_DEB
) $(GEN_DEB
) $(MEDIAWIKI_DEB
)
190 dinstall
: $(GEN_DEB
) $(DOC_DEB
) $(MEDIAWIKI_DEB
)
191 dpkg
-i
$(GEN_DEB
) $(DOC_DEB
) # $(MEDIAWIKI_DEB)
198 install: gen-install doc-install mediawiki-install
201 gen-install
: $(GEN_DEB_SOURCES
) asciidoc-pve asciidoc
/mediawiki.conf
202 install -dm755
$(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)
203 install -dm755
$(DESTDIR
)/usr
/share
/doc
/$(GEN_PACKAGE
)
204 install -dm755
$(DESTDIR
)/usr
/bin
206 install -m
0644 $(GEN_DEB_SOURCES
) $(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)
207 install -m
0755 $(GEN_SCRIPTS
) $(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)
208 # install asciidoc-pve
209 install -m
0755 asciidoc-pve
$(DESTDIR
)/usr
/bin
/
210 install -D
-m
0644 asciidoc
/mediawiki.conf
$(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)/asciidoc
/mediawiki.conf
211 install -m
0644 asciidoc
/asciidoc-pve.conf
$(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)/asciidoc
/
212 install -m
0644 asciidoc
/pve-html.conf
$(DESTDIR
)/usr
/share
/$(GEN_PACKAGE
)/asciidoc
/
215 doc-install
: index.html
$(WIKI_IMPORTS
) $(API_VIEWER_SOURCES
) verify-images examples
216 install -dm755
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)
217 install -dm755
$(DESTDIR
)/usr
/share
/doc
/$(DOC_PACKAGE
)
218 # install files for pvedocs package
219 install -dm755
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)
220 install -dm755
$(DESTDIR
)/usr
/share
/doc
/$(DOC_PACKAGE
)
221 install -dm755
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/examples
/
222 install -m
755 examples
/guest-example-hookscript.pl
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/examples
/
223 install -m
0644 index.html
$(INDEX_INCLUDES
) $(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)
224 install -m
0644 $(WIKI_IMPORTS
) $(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)
226 make
-C images
install
227 # install screenshot images
228 install -dm755
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/images
/screenshot
229 install -m
0644 images
/screenshot
/*.png
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/images
/screenshot
230 # install api doc viewer
231 install -dm755
$(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/api-viewer
232 install -m
0644 $(API_VIEWER_SOURCES
) $(DESTDIR
)/usr
/share
/$(DOC_PACKAGE
)/api-viewer
234 .PHONY
: mediawiki-install
235 mediawiki-install
: pve-docs-mediawiki-import
236 install -dm755
$(DESTDIR
)/usr
/share
/$(MEDIAWIKI_PACKAGE
)
237 install -dm755
$(DESTDIR
)/usr
/share
/doc
/$(MEDIAWIKI_PACKAGE
)
238 install -dm755
$(DESTDIR
)/usr
/bin
239 install -dm755
$(DESTDIR
)/usr
/share
/$(MEDIAWIKI_PACKAGE
)
240 install -dm755
$(DESTDIR
)/usr
/share
/doc
/$(MEDIAWIKI_PACKAGE
)
241 install -m
0755 pve-docs-mediawiki-import
$(DESTDIR
)/usr
/bin
/
244 upload
: $(GEN_DEB
) $(DOC_DEB
) $(MEDIAWIKI_DEB
)
245 tar cf
- $(GEN_DEB
) $(DOC_DEB
) $(MEDIAWIKI_DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
--dist bullseye
249 make
clean clean-static
253 .PHONY
: update-static
256 make
$(filter %-synopsis.adoc
%-opts.adoc
, $(PVE_ADMIN_GUIDE_ADOCDEPENDS
)) pve-firewall-macros.adoc api-viewer
/apidata.js
260 find .
-regex
'.*-\(opts\|synopsis\)\.adoc' -not
-name pmxcfs
.8-synopsis.adoc
-not
-name qmeventd
.8-synopsis.adoc
-exec
rm -f \
{\
} \
;
261 rm -f api-viewer
/apidata.js
262 rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc
265 rm -rf
*.html
*.pdf
*.epub
*.tmp
*.1 *.5 *.8
266 rm -f
*.deb
*.dsc
*.
tar.
* *.changes
*.buildinfo
*.build
267 rm -f api-viewer
/apidoc.js chapter-
*.html
*-plain.html chapter-
*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_
* pve-docs-mediawiki-import
268 rm -rf .pve-doc-depends
269 rm -f pve-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pve-admin-guide-docinfo.xml
270 rm -rf
$(DEB_SOURCE
)-[0-9]*/