2 ASCIIDOC_PMG
=.
/asciidoc-pmg
4 GEN_PACKAGE
=pmg-doc-generator
7 # also update debian/changelog
10 GITVERSION
:=$(shell git rev-parse HEAD
)
12 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
14 GEN_DEB
=${GEN_PACKAGE}_
${DOCRELEASE}-${PKGREL}_
${ARCH}.deb
15 DOC_DEB
=${DOC_PACKAGE}_
${DOCRELEASE}-${PKGREL}_all.deb
21 verify-images
: png-verify.pl
22 for i in .
/images
/screenshot
/*.png
; do .
/png-verify.pl
$$i; done
24 ADOC_SOURCES_GUESS
=$(filter-out %-synopsis.adoc
%-opts.adoc
%-table.adoc
, $(wildcard *.adoc
))
25 .pmg-doc-depends link-refs.json
: ${ADOC_SOURCES_GUESS} scan-adoc-refs
26 .
/scan-adoc-refs
*.adoc
--depends .pmg-doc-depends.tmp
> link-refs.json.tmp
27 @cmp
--quiet .pmg-doc-depends .pmg-doc-depends.tmp || mv .pmg-doc-depends.tmp .pmg-doc-depends
28 @cmp
--quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
30 pmg-doc-generator.mk
: .pmg-doc-depends pmg-doc-generator.mk.in
31 cat pmg-doc-generator.mk.in .pmg-doc-depends
> $@.tmp
34 -include .
/pmg-doc-generator.mk
37 pmg-doc-generator.mk \
42 gen-cluster.conf
.5-opts.pl \
43 gen-fetchmail.conf
.5-opts.pl \
44 gen-ldap.conf
.5-opts.pl \
45 gen-pmg.conf
.5-opts.pl \
46 gen-user.conf
.5-opts.pl
49 api-viewer
/index.html \
52 asciidoc-pmg
: asciidoc-pmg.in link-refs.json
53 cat asciidoc-pmg.in link-refs.json
>asciidoc-pmg.tmp
54 sed
-e s
/@RELEASE@
/${DOCRELEASE}/ -i asciidoc-pmg.tmp
55 chmod
+x asciidoc-pmg.tmp
56 mv asciidoc-pmg.tmp asciidoc-pmg
60 pmg-admin-guide.epub \
61 chapter-index-table.adoc \
62 man1-index-table.adoc \
63 man5-index-table.adoc \
64 man8-index-table.adoc \
65 $(sort $(addsuffix .html
, ${MANUAL_PAGES}) ${CHAPTER_LIST})
67 ADOC_STDARG
=-b
$(shell pwd
)/asciidoc
/pmg-html
-f asciidoc
/asciidoc-pmg.conf
-a icons
-a data-uri
-a
"date=$(shell date)" -a
"revnumber=${DOCRELEASE}"
72 README.html
: README.adoc
73 asciidoc
-a toc
${ADOC_STDARG} -o
$@
$<
77 $(BROWSER
) index.html
&
79 chapter-index-table.adoc
: asciidoc-pmg
80 .
/asciidoc-pmg chapter-table
>$@.tmp
83 man1-index-table.adoc
: asciidoc-pmg
84 .
/asciidoc-pmg man1page-table
>$@.tmp
87 man5-index-table.adoc
: asciidoc-pmg
88 .
/asciidoc-pmg man5page-table
>$@.tmp
91 man8-index-table.adoc
: asciidoc-pmg
92 .
/asciidoc-pmg man8page-table
>$@.tmp
95 index.html
: index.adoc
${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
96 asciidoc
${ADOC_STDARG} -o
$@ index.adoc
98 pmg-admin-guide.html
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
99 asciidoc
-a pmglogo
${ADOC_STDARG} -o
$@ pmg-admin-guide.adoc
101 pmg-admin-guide.chunked
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
104 a2x
-D
$@.tmp
-a docinfo
-a docinfo1
-a icons
-f chunked pmg-admin-guide.adoc
107 PMG_DOCBOOK_CONF
=-b
$(shell pwd
)/asciidoc
/pmg-docbook
-f asciidoc
/asciidoc-pmg.conf
108 PMG_DBLATEX_OPTS
='-p ./asciidoc/pmg-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf'
110 pmg-admin-guide-docinfo.xml
: pmg-admin-guide-docinfo.xml.in
111 sed
-e
's/@RELEASE@/${DOCRELEASE}/' <$< >$@
113 pmg-admin-guide.pdf
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pmg-admin-guide-docinfo.xml
114 rsvg-convert
-f pdf
-o proxmox-logo.pdf images
/proxmox-logo.svg
115 rsvg-convert
-f pdf
-o proxmox-ci-header.pdf images
/proxmox-ci-header.svg
116 grep
">Release ${DOCRELEASE}<" pmg-admin-guide-docinfo.xml ||
(echo
"wrong release in pmg-admin-guide-docinfo.xml" && false
);
117 a2x
-a docinfo
-a docinfo1
-f pdf
-L
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" --dblatex-opts
${PMG_DBLATEX_OPTS} pmg-admin-guide.adoc
118 rm proxmox-logo.pdf proxmox-ci-header.pdf
120 pmg-admin-guide.epub
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
123 a2x
-D
$@.tmp
-f epub
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" pmg-admin-guide.adoc
126 api-viewer
/apidata.js
: extractapi.pl
129 api-viewer
/apidoc.js
: api-viewer
/apidata.js api-viewer
/PMGAPI.js
130 cat api-viewer
/apidata.js api-viewer
/PMGAPI.js
>$@
133 dinstall
: ${GEN_DEB} ${DOC_DEB}
134 dpkg
-i
${GEN_DEB} ${DOC_DEB}
139 ${GEN_DEB}: ${DOC_DEB}
142 rm -f
${GEN_DEB} ${DOC_DEB}
145 echo
"git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout ${GITVERSION}" > build
/debian
/SOURCE
146 cd build
; dpkg-buildpackage
-b
-us
-uc
147 lintian
$(DOC_DEB
) $(GEN_DEB
)
154 install: gen-install doc-install
157 gen-install
: $(GEN_DEB_SOURCES
) asciidoc-pmg
158 install -dm755
${DESTDIR}/usr
/bin
159 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
161 install -m
0644 ${GEN_DEB_SOURCES} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
162 install -m
0755 ${GEN_SCRIPTS} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
163 # install asciidoc-pmg
164 install -m
0755 asciidoc-pmg
$(DESTDIR
)/usr
/bin
/
165 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
166 install -m
0644 asciidoc
/asciidoc-pmg.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
167 install -m
0644 asciidoc
/pmg-html.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
170 doc-install
: index.html
$(API_VIEWER_SOURCES
) verify-images
171 # install files for pmgdocs package
172 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
173 install -dm755
$(DESTDIR
)/usr
/share
/doc
/${DOC_PACKAGE}
174 install -m
0644 index.html
${INDEX_INCLUDES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
175 # install screenshot images
176 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
177 install -m
0644 images
/screenshot
/*.png
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
178 # install api doc viewer
179 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
180 install -m
0644 ${API_VIEWER_SOURCES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
183 upload
: ${GEN_DEB} ${DOC_DEB}
184 tar cf
- ${GEN_DEB} ${DOC_DEB} | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist stretch
188 find .
-regex
'.*-\(opts\|synopsis\)\.adoc' -exec
rm -f \
{\
} \
;
189 rm -f api-viewer
/apidata.js
193 find .
-name
'*~' -exec
rm {} ';'
194 rm -rf
*.html
*.pdf
*.epub
*.tmp
*.1 *.5 *.8
195 rm -f
*.deb
*.changes
*.buildinfo
196 rm -f api-viewer
/apidoc.js chapter-
*.html
*-plain.html chapter-
*.html pmg-admin-guide.chunked asciidoc-pmg link-refs.json .asciidoc-pmg-tmp_
* pmg-smtp-filter
.8-synopsis.adoc pmgpolicy
.8-synopsis.adoc pmgsh
.1-synopsis.adoc
197 rm -rf .pmg-doc-depends
198 rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml