X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=Makefile;h=df339c2ef472261c33c97a5ccd38c8722ffd4649;hp=3bb308c7320885de3cd5579c9bae72bc9d97a498;hb=9a08108970ee1fd321806776f1ede67bb9a05cc1;hpb=f3af3a6d5619d4a696f172065c36f12e966d3379 diff --git a/Makefile b/Makefile index 3bb308c..df339c2 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +include /usr/share/dpkg/pkg-info.mk + +# overwriting below ensures that we can build without full PVE installed DGDIR=. ASCIIDOC_PVE=./asciidoc-pve @@ -5,17 +8,13 @@ GEN_PACKAGE=pve-doc-generator DOC_PACKAGE=pve-docs MEDIAWIKI_PACKAGE=pve-docs-mediawiki -# also update debian/changelog -PKGREL=18 - GITVERSION:=$(shell git rev-parse HEAD) ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb -DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb -MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb -DOC_BUILDDEPS := asciidoc-dblatex, source-highlight, librsvg2-bin +GEN_DEB=${GEN_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${ARCH}.deb +DOC_DEB=${DOC_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb +MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}") @@ -34,14 +33,16 @@ ADOC_SOURCES_GUESS=$(filter-out %-synopsis.adoc %-opts.adoc %-table.adoc, $(wild pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp + sed -i "s/@RELEASE@$$/${DEB_VERSION_UPSTREAM}/" $@.tmp mv $@.tmp $@ -include ./pve-doc-generator.mk +-include ./pve-doc-generator.mk GEN_DEB_SOURCES= \ pve-doc-generator.mk \ ${MANUAL_SOURCES} \ pmxcfs.8-synopsis.adoc \ + qmeventd.8-synopsis.adoc \ docinfo.xml GEN_SCRIPTS= \ @@ -52,13 +53,20 @@ GEN_SCRIPTS= \ gen-pct-network-opts.pl \ gen-pct-mountpoint-opts.pl \ gen-qm.conf.5-opts.pl \ + gen-cpu-models.conf.5-opts.pl \ gen-qm-cloud-init-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 + gen-pve-firewall-vm-opts.pl \ + gen-output-format-opts.pl + +API_VIEWER_FILES= \ + api-viewer/apidata.js \ + api-viewer/PVEAPI.js \ + /usr/share/javascript/proxmox-widget-toolkit-dev/APIViewer.js API_VIEWER_SOURCES= \ api-viewer/index.html \ @@ -88,16 +96,12 @@ ADOC_STDARG=-b $(shell pwd)/asciidoc/pve-html -f asciidoc/asciidoc-pve.conf -a i BROWSER?=xdg-open - -%-nwdiag.svg: %.nwdiag - nwdiag -T svg $*.nwdiag -o $@; - README.html: README.adoc asciidoc -a toc ${ADOC_STDARG} -o $@ $< .PHONY: index index: index.html - $(BROWSER) index.html & + test -z "$${PVE_DOC_INSTANTVIEW}" || $(BROWSER) index.html & chapter-index-table.adoc: asciidoc-pve ./asciidoc-pve chapter-table >$@.tmp @@ -122,14 +126,17 @@ pve-admin-guide.html: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} asciidoc -a pvelogo ${ADOC_STDARG} -o $@ 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 + rm -rf $@.tmp $@ + mkdir $@.tmp + a2x -D $@.tmp -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc + mv $@.tmp/$@ $@ PVE_DOCBOOK_CONF=-b $(shell pwd)/asciidoc/pve-docbook -f asciidoc/asciidoc-pve.conf PVE_DBLATEX_OPTS='-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf' +YEAR:=$(shell date '+%Y') pve-admin-guide-docinfo.xml: pve-admin-guide-docinfo.xml.in - sed -e 's/@RELEASE@/${DOCRELEASE}/' <$< >$@ + sed -e 's/@RELEASE@/${DOCRELEASE}/' -e 's/@YEAR@/${YEAR}/' <$< >$@ pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide-docinfo.xml rsvg-convert -f pdf -o proxmox-logo.pdf images/proxmox-logo.svg @@ -139,99 +146,101 @@ pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide- rm proxmox-logo.pdf proxmox-ci-header.pdf pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} - a2x -f epub --asciidoc-opts="${PVE_DOCBOOK_CONF}" pve-admin-guide.adoc + rm -rf $@.tmp $@ + mkdir $@.tmp + a2x -D $@.tmp -f epub --asciidoc-opts="${PVE_DOCBOOK_CONF}" pve-admin-guide.adoc + mv $@.tmp/$@ $@ 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 >$@ +api-viewer/apidoc.js: ${API_VIEWER_FILES} + cat ${API_VIEWER_FILES} >$@.tmp + mv $@.tmp $@ .PHONY: dinstall dinstall: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} - dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} + dpkg -i ${GEN_DEB} ${DOC_DEB} # ${MEDIAWIKI_DEB} .PHONY: deb -deb: +deb: $(DOC_DEB) +$(MEDIAWIKI_DEB) $(GEN_DEB): $(DOC_DEB) +$(DOC_DEB): rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} - make all-debs - -.PHONY: all-debs -all-debs: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} + rm -rf build + rsync -a * build/ + echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE + cd build; dpkg-buildpackage -b -us -uc + lintian $(DOC_DEB) $(GEN_DEB) $(MEDIAWIKI_DEB) .PHONY: clean-build clean-build: rm -rf build -define prepare_build - rm -rf build-$1 - mkdir build-$1 - cp -a debian build-$1/debian - mv build-$1/debian/control.in build-$1/debian/control - echo >> build-$1/debian/control - cat debian/$1.control >> build-$1/debian/control - echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build-$1/debian/SOURCE - install -dm755 build-$1/usr/share/$1 - install -dm755 build-$1/usr/share/doc/$1 -endef - -.PHONY: gen-deb -gen-deb: $(GEN_DEB) -$(GEN_DEB): $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf - $(call prepare_build,$(GEN_PACKAGE)) - install -dm755 build-$(GEN_PACKAGE)/usr/bin +.PHONY: install +install: gen-install doc-install mediawiki-install + +.PHONY: gen-install +gen-install: $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf + install -dm755 $(DESTDIR)/usr/share/$(GEN_PACKAGE) + install -dm755 $(DESTDIR)/usr/share/doc/$(GEN_PACKAGE) + install -dm755 $(DESTDIR)/usr/bin # install files - install -m 0644 ${GEN_DEB_SOURCES} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE} - install -m 0755 ${GEN_SCRIPTS} build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE} + install -m 0644 ${GEN_DEB_SOURCES} $(DESTDIR)/usr/share/${GEN_PACKAGE} + install -m 0755 ${GEN_SCRIPTS} $(DESTDIR)/usr/share/${GEN_PACKAGE} # install asciidoc-pve - install -m 0755 asciidoc-pve build-$(GEN_PACKAGE)/usr/bin/ - install -D -m 0644 asciidoc/mediawiki.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf - install -m 0644 asciidoc/asciidoc-pve.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/ - install -m 0644 asciidoc/pve-html.conf build-$(GEN_PACKAGE)/usr/share/${GEN_PACKAGE}/asciidoc/ - cd build-$(GEN_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc - lintian ${GEN_DEB} - -.PHONY: doc-deb -doc-deb: $(DOC_DEB) -$(DOC_DEB): index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images - $(call prepare_build,$(DOC_PACKAGE)) - sed -i -e '/^Build-Depends/{s/$$/, $(DOC_BUILDDEPS)/}' build-$(DOC_PACKAGE)/debian/control + install -m 0755 asciidoc-pve $(DESTDIR)/usr/bin/ + install -D -m 0644 asciidoc/mediawiki.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf + install -m 0644 asciidoc/asciidoc-pve.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/ + install -m 0644 asciidoc/pve-html.conf $(DESTDIR)/usr/share/${GEN_PACKAGE}/asciidoc/ + +.PHONY: doc-install +doc-install: index.html $(WIKI_IMPORTS) $(API_VIEWER_SOURCES) verify-images examples + install -dm755 $(DESTDIR)/usr/share/$(DOC_PACKAGE) + install -dm755 $(DESTDIR)/usr/share/doc/$(DOC_PACKAGE) # install files for pvedocs package - install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} - install -dm755 build-$(DOC_PACKAGE)/usr/share/doc/${DOC_PACKAGE} - install -m 0644 index.html ${INDEX_INCLUDES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} - install -m 0644 ${WIKI_IMPORTS} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE} + install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE} + install -dm755 $(DESTDIR)/usr/share/doc/${DOC_PACKAGE} + install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/examples/ + install -m 755 examples/guest-example-hookscript.pl $(DESTDIR)/usr/share/${DOC_PACKAGE}/examples/ + install -m 0644 index.html ${INDEX_INCLUDES} $(DESTDIR)/usr/share/${DOC_PACKAGE} + install -m 0644 ${WIKI_IMPORTS} $(DESTDIR)/usr/share/${DOC_PACKAGE} + # install images + make -C images install # install screenshot images - install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot - install -m 0644 images/screenshot/*.png build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/images/screenshot + install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot + install -m 0644 images/screenshot/*.png $(DESTDIR)/usr/share/${DOC_PACKAGE}/images/screenshot # install api doc viewer - install -dm755 build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer - install -m 0644 ${API_VIEWER_SOURCES} build-$(DOC_PACKAGE)/usr/share/${DOC_PACKAGE}/api-viewer - cd build-$(DOC_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc - lintian ${DOC_DEB} - -.PHONY: mediawiki-deb -mediawiki-deb: $(MEDIAWIKI_DEB) -$(MEDIAWIKI_DEB): pve-docs-mediawiki-import - $(call prepare_build,$(MEDIAWIKI_PACKAGE)) - cp pve-docs-mediawiki-import build-$(MEDIAWIKI_PACKAGE)/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import - cd build-$(MEDIAWIKI_PACKAGE) && dpkg-buildpackage -rfakeroot -b -us -uc - lintian ${MEDIAWIKI_DEB} + install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer + install -m 0644 ${API_VIEWER_SOURCES} $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer + +.PHONY: mediawiki-install +mediawiki-install: pve-docs-mediawiki-import + install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE) + install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE) + install -dm755 $(DESTDIR)/usr/bin + install -dm755 $(DESTDIR)/usr/share/$(MEDIAWIKI_PACKAGE) + install -dm755 $(DESTDIR)/usr/share/doc/$(MEDIAWIKI_PACKAGE) + install -m 0755 pve-docs-mediawiki-import $(DESTDIR)/usr/bin/ .PHONY: upload upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} - tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch + tar cf - ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye .PHONY: update -update: clean clean-static | update-static +update: + make clean clean-static + make update-static make all .PHONY: update-static -update-static: clean-static | $(filter %-synopsis.adoc %-opts.adoc, ${PVE_ADMIN_GUIDE_ADOCDEPENDS}) pve-firewall-macros.adoc api-viewer/apidata.js +update-static: + make clean-static + make $(filter %-synopsis.adoc %-opts.adoc, ${PVE_ADMIN_GUIDE_ADOCDEPENDS}) pve-firewall-macros.adoc api-viewer/apidata.js .PHONY: clean-static clean-static: - find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -exec rm -f \{\} \; + find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -not -name qmeventd.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 @@ -241,4 +250,4 @@ clean: rm -f 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 rm -rf .pve-doc-depends rm -f pve-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pve-admin-guide-docinfo.xml - rm -rf build-* + rm -rf build