X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=Makefile;h=6896e254fde247869cfcbabddc33327e70f11f50;hp=90110a8c34d233d192a62e067b333a4a7776c6fe;hb=5bf279bd97434367dc9485e83abc56bb6541a93e;hpb=db3cc8fc90e88993abd724f0170e94f1547b63bf diff --git a/Makefile b/Makefile index 90110a8..d194591 100644 --- a/Makefile +++ b/Makefile @@ -1,84 +1,159 @@ -RELEASE=4.1 - -PVESM_SOURCES=attributes.txt pvesm.adoc pvesm.1-synopsis.adoc $(shell ls pve-storage-*.adoc) -PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc -VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc -PVEFW_SOURCES=attributes.txt pve-firewall.adoc pve-firewall.8-synopsis.adoc -QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc -PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc - -PVE_ADMIN_GUIDE_SOURCES= \ - sysadmin.adoc \ - pve-admin-guide.adoc \ - pve-intro.adoc \ - pmxcfs.adoc \ - pve-faq.adoc \ - ${QM_SOURCES} \ - ${PCT_SOURCES} \ - ${PVEFW_SOURCES} \ - ${PVEUM_SOURCES} \ - ${PVESM_SOURCES} \ - ${VZDUMP_SOURCES} \ - images/cluster-nwdiag.svg \ - images/node-nwdiag.svg \ - pve-bibliography.adoc \ - 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=${RELEASE}" -ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${RELEASE}" +DGDIR=. +ASCIIDOC_PVE=./asciidoc-pve -%-nwdiag.svg: %.nwdiag - nwdiag -T svg $*.nwdiag -o $@; +GEN_PACKAGE=pve-doc-generator +DOC_PACKAGE=pve-docs +MEDIAWIKI_PACKAGE=pve-docs-mediawiki -%.1-synopsis.adoc: - perl -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp - mv $@.tmp $@ +# also update debian/changelog +PKGREL=10 + +GITVERSION:=$(shell cat .git/refs/heads/master) + +ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -%.1: %.adoc %.1-synopsis.adoc docinfo.xml - a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc - test -z "$${NOVIEW}" && man -l $@ +GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb +DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb +MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb -%.1.html: %.adoc %.1-synopsis.adoc docinfo.xml - asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc - test -z "$${NOVIEW}" && iceweasel $@ & +all: index.html +.pve-doc-depends link-refs.json: $(wildcard *.adoc) scan-adoc-refs + ./scan-adoc-refs *.adoc --depends .pve-doc-depends > link-refs.json -%.8-synopsis.adoc: - perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp +pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in + cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp mv $@.tmp $@ -%.8: %.adoc %.8-synopsis.adoc docinfo.xml - a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc - test -z "$${NOVIEW}" && man -l $@ +include ./pve-doc-generator.mk -%.8.html: %.adoc %.8-synopsis.adoc docinfo.xml - asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc - test -z "$${NOVIEW}" && iceweasel $@ & +GEN_DEB_SOURCES= \ + pve-doc-generator.mk \ + ${MANUAL_SOURCES} \ + pmxcfs.8-synopsis.adoc \ + docinfo.xml +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 \ + gen-pve-firewall-host-opts.pl \ + gen-pve-firewall-macros-adoc.pl \ + gen-pve-firewall-rules-opts.pl \ + gen-pve-firewall-vm-opts.pl -all: pve-admin-guide.html +API_VIEWER_SOURCES= \ + api-viewer/index.html \ + api-viewer/apidoc.js -index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES} - $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub - $(MAKE) NOVIEW=1 qm.1.html pct.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html - asciidoc -a "date=$(shell date)" -a "revnumber=${RELEASE}" index.adoc - iceweasel index.html & +asciidoc-pve: asciidoc-pve.in link-refs.json + cat asciidoc-pve.in link-refs.json >asciidoc-pve.tmp + sed -e s/@RELEASE@/${DOCRELEASE}/ -i asciidoc-pve.tmp + chmod +x asciidoc-pve.tmp + mv asciidoc-pve.tmp asciidoc-pve -pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES} - asciidoc -a "revnumber=${RELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc - test -z "$${NOVIEW}" && iceweasel $@ & +pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json + cat pve-docs-mediawiki-import.in link-refs.json > pve-docs-mediawiki-import.tmp + chmod +x pve-docs-mediawiki-import.tmp + mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import -pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml - grep ">Release ${RELEASE}<" 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" pve-admin-guide.adoc - test -z "$${NOVIEW}" && iceweasel $@ & +INDEX_INCLUDES= \ + pve-admin-guide.pdf \ + pve-admin-guide.epub \ + $(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST}) -pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES} - a2x -f epub pve-admin-guide.adoc - test -z "$${NOVIEW}" && iceweasel $@ & +ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" + +BROWSER?=xdg-open + + +%-nwdiag.svg: %.nwdiag + nwdiag -T svg $*.nwdiag -o $@; + +README.html: README.adoc + asciidoc ${ADOC_STDARG} -o $@ $< + +.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 +pve-admin-guide.html: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} + asciidoc -a pvelogo -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc + +pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} + 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_ADOCDEPENDS} docinfo.xml pve-admin-guide-docinfo.xml + inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg + inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg + 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" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc-dblatex-custom.sty" pve-admin-guide.adoc + rm proxmox-logo.pdf proxmox-ci-header.pdf + +pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} + a2x -f epub pve-admin-guide.adoc -clean: - rm -rf *~ *.html *.pdf *.epub *.1 *.8 +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: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} + dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} + +.PHONY: deb +deb: + rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}; + make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}; + +${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import + rm -rf build + mkdir build + rsync -a debian/ build/debian + cp pve-docs-mediawiki-import build/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import + 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} + mkdir -p build/usr/bin + install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE} + install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE} + install -m 0755 asciidoc-pve build/usr/bin/ + # 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 Debian packages + cd build; dpkg-buildpackage -rfakeroot -b -us -uc + lintian ${GEN_DEB} + lintian ${DOC_DEB} + lintian ${MEDIAWIKI_DEB} + +.PHONY: upload +upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} + tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh repoman@repo.proxmox.com upload + +.PHONY: update +update: clean + find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -exec rm -f \{\} \; + 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/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import .pve-doc-depends pve-doc-generator.mk + find . -name '*~' -exec rm {} ';'