docs-xml: autogenerate a doc.version XML entity.
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Dec 2017 10:01:51 +0000 (11:01 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 13 Dec 2017 12:20:08 +0000 (13:20 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9531

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
docs-xml/build/DTD/samba-doc
docs-xml/build/DTD/samba.build.version.in [new file with mode: 0644]
docs-xml/build/catalog.xml.in
docs-xml/configure.ac
wscript
wscript_build

index afde3481dbed9f9e698404972422f5ce76350184..9873aa03458609dfe3f423266d00ce414d779357 100644 (file)
        "samba.entities">
 %samba.entities;
 
+<!ENTITY % samba.build.version PUBLIC
+       "-//Samba-Team//VERSION Samba Build Version//EN"
+       "http://www.samba.org/samba/LOCAL.BUILDDIR.DTD/samba.build.version">
+%samba.build.version;
+
 <!-- smb.conf options -->
 
 <!ELEMENT smbconfblock ((smbconfoption|smbconfsection|smbconfcomment)*)>
diff --git a/docs-xml/build/DTD/samba.build.version.in b/docs-xml/build/DTD/samba.build.version.in
new file mode 100644 (file)
index 0000000..775e08b
--- /dev/null
@@ -0,0 +1 @@
+<!ENTITY doc.version '@doc_version@'>
index 56d13a6cd3964645ad30ea8cce4d8f0a1fafb284..77bf87eeb7e4c20c66efe426a563d3ae80189348 100644 (file)
@@ -8,6 +8,10 @@
                        uriStartString="http://www.samba.org/samba/DTD/"
                        rewritePrefix="file://@abs_top_srcdir@/build/DTD/"/>
 
+    <rewriteURI
+                       uriStartString="http://www.samba.org/samba/LOCAL.BUILDDIR.DTD/"
+                       rewritePrefix="file://@abs_top_builddir@/build/DTD/"/>
+
     <rewriteURI
                        uriStartString="http://www.gnu.org/licenses/"
                        rewritePrefix="file://@abs_top_srcdir@/Samba3-ByExample/"/>
index fe889a2f33af5fd6c810ed8f835426d2a985da2b..8c26692630b0c9d81f53a80faf8b20a7a65d24f0 100644 (file)
@@ -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 0ef5f6050a3a80ceab8a760cc957d18df2f79c3a..83eec709f9df1b6ba5d24870060329b0067506c1 100644 (file)
--- 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:
index 253f95f8bc0cfb12276cb24a0c40d8b0f9a9ea48..e2b1f87201774505ec9aa47ea0cb28f3c0e6aa37 100644 (file)
@@ -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')