]> git.proxmox.com Git - pmg-docs.git/blobdiff - Makefile
Add documentation for before queue filtering
[pmg-docs.git] / Makefile
index 9876e37b02606cc7247c30c183280027e9aa0080..8b125df1f87d7c0c8d4395064cd45da5aadf13e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,25 @@
+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=4
+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
+GEN_DEB=${GEN_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${ARCH}.deb
+DOC_DEB=${DOC_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+WEB_DEB=${WEB_PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+
+export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
+SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}")
 
 
 all: index.html
@@ -29,6 +36,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
@@ -64,7 +72,7 @@ INDEX_INCLUDES=                                                               \
        man8-index-table.adoc                                           \
        $(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
 
-ADOC_STDARG=-b $(shell pwd)/asciidoc/pmg-html -f asciidoc/asciidoc-pmg.conf -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
+ADOC_STDARG=-b $(shell pwd)/asciidoc/pmg-html -f asciidoc/asciidoc-pmg.conf -a icons -a data-uri -a "date=${SOURCE_DATE_HUMAN}" -a "revnumber=${DOCRELEASE}"
 
 BROWSER?=xdg-open
 
@@ -107,8 +115,13 @@ pmg-admin-guide.chunked: ${PMG_ADMIN_GUIDE_ADOCDEPENDS}
 PMG_DOCBOOK_CONF=-b $(shell pwd)/asciidoc/pmg-docbook -f asciidoc/asciidoc-pmg.conf
 PMG_DBLATEX_OPTS='-p ./asciidoc/pmg-dblatex.xsl -s asciidoc/dblatex-custom.sty -c asciidoc/dblatex-export.conf'
 
+YEAR:=$(shell date "+%Y")
+
 pmg-admin-guide-docinfo.xml: pmg-admin-guide-docinfo.xml.in
-       sed -e 's/@RELEASE@/${DOCRELEASE}/' <$< >$@
+       sed -e 's/@RELEASE@/${DOCRELEASE}/' -e 's/@YEAR@/${YEAR}/' <$< >$@
+
+pmg-copyright.adoc: pmg-copyright.adoc.in
+       sed -e 's/@YEAR@/${YEAR}/' <$< >$@
 
 pmg-admin-guide.pdf: ${PMG_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pmg-admin-guide-docinfo.xml
        rsvg-convert -f pdf -o proxmox-logo.pdf images/proxmox-logo.svg
@@ -136,7 +149,7 @@ dinstall: ${GEN_DEB} ${DOC_DEB}
 .PHONY: deb
 deb: ${DOC_DEB}
 
-${GEN_DEB}: ${DOC_DEB}
+${WEB_DEB} ${GEN_DEB}: ${DOC_DEB}
 
 ${DOC_DEB}:
        rm -f ${GEN_DEB} ${DOC_DEB}
@@ -144,7 +157,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)
+       lintian $(DOC_DEB) $(GEN_DEB) $(WEB_DEB)
 
 .PHONY: clean-build
 clean-build:
@@ -180,8 +193,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: ${GEN_DEB} ${DOC_DEB}
-       tar cf - ${GEN_DEB} ${DOC_DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
+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
 
 .PHONY: update
 update: clean
@@ -195,5 +208,5 @@ clean:
        rm -f *.deb *.changes *.buildinfo
        rm -f api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pmg-admin-guide.chunked asciidoc-pmg link-refs.json .asciidoc-pmg-tmp_* pmg-smtp-filter.8-synopsis.adoc pmgpolicy.8-synopsis.adoc pmgsh.1-synopsis.adoc
        rm -rf .pmg-doc-depends 
-       rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml
+       rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml pmg-copyright.adoc
        rm -rf build*