2012-09-06 18:10:08 +04:00
#!/usr/bin/env python
2012-09-17 14:07:26 +04:00
from samba_utils import save_file
2017-10-06 22:49:11 +03:00
import os
2012-09-06 18:10:08 +04:00
manpages='''
2016-02-11 12:49:39 +03:00
manpages/cifsdd.8
2012-10-15 19:20:07 +04:00
manpages/dbwrap_tool.1
2012-09-06 18:10:08 +04:00
manpages/eventlogadm.8
2012-09-13 19:52:13 +04:00
manpages/idmap_ad.8
manpages/idmap_autorid.8
manpages/idmap_hash.8
manpages/idmap_ldap.8
manpages/idmap_nss.8
2013-02-21 23:32:54 +04:00
manpages/idmap_rfc2307.8
2012-09-13 19:52:13 +04:00
manpages/idmap_rid.8
2016-03-31 17:57:58 +03:00
manpages/idmap_script.8
2012-09-13 19:52:13 +04:00
manpages/idmap_tdb.8
manpages/idmap_tdb2.8
2017-11-29 08:40:10 +03:00
manpages/libsmbclient.7
manpages/lmhosts.5
manpages/log2pcap.1
2020-07-05 00:16:40 +03:00
manpages/mdsearch.1
2017-02-03 16:57:45 +03:00
manpages/mvxattr.1
2012-09-06 18:10:08 +04:00
manpages/net.8
manpages/nmbd.8
manpages/nmblookup.1
manpages/ntlm_auth.1
manpages/pdbedit.8
manpages/profiles.1
manpages/rpcclient.1
2021-06-09 09:37:06 +03:00
manpages/samba-dcerpcd.8
2017-11-29 08:40:10 +03:00
manpages/samba-regedit.8
manpages/samba-tool.8
2012-09-06 18:10:08 +04:00
manpages/samba.7
2012-11-30 13:39:06 +04:00
manpages/samba.8
2019-07-22 04:35:21 +03:00
manpages/samba_downgrade_db.8
2012-09-06 18:10:08 +04:00
manpages/sharesec.1
manpages/smbcacls.1
manpages/smbclient.1
manpages/smbcontrol.1
manpages/smbcquotas.1
manpages/smbd.8
manpages/smbget.1
manpages/smbgetrc.5
manpages/smbpasswd.5
manpages/smbpasswd.8
2016-02-03 11:20:27 +03:00
manpages/smbspool_krb5_wrapper.8
2017-11-29 08:40:10 +03:00
manpages/smbspool.8
2021-04-22 14:39:31 +03:00
manpages/samba-bgqd.8
2012-09-06 18:10:08 +04:00
manpages/smbstatus.1
manpages/smbtar.1
manpages/smbtree.1
manpages/testparm.1
2017-06-29 02:08:37 +03:00
manpages/traffic_learner.7
2017-11-29 08:40:10 +03:00
manpages/traffic_replay.7
2012-09-06 18:10:08 +04:00
manpages/wbinfo.1
manpages/winbindd.8
'''
pam_winbind_manpages = '''
manpages/pam_winbind.8
manpages/pam_winbind.conf.5
'''
2018-06-27 16:14:15 +03:00
krb5_locator_manpages = 'manpages/winbind_krb5_locator.8'
2018-06-27 16:06:07 +03:00
krb5_localauth_manpages = 'manpages/winbind_krb5_localauth.8'
2012-09-06 18:10:08 +04:00
2020-03-10 20:18:10 +03:00
winexe_manpages = 'manpages/winexe.1'
2018-09-21 19:58:53 +03:00
vfs_module_manpages = ['vfs_acl_tdb',
'vfs_acl_xattr',
'vfs_aio_fork',
'vfs_aio_pthread',
2019-06-05 18:01:49 +03:00
'vfs_io_uring',
2018-09-21 19:58:53 +03:00
'vfs_audit',
'vfs_btrfs',
'vfs_cacheprime',
'vfs_cap',
'vfs_catia',
'vfs_ceph',
2019-03-27 17:57:45 +03:00
'vfs_ceph_snapshots',
2018-09-21 19:58:53 +03:00
'vfs_commit',
'vfs_crossrename',
'vfs_default_quota',
'vfs_dirsort',
2021-08-05 13:58:52 +03:00
'vfs_expand_msdfs',
2018-09-21 19:58:53 +03:00
'vfs_extd_audit',
'vfs_fake_perms',
'vfs_fileid',
'vfs_fruit',
'vfs_full_audit',
'vfs_glusterfs',
2019-01-17 17:21:07 +03:00
'vfs_glusterfs_fuse',
2018-09-21 19:58:53 +03:00
'vfs_gpfs',
'vfs_linux_xfs_sgid',
'vfs_media_harmony',
'vfs_nfs4acl_xattr',
'vfs_offline',
'vfs_prealloc',
'vfs_preopen',
'vfs_readahead',
'vfs_readonly',
'vfs_recycle',
'vfs_shadow_copy',
'vfs_shadow_copy2',
'vfs_shell_snap',
'vfs_snapper',
'vfs_streams_depot',
'vfs_streams_xattr',
'vfs_syncops',
'vfs_time_audit',
'vfs_tsmsm',
'vfs_unityed_media',
'vfs_virusfilter',
2020-04-07 19:47:46 +03:00
'vfs_widelinks',
2018-09-21 19:58:53 +03:00
'vfs_worm',
'vfs_xattr_tdb',
'vfs_zfsacl' ]
2012-09-17 14:07:26 +04:00
def smbdotconf_generate_parameter_list(task):
parameter_all = task.outputs[0].bldpath(task.env)
articles = task.inputs
2014-01-09 03:01:18 +04:00
entities = bld.pathconfig_entities()
2020-06-16 23:42:08 +03:00
# We need this if we build with Heimdal as we can't easily make
# the whole option go away
mit_kdc_path = '""'
2014-04-28 17:22:34 +04:00
# The MIT krb5kdc path is set if we build with MIT Kerberos
if bld.CONFIG_SET('MIT_KDC_PATH'):
mit_kdc_path = bld.CONFIG_GET('MIT_KDC_PATH')
2019-08-23 03:19:20 +03:00
t = "<!DOCTYPE section [\n" +\
"\n".join(entities) +\
"\n" +\
"<!ENTITY pathconfig.MITKDCPATH " + mit_kdc_path + ">\n" +\
"]>\n" +\
"<section>\n" +\
"".join(art.read() for art in articles) +\
"</section>\n"
2014-01-09 03:01:18 +04:00
2012-09-17 14:07:26 +04:00
save_file(parameter_all, t , create_dir=True)
return 0
2017-10-06 22:49:11 +03:00
# Since nothing really forces sorting in glob, we have to sort by file name
# POSIX file systems aren't required to return sorted content but we want
# smb.conf parameters to be sorted alphabetically
2019-01-26 18:53:18 +03:00
parameter_all = 'smbdotconf/parameters.all.xml'
sources = bld.path.ant_glob("smbdotconf/**/*.xml", flat=False, excl=parameter_all)
2018-02-02 17:34:31 +03:00
articles = " ".join(sorted([x.path_from(bld.path) for x in sources],
2017-10-06 22:49:11 +03:00
key=lambda m: m.split(os.sep)[-1]))
2014-01-15 09:11:41 +04:00
bld.SAMBA_GENERATOR(parameter_all,
source=articles,
target=parameter_all,
rule=smbdotconf_generate_parameter_list,
2014-08-27 12:15:56 +04:00
dep_vars=bld.dynconfig_varnames())
2014-01-15 09:11:41 +04:00
2012-09-17 14:07:26 +04:00
def SMBDOTCONF_MANPAGE(bld, target):
''' assemble and build smb.conf.5 manual page'''
2014-01-09 03:01:18 +04:00
bld.SAMBAMANPAGES(target, parameter_all)
2012-09-17 14:07:26 +04:00
2012-09-06 18:10:08 +04:00
if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']):
2012-09-17 14:07:26 +04:00
SMBDOTCONF_MANPAGE(bld, 'manpages/smb.conf.5')
2012-09-11 19:50:45 +04:00
bld.SAMBAMANPAGES(manpages)
2012-09-06 18:10:08 +04:00
if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
2012-09-17 20:09:35 +04:00
bld.SAMBAMANPAGES(pam_winbind_manpages)
2012-09-06 18:10:08 +04:00
if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
2012-09-17 20:09:35 +04:00
bld.SAMBAMANPAGES(krb5_locator_manpages)
2017-11-29 08:35:37 +03:00
2018-06-27 16:06:07 +03:00
if bld.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
bld.SAMBAMANPAGES(krb5_localauth_manpages)
2020-03-10 20:18:10 +03:00
if conf.env.build_winexe == True:
bld.SAMBAMANPAGES(winexe_manpages)
2020-11-09 19:08:27 +03:00
if bld.CONFIG_SET('ENABLE_SELFTEST'):
bld.SAMBAMANPAGES('manpages/vfstest.1')
2018-09-21 19:58:53 +03:00
for manpage in vfs_module_manpages:
if bld.SAMBA3_IS_ENABLED_MODULE(manpage):
bld.SAMBAMANPAGES('manpages/%s.8' % manpage)