From 2abb55b73522ccd8f08847d26c06769ec2eecc27 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 12 Dec 2017 11:01:51 +0100 Subject: [PATCH] docs-xml: autogenerate a doc.version XML entity. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9531 Signed-off-by: Stefan Metzmacher Reviewed-by: Karolin Seeger Reviewed-by: Andreas Schneider --- docs-xml/build/DTD/samba-doc | 5 +++++ docs-xml/build/DTD/samba.build.version.in | 1 + docs-xml/build/catalog.xml.in | 4 ++++ docs-xml/configure.ac | 10 +++++++++- wscript | 2 +- wscript_build | 5 ++++- 6 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 docs-xml/build/DTD/samba.build.version.in diff --git a/docs-xml/build/DTD/samba-doc b/docs-xml/build/DTD/samba-doc index afde3481dbe..9873aa03458 100644 --- a/docs-xml/build/DTD/samba-doc +++ b/docs-xml/build/DTD/samba-doc @@ -23,6 +23,11 @@ "samba.entities"> %samba.entities; + +%samba.build.version; + diff --git a/docs-xml/build/DTD/samba.build.version.in b/docs-xml/build/DTD/samba.build.version.in new file mode 100644 index 00000000000..775e08bb1ee --- /dev/null +++ b/docs-xml/build/DTD/samba.build.version.in @@ -0,0 +1 @@ + diff --git a/docs-xml/build/catalog.xml.in b/docs-xml/build/catalog.xml.in index 56d13a6cd39..77bf87eeb7e 100644 --- a/docs-xml/build/catalog.xml.in +++ b/docs-xml/build/catalog.xml.in @@ -8,6 +8,10 @@ uriStartString="http://www.samba.org/samba/DTD/" rewritePrefix="file://@abs_top_srcdir@/build/DTD/"/> + + diff --git a/docs-xml/configure.ac b/docs-xml/configure.ac index fe889a2f33a..8c26692630b 100644 --- a/docs-xml/configure.ac +++ b/docs-xml/configure.ac @@ -55,4 +55,12 @@ fi AC_SUBST(TARGETS) -AC_OUTPUT( Makefile.settings build/catalog.xml) +if test x"$DOC_VERSION" = x; then + AC_MSG_ERROR([Please export DOC_VERSION variable]) +else + AC_MSG_RESULT([DOC_VERSION: ${DOC_VERSION}]) +fi + +doc_version="${DOC_VERSION}" +AC_SUBST(doc_version) +AC_OUTPUT( Makefile.settings build/catalog.xml build/DTD/samba.build.version) diff --git a/wscript b/wscript index 0ef5f6050a3..83eec709f9d 100644 --- a/wscript +++ b/wscript @@ -363,7 +363,7 @@ def dist(): os.system("make -C ctdb manpages") samba_dist.DIST_FILES('ctdb/doc:ctdb/doc', extend=True) - os.system(srcdir + "/release-scripts/build-manpages-nogit") + os.system("DOC_VERSION='" + sambaversion.STRING + "' " + srcdir + "/release-scripts/build-manpages-nogit") samba_dist.DIST_FILES('bin/docs:docs', extend=True) if sambaversion.IS_SNAPSHOT: diff --git a/wscript_build b/wscript_build index 253f95f8bc0..e2b1f872017 100644 --- a/wscript_build +++ b/wscript_build @@ -23,7 +23,7 @@ bld.env.build_public_headers = 'include/public' # compilation, so they are safe bld.env.public_headers_skip = ['lib/param/param_proto.h', 'lib/param/param_functions.h'] -samba_version.load_version(bld.env, is_install=bld.is_install) +version=samba_version.load_version(bld.env, is_install=bld.is_install) bld.SAMBA_MKVERSION('version.h') # bld.ENABLE_MAGIC_ORDERING() @@ -33,6 +33,9 @@ bld.env.ABS_TOP_BUILDDIR = bld.srcnode.abspath() + '/bin/default/docs-xml' bld.CONFIGURE_FILE('docs-xml/build/catalog.xml', ABS_TOP_BUILDDIR = bld.env.ABS_TOP_BUILDDIR, ABS_TOP_SRCDIR=bld.env.ABS_TOP_SRCDIR) +bld.env.DOC_VERSION=version.STRING +bld.CONFIGURE_FILE('docs-xml/build/DTD/samba.build.version', + DOC_VERSION=bld.env.DOC_VERSION) bld.RECURSE('docs-xml') bld.RECURSE('lib/replace') -- 2.34.1