]> git.proxmox.com Git - pve-docs.git/blobdiff - Makefile
api-viewer: add missing </pre> closing tag
[pve-docs.git] / Makefile
index 2228cbd4ed40165a147c4badfd1d1be89228d869..b373066d3aa1da7f8bd0974dabc513be3d7061fa 100644 (file)
--- 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,16 +8,13 @@ GEN_PACKAGE=pve-doc-generator
 DOC_PACKAGE=pve-docs
 MEDIAWIKI_PACKAGE=pve-docs-mediawiki
 
-# also update debian/changelog
-PKGREL=1
-
 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
+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}")
@@ -33,6 +33,7 @@ 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
@@ -127,8 +128,9 @@ pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
 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
@@ -151,7 +153,7 @@ api-viewer/apidoc.js: 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}
+       dpkg -i ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
 
 .PHONY: deb
 deb: $(DOC_DEB)
@@ -186,14 +188,14 @@ gen-install: $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf
        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 guest-example-hookscript.pl
+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 $(DESTDIR)/usr/share/${DOC_PACKAGE}
        install -dm755 $(DESTDIR)/usr/share/doc/${DOC_PACKAGE}
        install -dm755 $(DESTDIR)/usr/share/${DOC_PACKAGE}/examples/
-       install -m 755 guest-example-hookscript.pl $(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
@@ -216,7 +218,7 @@ mediawiki-install: pve-docs-mediawiki-import
 
 .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 buster
 
 .PHONY: update
 update: