summaryrefslogtreecommitdiff
path: root/docs-xml/wscript_build
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2012-09-17 13:07:26 +0300
committerAlexander Bokovoy <ab@samba.org>2012-09-17 14:18:31 +0200
commit73ed1533105ac3f90813e5a0e7888a095eff4b75 (patch)
tree74ec0f4b2878b3d6a9ebf37c6d08be4a601c2100 /docs-xml/wscript_build
parent57990cbcbbdf83d7b9997ac1fd33528c63c96226 (diff)
downloadsamba-73ed1533105ac3f90813e5a0e7888a095eff4b75.tar.gz
samba-73ed1533105ac3f90813e5a0e7888a095eff4b75.tar.bz2
samba-73ed1533105ac3f90813e5a0e7888a095eff4b75.zip
docs-xml: convert smb.conf.5 build to waf
smb.conf(5) is different from other manpages because before it is built, it gets merged together from a number of smaller files, one per parameter. So we first create a parameters.all.xml file that references all these files and then include it into master smb.conf.5.xml One small issue is how to handle generated files in WAF build from xi:include perspective as the files are generated in bin/default/docs-xml rather than in docs-xml. We solve this by further expanding use of XML catalogs and rewriting virtual path http://www.samba.org/samba/smbdotconf/ to proper location. Both docs-xml autoconf and waf builds work correctly now. Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Mon Sep 17 14:18:31 CEST 2012 on sn-devel-104
Diffstat (limited to 'docs-xml/wscript_build')
-rw-r--r--docs-xml/wscript_build25
1 files changed, 23 insertions, 2 deletions
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 011854b2e6..c5d5839d96 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
+from samba_utils import save_file
manpages='''
manpages/eventlogadm.8
manpages/findsmb.1
@@ -23,7 +23,6 @@ manpages='''
manpages/rpcclient.1
manpages/samba.7
manpages/sharesec.1
- manpages/smb.conf.5
manpages/smbcacls.1
manpages/smbclient.1
manpages/smbcontrol.1
@@ -87,8 +86,30 @@ pam_winbind_manpages = '''
krb5_locator_manpages = 'manpages/winbind_krb5_locator.7'
+def smbdotconf_generate_parameter_list(task):
+ parameter_all = task.outputs[0].bldpath(task.env)
+ articles = task.inputs
+
+ t = '<section xmlns:xi="http://www.w3.org/2003/XInclude">\n'
+ for article in articles:
+ t += "<xi:include href='file://" + article.abspath(task.env) + "' parse='xml'/>\n"
+ t += "</section>\n"
+ save_file(parameter_all, t , create_dir=True)
+ return 0
+
+def SMBDOTCONF_MANPAGE(bld, target):
+ ''' assemble and build smb.conf.5 manual page'''
+ articles = bld.path.ant_glob("smbdotconf/**/*.xml")
+ parameter_all = 'smbdotconf/parameters.all.xml'
+ bld.SAMBA_GENERATOR(parameter_all,
+ source=articles,
+ target=parameter_all,
+ rule=smbdotconf_generate_parameter_list)
+ bld.SAMBAMANPAGES(target)
+
if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']):
+ SMBDOTCONF_MANPAGE(bld, 'manpages/smb.conf.5')
bld.SAMBAMANPAGES(manpages)
if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):