tests: Work audit_log CLIENT_IP out from config instead of env var
[Samba.git] / python / wscript
blob9012b5077a066e1799c97b07bdca2f5f97f7cba3
1 #!/usr/bin/env python
3 import os
5 def configure(conf):
6 if conf.env.disable_python:
7 return
9 kerberos_py = conf.srcnode.abspath() + "/python/samba/provision/kerberos_implementation.py"
11 f = open(kerberos_py, 'w')
12 try:
13 header = """#
14 # Copyright (c) 2016 Andreas Schneider <asn@samba.org>
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 3 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29 """
30 f.write(header)
32 data = """kdb_modules_dir = "{0}"
33 """
35 if conf.env.HEIMDAL_KRB5_CONFIG:
36 f.write(data.format("", ""))
37 else:
38 modulesdir = "%s/krb5/plugins/kdb" % conf.env.LIBDIR
40 f.write(data.format(modulesdir))
41 finally:
42 f.close()
44 def build(bld):
47 for env in bld.gen_python_environments():
48 pytalloc_util = bld.pyembed_libname('pytalloc-util')
49 pyparam_util = bld.pyembed_libname('pyparam_util')
50 libpython = bld.pyembed_libname('LIBPYTHON')
51 pyrpc_util = bld.pyembed_libname('pyrpc_util')
52 samba_python = bld.pyembed_libname('samba_python')
53 bld.SAMBA_LIBRARY(samba_python,
54 source=[],
55 deps='%s %s %s' % (libpython, pytalloc_util, pyrpc_util),
56 grouping_library=True,
57 private_library=True,
58 pyembed=True,
59 enabled=bld.PYTHON_BUILD_IS_ENABLED())
60 bld.SAMBA_PYTHON('python_glue',
61 source='pyglue.c',
62 deps='''
64 samba-util
65 netif
67 ''' % (pyparam_util, pytalloc_util),
68 realname='samba/_glue.so')
70 bld.SAMBA_SUBSYSTEM(libpython,
71 source='modules.c',
72 public_deps='',
73 init_function_sentinel='{NULL,NULL}',
74 deps='talloc',
75 pyext=True,
76 enabled=bld.PYTHON_BUILD_IS_ENABLED())
78 if bld.PYTHON_BUILD_IS_ENABLED():
79 for env in bld.gen_python_environments():
80 # install out various python scripts for use by make test
81 bld.SAMBA_SCRIPT('samba_python_files',
82 pattern='samba/**/*.py',
83 installdir='python')
85 bld.INSTALL_WILDCARD('${PYTHONARCHDIR}', 'samba/**/*.py', flat=False)