]> git.proxmox.com Git - pmg-docs.git/blobdiff - Makefile
tfa: rework note regarding cluster join and tfa
[pmg-docs.git] / Makefile
index 000d6d89876bcdd783f075e04fee607dae758279..e1e2714e8e8d9fdd478cd6bb1277b84627733205 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,20 @@
+include /usr/share/dpkg/pkg-info.mk
+
 DGDIR=.
 ASCIIDOC_PMG=./asciidoc-pmg
 
 GEN_PACKAGE=pmg-doc-generator
 DOC_PACKAGE=pmg-docs
-WEB_PACKAGE=pmg-docs-apache
 
 # also update debian/changelog
-PKGREL=2
+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
-WEB_DEB=${WEB_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
 
 export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
 SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}")
@@ -34,6 +34,7 @@ ADOC_SOURCES_GUESS=$(filter-out %-synopsis.adoc %-opts.adoc %-table.adoc, $(wild
 
 pmg-doc-generator.mk: .pmg-doc-depends pmg-doc-generator.mk.in
        cat pmg-doc-generator.mk.in .pmg-doc-depends > $@.tmp
+       sed -i "s/@RELEASE@$$/${DEB_VERSION_UPSTREAM}/" $@.tmp
        mv $@.tmp $@
 
 -include ./pmg-doc-generator.mk
@@ -50,6 +51,11 @@ GEN_SCRIPTS=                                 \
        gen-pmg.conf.5-opts.pl                  \
        gen-user.conf.5-opts.pl
 
+API_VIEWER_FILES=                                                      \
+       api-viewer/apidata.js                                           \
+       api-viewer/PMGAPI.js                                            \
+       /usr/share/javascript/proxmox-widget-toolkit-dev/APIViewer.js
+
 API_VIEWER_SOURCES=                            \
        api-viewer/index.html                   \
        api-viewer/apidoc.js
@@ -136,8 +142,9 @@ pmg-admin-guide.epub: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
 api-viewer/apidata.js: extractapi.pl
        ./extractapi.pl >$@
 
-api-viewer/apidoc.js: api-viewer/apidata.js api-viewer/PMGAPI.js
-       cat api-viewer/apidata.js api-viewer/PMGAPI.js >$@
+api-viewer/apidoc.js: ${API_VIEWER_FILES}
+       cat ${API_VIEWER_FILES} >$@.tmp
+       mv $@.tmp $@
 
 .PHONY: dinstall
 dinstall: ${GEN_DEB} ${DOC_DEB}
@@ -146,7 +153,7 @@ dinstall: ${GEN_DEB} ${DOC_DEB}
 .PHONY: deb
 deb: ${DOC_DEB}
 
-${WEB_DEB} ${GEN_DEB}: ${DOC_DEB}
+${GEN_DEB}: ${DOC_DEB}
 
 ${DOC_DEB}:
        rm -f ${GEN_DEB} ${DOC_DEB}
@@ -154,7 +161,7 @@ ${DOC_DEB}:
        rsync -a * build/
        echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
        cd build; dpkg-buildpackage -b -us -uc
-       lintian $(DOC_DEB) $(GEN_DEB) $(WEB_DEB)
+       lintian $(DOC_DEB) $(GEN_DEB)
 
 .PHONY: clean-build
 clean-build:
@@ -190,8 +197,8 @@ doc-install: index.html $(API_VIEWER_SOURCES) verify-images
        install -m 0644 ${API_VIEWER_SOURCES} $(DESTDIR)/usr/share/${DOC_PACKAGE}/api-viewer
 
 .PHONY: upload
-upload: ${WEB_DEB} ${GEN_DEB} ${DOC_DEB}
-       tar cf - ${WEB_DEB} ${GEN_DEB} ${DOC_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
+upload: ${GEN_DEB} ${DOC_DEB}
+       tar cf - ${GEN_DEB} ${DOC_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
 
 .PHONY: update
 update: clean