1 include /usr
/share
/dpkg
/pkg-info.mk
4 ASCIIDOC_PMG
=.
/asciidoc-pmg
6 GEN_PACKAGE
=pmg-doc-generator
8 WEB_PACKAGE
=pmg-docs-apache
10 # also update debian/changelog
13 GITVERSION
:=$(shell git rev-parse HEAD
)
15 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
17 GEN_DEB
=${GEN_PACKAGE}_
${DEB_VERSION_UPSTREAM_REVISION}_
${ARCH}.deb
18 DOC_DEB
=${DOC_PACKAGE}_
${DEB_VERSION_UPSTREAM_REVISION}_all.deb
19 WEB_DEB
=${WEB_PACKAGE}_
${DEB_VERSION_UPSTREAM_REVISION}_all.deb
21 export SOURCE_DATE_EPOCH ?
= $(shell dpkg-parsechangelog
-STimestamp
)
22 SOURCE_DATE_HUMAN
:= $(shell date
-d
"@${SOURCE_DATE_EPOCH}")
28 verify-images
: png-verify.pl
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 .pmg-doc-depends link-refs.json
: ${ADOC_SOURCES_GUESS} scan-adoc-refs
33 .
/scan-adoc-refs
*.adoc
--depends .pmg-doc-depends.tmp
> link-refs.json.tmp
34 @cmp
--quiet .pmg-doc-depends .pmg-doc-depends.tmp || mv .pmg-doc-depends.tmp .pmg-doc-depends
35 @cmp
--quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
37 pmg-doc-generator.mk
: .pmg-doc-depends pmg-doc-generator.mk.in
38 cat pmg-doc-generator.mk.in .pmg-doc-depends
> $@.tmp
39 sed
-i
"s/@RELEASE@$$/${DEB_VERSION_UPSTREAM}/" $@.tmp
42 -include .
/pmg-doc-generator.mk
45 pmg-doc-generator.mk \
50 gen-cluster.conf
.5-opts.pl \
51 gen-fetchmail.conf
.5-opts.pl \
52 gen-ldap.conf
.5-opts.pl \
53 gen-pmg.conf
.5-opts.pl \
54 gen-user.conf
.5-opts.pl
57 api-viewer
/apidata.js \
58 api-viewer
/PMGAPI.js \
59 /usr
/share
/javascript
/proxmox-widget-toolkit-dev
/APIViewer.js
62 api-viewer
/index.html \
65 asciidoc-pmg
: asciidoc-pmg.in link-refs.json
66 cat asciidoc-pmg.in link-refs.json
>asciidoc-pmg.tmp
67 sed
-e s
/@RELEASE@
/${DOCRELEASE}/ -i asciidoc-pmg.tmp
68 chmod
+x asciidoc-pmg.tmp
69 mv asciidoc-pmg.tmp asciidoc-pmg
73 pmg-admin-guide.epub \
74 chapter-index-table.adoc \
75 man1-index-table.adoc \
76 man5-index-table.adoc \
77 man8-index-table.adoc \
78 $(sort $(addsuffix .html
, ${MANUAL_PAGES}) ${CHAPTER_LIST})
80 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}"
85 README.html
: README.adoc
86 asciidoc
-a toc
${ADOC_STDARG} -o
$@
$<
90 $(BROWSER
) index.html
&
92 chapter-index-table.adoc
: asciidoc-pmg
93 .
/asciidoc-pmg chapter-table
>$@.tmp
96 man1-index-table.adoc
: asciidoc-pmg
97 .
/asciidoc-pmg man1page-table
>$@.tmp
100 man5-index-table.adoc
: asciidoc-pmg
101 .
/asciidoc-pmg man5page-table
>$@.tmp
104 man8-index-table.adoc
: asciidoc-pmg
105 .
/asciidoc-pmg man8page-table
>$@.tmp
108 index.html
: index.adoc
${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
109 asciidoc
${ADOC_STDARG} -o
$@ index.adoc
111 pmg-admin-guide.html
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
112 asciidoc
-a pmglogo
${ADOC_STDARG} -o
$@ pmg-admin-guide.adoc
114 pmg-admin-guide.chunked
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
117 a2x
-D
$@.tmp
-a docinfo
-a docinfo1
-a icons
-f chunked pmg-admin-guide.adoc
120 PMG_DOCBOOK_CONF
=-b
$(shell pwd
)/asciidoc
/pmg-docbook
-f asciidoc
/asciidoc-pmg.conf
121 PMG_DBLATEX_OPTS
='-p ./asciidoc/pmg-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf'
123 YEAR
:=$(shell date
"+%Y")
125 pmg-admin-guide-docinfo.xml
: pmg-admin-guide-docinfo.xml.in
126 sed
-e
's/@RELEASE@/${DOCRELEASE}/' -e
's/@YEAR@/${YEAR}/' <$< >$@
128 pmg-copyright.adoc
: pmg-copyright.adoc.in
129 sed
-e
's/@YEAR@/${YEAR}/' <$< >$@
131 pmg-admin-guide.pdf
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pmg-admin-guide-docinfo.xml
132 rsvg-convert
-f pdf
-o proxmox-logo.pdf images
/proxmox-logo.svg
133 rsvg-convert
-f pdf
-o proxmox-ci-header.pdf images
/proxmox-ci-header.svg
134 grep
">Release ${DOCRELEASE}<" pmg-admin-guide-docinfo.xml ||
(echo
"wrong release in pmg-admin-guide-docinfo.xml" && false
);
135 a2x
-a docinfo
-a docinfo1
-f pdf
-L
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" --dblatex-opts
${PMG_DBLATEX_OPTS} pmg-admin-guide.adoc
136 rm proxmox-logo.pdf proxmox-ci-header.pdf
138 pmg-admin-guide.epub
: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
141 a2x
-D
$@.tmp
-f epub
--asciidoc-opts
="${PMG_DOCBOOK_CONF}" pmg-admin-guide.adoc
144 api-viewer
/apidata.js
: extractapi.pl
147 api-viewer
/apidoc.js
: ${API_VIEWER_FILES}
148 cat
${API_VIEWER_FILES} >$@.tmp
152 dinstall
: ${GEN_DEB} ${DOC_DEB}
153 dpkg
-i
${GEN_DEB} ${DOC_DEB}
158 ${WEB_DEB} ${GEN_DEB}: ${DOC_DEB}
161 rm -f
${GEN_DEB} ${DOC_DEB}
164 echo
"git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout ${GITVERSION}" > build
/debian
/SOURCE
165 cd build
; dpkg-buildpackage
-b
-us
-uc
166 lintian
$(DOC_DEB
) $(GEN_DEB
) $(WEB_DEB
)
173 install: gen-install doc-install
176 gen-install
: $(GEN_DEB_SOURCES
) asciidoc-pmg
177 install -dm755
${DESTDIR}/usr
/bin
178 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
180 install -m
0644 ${GEN_DEB_SOURCES} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
181 install -m
0755 ${GEN_SCRIPTS} $(DESTDIR
)/usr
/share
/${GEN_PACKAGE}
182 # install asciidoc-pmg
183 install -m
0755 asciidoc-pmg
$(DESTDIR
)/usr
/bin
/
184 install -dm755
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
185 install -m
0644 asciidoc
/asciidoc-pmg.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
186 install -m
0644 asciidoc
/pmg-html.conf
$(DESTDIR
)/usr
/share
/${GEN_PACKAGE}/asciidoc
/
189 doc-install
: index.html
$(API_VIEWER_SOURCES
) verify-images
190 # install files for pmgdocs package
191 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
192 install -dm755
$(DESTDIR
)/usr
/share
/doc
/${DOC_PACKAGE}
193 install -m
0644 index.html
${INDEX_INCLUDES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}
194 # install screenshot images
195 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
196 install -m
0644 images
/screenshot
/*.png
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/images
/screenshot
197 # install api doc viewer
198 install -dm755
$(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
199 install -m
0644 ${API_VIEWER_SOURCES} $(DESTDIR
)/usr
/share
/${DOC_PACKAGE}/api-viewer
202 upload
: ${WEB_DEB} ${GEN_DEB} ${DOC_DEB}
203 tar cf
- ${WEB_DEB} ${GEN_DEB} ${DOC_DEB} | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist stretch
207 find .
-regex
'.*-\(opts\|synopsis\)\.adoc' -exec
rm -f \
{\
} \
;
208 rm -f api-viewer
/apidata.js
212 find .
-name
'*~' -exec
rm {} ';'
213 rm -rf
*.html
*.pdf
*.epub
*.tmp
*.1 *.5 *.8
214 rm -f
*.deb
*.changes
*.buildinfo
215 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
216 rm -rf .pmg-doc-depends
217 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