[pmg-devel] [PATCH pmg-docs 8/8] bsys: automatically update YEAR info

Stoiko Ivanov s.ivanov at proxmox.com
Wed Feb 27 20:37:33 CET 2019


in pmg-copyright.adoc and pmg-admin-guide-docinfo.xml

ported from pve-docs:742e92ef45cb1a8b6b98946959f6d36abc5ac9e9

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 Makefile                                    | 9 +++++++--
 pmg-admin-guide-docinfo.xml.in              | 2 +-
 pmg-copyright.adoc => pmg-copyright.adoc.in | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
 rename pmg-copyright.adoc => pmg-copyright.adoc.in (92%)

diff --git a/Makefile b/Makefile
index 78a7098..c31d7a1 100644
--- a/Makefile
+++ b/Makefile
@@ -111,8 +111,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
@@ -199,5 +204,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*
diff --git a/pmg-admin-guide-docinfo.xml.in b/pmg-admin-guide-docinfo.xml.in
index 31e90c9..5d94c85 100644
--- a/pmg-admin-guide-docinfo.xml.in
+++ b/pmg-admin-guide-docinfo.xml.in
@@ -1,7 +1,7 @@
 <subtitle>Release @RELEASE@</subtitle>
 
 <copyright>
-  <year>2017</year>
+  <year>@YEAR@</year>
   <holder>Proxmox Server Solutions Gmbh</holder>
 </copyright>
 
diff --git a/pmg-copyright.adoc b/pmg-copyright.adoc.in
similarity index 92%
rename from pmg-copyright.adoc
rename to pmg-copyright.adoc.in
index 1108294..a872fd1 100644
--- a/pmg-copyright.adoc
+++ b/pmg-copyright.adoc.in
@@ -1,7 +1,7 @@
 Copyright and Disclaimer
 ------------------------
 
-Copyright (C) 2007-2018 Proxmox Server Solutions GmbH
+Copyright (C) 2007- at YEAR@ Proxmox Server Solutions GmbH
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
-- 
2.11.0




More information about the pmg-devel mailing list