Skip to content

Commit

Permalink
docs-xml: autogenerate a doc.version XML entity.
Browse files Browse the repository at this point in the history
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9531

Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Karolin Seeger <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
metze-samba authored and cryptomilk committed Dec 13, 2017
1 parent 00d3019 commit 2abb55b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs-xml/build/DTD/samba-doc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"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)*)>
Expand Down
1 change: 1 addition & 0 deletions docs-xml/build/DTD/samba.build.version.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!ENTITY doc.version '@doc_version@'>
4 changes: 4 additions & 0 deletions docs-xml/build/catalog.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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/"/>
Expand Down
10 changes: 9 additions & 1 deletion docs-xml/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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')
Expand Down

0 comments on commit 2abb55b

Please sign in to comment.