include ./pve-doc-generator.mk
-PACKAGE=pve-doc-generator
+GEN_PACKAGE=pve-doc-generator
+DOC_PACKAGE=pve-docs
# also update debian/changelog
-PKGREL=1
+GEN_PKGREL=1
+# also update doc-debian/changelog
+DOC_PKGREL=2
GITVERSION:=$(shell cat .git/refs/heads/master)
-DEB=${PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb
+GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${GEN_PKGREL}_amd64.deb
+DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${DOC_PKGREL}_all.deb
+
+CHAPTER_LIST= \
+ sysadmin \
+ pvecm \
+ pmxcfs \
+ pvesm \
+ qm \
+ pve-firewall \
+ pveum \
+ pct \
+ ha-manager \
+ vzdump \
+ pve-faq \
+ pve-bibliography
+
COMMAND_LIST= \
pvesubscription \
CONFIG_LIST=datacenter.cfg qm.conf pct.conf
-DEB_SOURCES= \
+GEN_DEB_SOURCES= \
pve-doc-generator.mk \
attributes.txt \
$(addsuffix .adoc, ${COMMAND_LIST}) \
system-software-updates.adoc \
sysadmin.adoc
+API_VIEWER_SOURCES= \
+ api-viewer/index.html \
+ api-viewer/apidoc.js
+
PVE_ADMIN_GUIDE_SOURCES= \
${DATACENTER_CONF_MAN5_SOURCES} \
${QM_CONF_MAN5_SOURCES} \
BROWSER?=xdg-open
-all: pve-admin-guide.html
+all: index.html
%-nwdiag.svg: %.nwdiag
nwdiag -T svg $*.nwdiag -o $@;
+chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
+ asciidoc ${ADOC_STDARG} -o $@ $*.adoc
+ test -n "$${NOVIEW}" || $(BROWSER) $@ &
+
%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
test -n "$${NOVIEW}" || $(BROWSER) $@ &
asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
test -n "$${NOVIEW}" || $(BROWSER) $@ &
-index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
+.PHONY: index
+index: index.html
+ test -n "$${NOVIEW}" || $(BROWSER) index.html &
+
+index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} ${API_VIEWER_SOURCES}
$(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
$(MAKE) NOVIEW=1 $(addsuffix .1.html, ${COMMAND_LIST}) $(addsuffix .8.html, ${SERVICE_LIST}) $(addsuffix .5.html, ${CONFIG_LIST})
+ $(MAKE) NOVIEW=1 $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST}))
asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
- test -n "$${NOVIEW}" || $(BROWSER) index.html &
pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
test -n "$${NOVIEW}" || $(BROWSER) $@ &
+pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_SOURCES}
+ rm -rf pve-admin-guide.chunked
+ a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc
+ test -n "$${NOVIEW}" || $(BROWSER) $@/index.html &
+
pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
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
a2x -f epub pve-admin-guide.adoc
test -n "$${NOVIEW}" || $(BROWSER) $@ &
+api-viewer/apidata.js: extractapi.pl
+ ./extractapi.pl >$@
+
+api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js
+ cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@
+
.PHONY: dinstall
-dinstall: ${DEB}
- dpkg -i ${DEB}
+dinstall: ${GEN_DEB} ${DOC_DEB}
+ dpkg -i ${GEN_DEB} ${DOC_DEB}
+
.PHONY: deb
-${DEB} deb: ${DEB_SOURCES}
+deb:
+ rm -f ${GEN_DEB} ${DOC_DEB};
+ make ${GEN_DEB};
+ make ${DOC_DEB};
+
+DOC_DEB_FILES= \
+ $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST})) \
+ $(addsuffix .1.html, ${COMMAND_LIST}) \
+ $(addsuffix .8.html, ${SERVICE_LIST}) \
+ $(addsuffix .5.html, ${CONFIG_LIST}) \
+ pve-admin-guide.pdf \
+ pve-admin-guide.html \
+ pve-admin-guide.epub \
+ index.html
+
+${DOC_DEB}: index.html
+ rm -rf build
+ mkdir build
+ rsync -a doc-debian/ build/debian
+ mkdir -p build/usr/share/${DOC_PACKAGE}
+ mkdir -p build/usr/share/doc/${DOC_PACKAGE}
+ echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${DOC_PACKAGE}/SOURCE
+ # install doc files
+ install -m 0644 ${DOC_DEB_FILES} build/usr/share/${DOC_PACKAGE}
+ # install api doc viewer
+ mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
+ install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
+ cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+ lintian ${DOC_DEB}
+
+${GEN_DEB}: ${GEN_DEB_SOURCES}
rm -rf build
mkdir build
rsync -a debian/ build/debian
- mkdir -p build/usr/share/${PACKAGE}
- mkdir -p build/usr/share/doc/${PACKAGE}
- echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${PACKAGE}/SOURCE
- install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
- install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
+ mkdir -p build/usr/share/${GEN_PACKAGE}
+ mkdir -p build/usr/share/doc/${GEN_PACKAGE}
+ echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${GEN_PACKAGE}/SOURCE
+ install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
+ install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
cd build; dpkg-buildpackage -rfakeroot -b -us -uc
- lintian ${DEB}
+ lintian ${GEN_DEB}
.PHONY: upload
-upload: ${DEB}
+upload: ${GEN_DEB} ${DOC_DEB}
umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
mkdir -p /pve/${DOCRELEASE}/extra
- rm -f /pve/${DOCRELEASE}/extra/${PACKAGE}_*.deb
+ rm -f /pve/${DOCRELEASE}/extra/${GEN_PACKAGE}_*.deb
+ rm -f /pve/${DOCRELEASE}/extra/${DOC_PACKAGE}_*.deb
rm -f /pve/${DOCRELEASE}/extra/Packages*
- cp ${DEB} /pve/${DOCRELEASE}/extra
+ cp ${GEN_DEB} ${DOC_DEB} /pve/${DOCRELEASE}/extra
cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
+.PHONY: update
update: clean
- rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
+ rm -f *.5-opts.adoc *.1-synopsis.adoc *.8-synopsis.adoc
+ rm -f api-viewer/apidata.js
+ rm -f pve-firewall-macros.adoc
make all
clean:
- rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
-
+ rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html pve-admin-guide.chunked
+ find . -name '*~' -exec rm {} ';'