X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=Makefile;h=206a29e432223155cdc9dc40ff8957a1af55d1b9;hp=2a1ffddcac6c052d81d14f1881197e49bf37a0b3;hb=ceb4ea5b6133e92d4fda86447f54b2d3961f2eb7;hpb=356064f40dacbe57c9c662ae75ed7ec065bca7c4 diff --git a/Makefile b/Makefile index 2a1ffdd..206a29e 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,38 @@ GEN_PACKAGE=pve-doc-generator DOC_PACKAGE=pve-docs # also update debian/changelog -PKGREL=1 +PKGREL=5 GITVERSION:=$(shell cat .git/refs/heads/master) GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb +CHAPTER_LIST= \ + sysadmin \ + pvecm \ + pmxcfs \ + pvesm \ + qm \ + pve-firewall \ + pveum \ + pct \ + ha-manager \ + vzdump \ + pve-faq \ + pve-bibliography + +STORAGE_TYPES= \ + dir \ + glusterfs \ + iscsi \ + iscsidirect \ + lvm \ + lvmthin \ + nfs \ + rbd \ + zfspool + COMMAND_LIST= \ pvesubscription \ pvecm \ @@ -59,6 +84,8 @@ GEN_DEB_SOURCES= \ GEN_SCRIPTS= \ gen-datacenter.cfg.5-opts.pl \ gen-pct.conf.5-opts.pl \ + gen-pct-network-opts.pl \ + gen-pct-mountpoint-opts.pl \ gen-qm.conf.5-opts.pl \ gen-vzdump.conf.5-opts.pl \ gen-pve-firewall-cluster-opts.pl \ @@ -106,8 +133,6 @@ PVE_ADMIN_GUIDE_SOURCES= \ ${PVEAM_MAN1_SOURCES} \ ${PVESUBSCRIPTION_MAN1_SOURCES} \ ${PVECEPH_MAN1_SOURCES} \ - images/cluster-nwdiag.svg \ - images/node-nwdiag.svg \ pve-bibliography.adoc \ $(addsuffix .adoc, ${COMMAND_LIST}) \ $(addsuffix .adoc, ${SERVICE_LIST}) \ @@ -115,53 +140,76 @@ PVE_ADMIN_GUIDE_SOURCES= \ GFDL.adoc \ attributes.txt -ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}" -ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}" -ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}" +WIKI_IMPORTS= \ + $(addsuffix -plain.html, $(addprefix chapter-, ${CHAPTER_LIST}))\ + $(addsuffix .5-plain.html, ${CONFIG_LIST}) \ + $(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES})) + +INDEX_INCLUDES= \ + pve-admin-guide.pdf \ + pve-admin-guide.html \ + pve-admin-guide.epub \ + $(addsuffix .1.html, ${COMMAND_LIST}) \ + $(addsuffix .8.html, ${SERVICE_LIST}) \ + $(addsuffix .5.html, ${CONFIG_LIST}) \ + $(addsuffix .html, $(addprefix chapter-, ${CHAPTER_LIST})) + +ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" +ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} +ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} +ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} 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} -a toc -o $@ $*.adoc + +chapter-%-plain.html: %.adoc ${PVE_COMMON_DOC_SOURCES} + asciidoc -s -a wiki ${ADOC_STDARG} -o $@ $*.adoc + +pve-storage-%-plain.html: pve-storage-%.adoc ${PVE_COMMON_DOC_SOURCES} + asciidoc -s -a wiki -a 'leveloffset=-1' ${ADOC_STDARG} -o $@ pve-storage-$*.adoc + %.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES} asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc - test -n "$${NOVIEW}" || $(BROWSER) $@ & - pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES} asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ pmxcfs.adoc - test -n "$${NOVIEW}" || $(BROWSER) $@ & %.8.html: %.adoc %.8-synopsis.adoc ${PVE_COMMON_DOC_SOURCES} asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc - test -n "$${NOVIEW}" || $(BROWSER) $@ & %.5.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES} asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc - test -n "$${NOVIEW}" || $(BROWSER) $@ & -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}) +%.5-plain.html: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES} + asciidoc -s ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc + +.PHONY: index +index: index.html + $(BROWSER) index.html & + +index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES} 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 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 - test -n "$${NOVIEW}" || $(BROWSER) $@ & pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES} a2x -f epub pve-admin-guide.adoc - test -n "$${NOVIEW}" || $(BROWSER) $@ & api-viewer/apidata.js: extractapi.pl ./extractapi.pl >$@ @@ -170,9 +218,8 @@ api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PVEAPI.js cat api-viewer/apidata.js api-viewer/PVEAPI.js >$@ .PHONY: dinstall -dinstall: ${GEN_DEB} - dpkg -i ${GEN_DEB} - +dinstall: ${GEN_DEB} ${DOC_DEB} + dpkg -i ${GEN_DEB} ${DOC_DEB} .PHONY: deb deb: @@ -180,44 +227,28 @@ deb: make ${GEN_DEB}; make ${DOC_DEB}; -DOC_DEB_FILES= \ - $(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.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}) - asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc - 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} +${GEN_DEB} ${DOC_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} rm -rf build mkdir build rsync -a debian/ build/debian + echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE + # install files for pve-doc-generator 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} + # install files for pvedocs package + mkdir -p build/usr/share/${DOC_PACKAGE} + mkdir -p build/usr/share/doc/${DOC_PACKAGE} + install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE} + install -m 0644 ${WIKI_IMPORTS} 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 + # build debain package cd build; dpkg-buildpackage -rfakeroot -b -us -uc lintian ${GEN_DEB} + lintian ${DOC_DEB} .PHONY: upload upload: ${GEN_DEB} ${DOC_DEB} @@ -230,10 +261,13 @@ upload: ${GEN_DEB} ${DOC_DEB} 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 pct-network-opts.adoc pct-mountpoint-opts.adoc make all clean: - rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidata.js api-viewer/apidoc.js - + rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked + find . -name '*~' -exec rm {} ';'