2 ASCIIDOC_PMG
=.
/asciidoc-pmg
4 GEN_PACKAGE
=pmg-doc-generator
6 WEB_PACKAGE
=pmg-docs-apache
8 # also update debian/changelog
11 GITVERSION
:=$(shell git rev-parse HEAD
)
13 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
15 GEN_DEB
=${GEN_PACKAGE}_
${DOCRELEASE}-${PKGREL}_
${ARCH}.deb
16 DOC_DEB
=${DOC_PACKAGE}_
${DOCRELEASE}-${PKGREL}_all.deb
17 WEB_DEB
=${WEB_PACKAGE}_
${DOCRELEASE}-${PKGREL}_all.deb
19 export SOURCE_DATE_EPOCH ?
= $(shell dpkg-parsechangelog
-STimestamp
)
20 SOURCE_DATE_HUMAN
:= $(shell date
-d
"@${SOURCE_DATE_EPOCH}")
26 verify-images
: png-verify.pl
27 for i in .
/images
/screenshot
/*.png
; do .
/png-verify.pl
$$i; done
29 ADOC_SOURCES_GUESS
=$(filter-out %-synopsis.adoc
%-opts.adoc
%-table.adoc
, $(wildcard *.adoc
))
30 .pmg-doc-depends link-refs.json
: ${ADOC_SOURCES_GUESS} scan-adoc-refs
31 .
/scan-adoc-refs
*.adoc
--depends .pmg-doc-depends.tmp
> link-refs.json.tmp
32 @cmp
--quiet .pmg-doc-depends .pmg-doc-depends.tmp || mv .pmg-doc-depends.tmp .pmg-doc-depends
33 @cmp
--quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
35 pmg-doc-generator.mk
: .pmg-doc-depends pmg-doc-generator.mk.in
36 cat pmg-doc-generator.mk.in .pmg-doc-depends
> $@.tmp
39 -include .
/pmg-doc-generator.mk
42 pmg-doc-generator.mk \
47 gen-cluster.conf
.5-opts.pl \
48 gen-fetchmail.conf
.5-opts.pl \
49 gen-ldap.conf
.5-opts.pl \
50 gen-pmg.conf
.5-opts.pl \
51 gen-user.conf
.5-opts.pl
54 api-viewer
/index.html \
57 asciidoc-pmg
: asciidoc-pmg.in link-refs.json
58 cat asciidoc-pmg.in link-refs.json
>asciidoc-pmg.tmp
59 sed
-e s
/@RELEASE@
/${DOCRELEASE}/ -i asciidoc-pmg.tmp
60 chmod
+x asciidoc-pmg.tmp
61 mv asciidoc-pmg.tmp asciidoc-pmg
65 pmg-admin-guide.epub \
66 chapter-index-table.adoc \
67 man1-index-table.adoc \
68 man5-index-table.adoc \
69 man8-index-table.adoc \
70 $(sort $(addsuffix .html
, ${MANUAL_PAGES}) ${CHAPTER_LIST})
72 ADOC_STDARG
=-b
$(shell pwd
)/asciidoc
/pmg-html
-f asciidoc
/asciidoc-pmg.conf
-a icons
-a data-uri
-a
"date=${SOURCE_DATE_HUMAN}" -a
"revnumber=${DOCRELEASE}"
77 README.html
: README.adoc
78 asciidoc
-a toc
${ADOC_STDARG} -o
$@
$<
82 $(BROWSER
) index.html
&
84 chapter-index-table.adoc
: asciidoc-pmg
85 .
/asciidoc-pmg chapter-table
>$@.tmp
88 man1-index-table.adoc
: asciidoc-pmg
89 .
/asciidoc-pmg man1page-table
>$@.tmp
92 man5-index-table.adoc
: asciidoc-pmg
93 .
/asciidoc-pmg man5page-table
>$@.tmp
96 man8-index-table.adoc
: asciidoc-pmg
97 .
/asciidoc-pmg man8page-table
>$@.tmp
100 index.html
: index.adoc
${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
101 asciidoc
${ADOC_STDARG} -o
$@ index.adoc
103 pmg-admin-guide.html
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
104 asciidoc
-a pmglogo
${ADOC_STDARG} -o
$@ pmg-admin-guide.adoc
106 pmg-admin-guide.chunked
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
109 a2x
-D
$@.tmp
-a docinfo
-a docinfo1
-a icons
-f chunked pmg-admin-guide.adoc
112 PMG_DOCBOOK_CONF
=-b
$(shell pwd
)/asciidoc
/pmg-docbook
-f asciidoc
/asciidoc-pmg.conf
113 PMG_DBLATEX_OPTS
='-p ./asciidoc/pmg-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf'
115 YEAR
:=$(shell date
"+%Y")
117 pmg-admin-guide-docinfo.xml
: pmg-admin-guide-docinfo.xml.in
118 sed
-e
's/@RELEASE@/${DOCRELEASE}/' -e
's/@YEAR@/${YEAR}/' <$< >$@
120 pmg-copyright.adoc
: pmg-copyright.adoc.in
121 sed
-e
's/@YEAR@/${YEAR}/' <$< >$@
123 pmg-admin-guide.pdf
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pmg-admin-guide-docinfo.xml
124 rsvg-convert
-f pdf
-o proxmox-logo.pdf images
/proxmox-logo.svg
125 rsvg-convert
-f pdf
-o proxmox-ci-header.pdf images
/proxmox-ci-header.svg
126 grep
">Release ${DOCRELEASE}<" pmg-admin-guide-docinfo.xml ||
(echo
"wrong release in pmg-admin-guide-docinfo.xml" && false
);
127 a2x
-a docinfo
-a docinfo1
-f pdf
-L
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" --dblatex-opts
${PMG_DBLATEX_OPTS} pmg-admin-guide.adoc
128 rm proxmox-logo.pdf proxmox-ci-header.pdf
130 pmg-admin-guide.epub
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
133 a2x
-D
$@.tmp
-f epub
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" pmg-admin-guide.adoc
136 api-viewer
/apidata.js
: extractapi.pl
139 api-viewer
/apidoc.js
: api-viewer
/apidata.js api-viewer
/PMGAPI.js
140 cat api-viewer
/apidata.js api-viewer
/PMGAPI.js
>$@
143 dinstall
: ${GEN_DEB} ${DOC_DEB}
144 dpkg
-i
${GEN_DEB} ${DOC_DEB}
149 ${WEB_DEB} ${GEN_DEB}: ${DOC_DEB}
152 rm -f
${GEN_DEB} ${DOC_DEB}
155 echo
"git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout ${GITVERSION}" > build
/debian
/SOURCE
156 cd build
; dpkg-buildpackage
-b
-us
-uc
157 lintian
$(DOC_DEB
) $(GEN_DEB
) $(WEB_DEB
)
164 install: gen-install doc-install
167 gen-install
: $(GEN_DEB_SOURCES
) asciidoc-pmg
168 install -dm755
${DESTDIR}/usr
/bin
169 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
171 install -m
0644 ${GEN_DEB_SOURCES} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
172 install -m
0755 ${GEN_SCRIPTS} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
173 # install asciidoc-pmg
174 install -m
0755 asciidoc-pmg
$(DESTDIR
)/usr
/bin
/
175 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
176 install -m
0644 asciidoc
/asciidoc-pmg.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
177 install -m
0644 asciidoc
/pmg-html.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
180 doc-install
: index.html
$(API_VIEWER_SOURCES
) verify-images
181 # install files for pmgdocs package
182 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
183 install -dm755
$(DESTDIR
)/usr
/share
/doc
/${DOC_PACKAGE}
184 install -m
0644 index.html
${INDEX_INCLUDES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
185 # install screenshot images
186 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
187 install -m
0644 images
/screenshot
/*.png
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
188 # install api doc viewer
189 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
190 install -m
0644 ${API_VIEWER_SOURCES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
193 upload
: ${WEB_DEB} ${GEN_DEB} ${DOC_DEB}
194 tar cf
- ${WEB_DEB} ${GEN_DEB} ${DOC_DEB} | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist stretch
198 find .
-regex
'.*-\(opts\|synopsis\)\.adoc' -exec
rm -f \
{\
} \
;
199 rm -f api-viewer
/apidata.js
203 find .
-name
'*~' -exec
rm {} ';'
204 rm -rf
*.html
*.pdf
*.epub
*.tmp
*.1 *.5 *.8
205 rm -f
*.deb
*.changes
*.buildinfo
206 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
207 rm -rf .pmg-doc-depends
208 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 pmg-copyright.adoc