]> git.proxmox.com Git - pve-docs.git/blobdiff - Makefile
bump pve-docs version to 4.2-2
[pve-docs.git] / Makefile
index 840d1a2e7c647f000f62b3c67d35bf4a93cfb548..52b7e0fb42f44996ad173df6e081b3fad22da958 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,14 @@ GEN_PACKAGE=pve-doc-generator
 DOC_PACKAGE=pve-docs
 
 # also update debian/changelog
-PKGREL=1
+GEN_PKGREL=1
+# also update doc-debian/changelog
+DOC_PKGREL=2
 
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
-GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb
-DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
+GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${GEN_PKGREL}_amd64.deb
+DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${DOC_PKGREL}_all.deb
 
 COMMAND_LIST=          \
        pvesubscription \
@@ -74,6 +76,10 @@ SYSADMIN_SOURCES=                            \
        system-software-updates.adoc            \
        sysadmin.adoc
 
+API_VIEWER_SOURCES=                            \
+       api-viewer/index.html                   \
+       api-viewer/apidoc.js
+
 PVE_ADMIN_GUIDE_SOURCES=                       \
        ${DATACENTER_CONF_MAN5_SOURCES}         \
        ${QM_CONF_MAN5_SOURCES}                 \
@@ -140,7 +146,7 @@ pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc ${PVE_COMMON_DOC_SOURCES}
        asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
        test -n "$${NOVIEW}" || $(BROWSER) $@ &
 
-index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
+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})
        asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
@@ -159,9 +165,15 @@ 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 >$@
+
+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
@@ -179,7 +191,7 @@ DOC_DEB_FILES=                                      \
        pve-admin-guide.epub    \
        index.html
 
-${DOC_DEB}: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
+${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
@@ -191,7 +203,9 @@ ${DOC_DEB}: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
        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 -m 0644 index.html 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}
 
@@ -223,5 +237,5 @@ update: clean
        make all
 
 clean:
-       rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
+       rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidata.js api-viewer/apidoc.js