[PATCH try2] Re: Disabling Python Modules

Ian Stakenvicius axs at gentoo.org
Mon Jan 23 16:51:33 UTC 2017


On 23/01/17 11:13 AM, Ian Stakenvicius wrote:
> On 20/01/17 01:45 PM, Ian Stakenvicius wrote:
>> On 18/01/17 08:03 PM, Jeremy Allison wrote:
>>> On Wed, Jan 18, 2017 at 03:05:58PM -0500, Ian Stakenvicius wrote:
>>>> [...]
>>>> I'll work on separating things out into appropriate segments, and
>>>> getting the patches into git locally so they can be committed as-is
>>>> later on.
>>>
>>> Hi Ian, that's fantasic news ! Thanks for helping us with that !
>>>
>>> Can you send us in an email as described here:
>>>
>>> https://www.samba.org/samba/devel/copyright-policy.html
>>> [..]
>>
>> Done.
>>
>> OK, the patchset is prepared for email; there's 27 (edit: 28) commits in it, and
>> I've provided the titles below.  Should some of these be squashed
>> together before I send them or should they remain separate?
> 
> Received advice from #samba-technical.  Please find attached the
> patchset as previously linked and described.
> 
> Regards,
> Ian
> 

New version attached for review, with proper signoffs in place.

-------------- next part --------------
From d095107bd500f7fb0c7e2d65b0a988420b6765c4 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Thu, 19 Jan 2017 11:41:01 -0500
Subject: [PATCH 01/28] waf: disable-python - add configuration parameter

This is the base commit to allow builds of samba components without
requiring python to be available at runtime.  The commit adds the
--disable-python flag, the conf.env.disasble_python attribute, and
makes the SAMBA_CHECK_PYTHON_HEADERS() configure check optional
rather than mandatory if --disable-python is set, in the root
wscript.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 wscript | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/wscript b/wscript
index 9168db1..b6e0147 100644
--- a/wscript
+++ b/wscript
@@ -83,10 +83,15 @@ def set_options(opt):
     opt.tool_options('python') # options for disabling pyc or pyo compilation
     # enable options related to building python extensions
 
+    opt.add_option('--disable-python',
+                  help=("do not generate python modules"),
+                  action="store_true", dest='disable_python', default=False)
 
 def configure(conf):
     version = samba_version.load_version(env=conf.env)
 
+    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
     conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
@@ -106,7 +111,10 @@ def configure(conf):
     conf.find_program('xsltproc', var='XSLTPROC')
 
     conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2, 6, 0))
-    conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
+    if conf.env.disable_python:
+        conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
+    else:
+        conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
 
     if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
         # Mac OSX needs to have this and it's also needed that the python is compiled with this
-- 
2.10.2


From ba5991400f99861850610046185d8e8e93f6e8b6 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Thu, 19 Jan 2017 11:47:33 -0500
Subject: [PATCH 02/28] waf: disable-python - skip python/, source4/torture

If bld.env.disable_python is set, do not recurse into python or
source4/torture as they will not build without python support available
elsewhere.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 wscript_build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/wscript_build b/wscript_build
index 0c3a2ae..e1a530a 100644
--- a/wscript_build
+++ b/wscript_build
@@ -45,7 +45,8 @@ bld.RECURSE('lib/ldb')
 bld.RECURSE('lib/param')
 bld.RECURSE('dynconfig')
 bld.RECURSE('lib/util/charset')
-bld.RECURSE('python')
+if not bld.env.disable_python:
+    bld.RECURSE('python')
 bld.RECURSE('source4/param')
 bld.RECURSE('source4/librpc')
 bld.RECURSE('source4/dsdb')
@@ -99,7 +100,8 @@ bld.RECURSE('source4/cldap_server')
 bld.RECURSE('source4/ntp_signd')
 bld.RECURSE('source4/utils')
 bld.RECURSE('source4/ntvfs')
-bld.RECURSE('source4/torture')
+if not bld.env.disable_python:
+    bld.RECURSE('source4/torture')
 bld.RECURSE('librpc')
 bld.RECURSE('source4')
 bld.RECURSE('source4/libcli')
-- 
2.10.2


From 7944549426d357f1804b28a6d8252a0d3b646b48 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Thu, 19 Jan 2017 14:14:07 -0500
Subject: [PATCH 03/28] waf: disable-python - don't check for pytalloc-util

If samba is set to use a system copy of talloc, and talloc wasn't built
with python support, then the system pytalloc-util will not be found.
If samba is being built without python support then pytalloc-util is not
needed, so do not bother to try and find it.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 lib/talloc/wscript | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 41f3be7..dae3a1a 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -48,7 +48,8 @@ def configure(conf):
         if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
                                      implied_deps='replace'):
             conf.define('USING_SYSTEM_TALLOC', 1)
-        if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+        if not conf.env.disable_python and \
+            conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
                                      implied_deps='talloc replace'):
             conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
 
-- 
2.10.2


From 7d6259dc6a7c91e9480c6a7dfbc2cf37797c731c Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Thu, 19 Jan 2017 15:33:21 -0500
Subject: [PATCH 04/28] waf: disable-python - don't check for pyldb-util

If samba is set to use a system copy of ldb, and ldb wasn't built with
python support, then no system pyldb-util will be found.  If samba is
being built without python support then pyldb-util isn not needed, so
do not bother to try and find it.

The system ldb check had to be duplicated due to the earlier commits
which changed order of ldb and pyldb-util checks, and by association
also added a dependency of pyldb-util onto ldb.  This seemed cleaner
than messing with variables.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 lib/ldb/wscript | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 7f05db3..9b68af3 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -13,7 +13,7 @@ while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
     srcdir = srcdir + '/..'
 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
 
-import wafsamba, samba_dist, Utils
+import wafsamba, samba_dist, Utils, Options
 
 samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
                         lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
@@ -33,6 +33,8 @@ def configure(conf):
     conf.RECURSE('lib/tdb')
     conf.RECURSE('lib/tevent')
 
+    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
     if conf.CHECK_FOR_THIRD_PARTY():
         conf.RECURSE('third_party/popt')
     else:
@@ -46,7 +48,8 @@ def configure(conf):
     conf.find_program('xsltproc', var='XSLTPROC')
     conf.check_tool('python')
     conf.check_python_version((2,4,2))
-    conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
+    if not conf.env.disable_python:
+        conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
 
     # where does the default LIBDIR end up? in conf.env somewhere?
     #
@@ -55,10 +58,16 @@ def configure(conf):
     conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
 
     if not conf.env.standalone_ldb:
-        if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
+        if conf.env.disable_python:
+            if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
+                                         onlyif='talloc tdb tevent',
+                                         implied_deps='replace talloc tdb tevent'):
+                conf.define('USING_SYSTEM_LDB', 1)
+        else:
+            if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
                                      onlyif='talloc tdb tevent',
                                      implied_deps='replace talloc tdb tevent ldb'):
-            conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
+                conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
             if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
                                          onlyif='talloc tdb tevent pyldb-util',
                                          implied_deps='replace talloc tdb tevent'):
-- 
2.10.2


From 7d4a58b985ccc723273b45c64f1707fe0e9358ca Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Thu, 19 Jan 2017 15:41:57 -0500
Subject: [PATCH 05/28] waf: disable-python - don't check for pytevent

If samba is set to use a system copy of tevent, and tevent wasn't built
with python support, then the system pytevent will not be found.  If
samba is being built without python support then pytevent is not needed,
so do not bother to try and find it.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 lib/tevent/wscript | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 580ca4d..927b3c0 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -34,11 +34,14 @@ def configure(conf):
 
     conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
 
+    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
     if not conf.env.standalone_tevent:
         if conf.CHECK_BUNDLED_SYSTEM_PKG('tevent', minversion=VERSION,
                                      onlyif='talloc', implied_deps='replace talloc'):
             conf.define('USING_SYSTEM_TEVENT', 1)
-            if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
+            if not conf.env.disable_python and \
+                conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
                 conf.define('USING_SYSTEM_PYTEVENT', 1)
 
     if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
@@ -61,8 +64,6 @@ def configure(conf):
     if not conf.CONFIG_SET('USING_SYSTEM_TEVENT'):
         conf.DEFINE('TEVENT_NUM_SIGNALS', tevent_num_signals)
 
-    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
-
     if not conf.env.disable_python:
         # also disable if we don't have the python libs installed
         conf.find_program('python', var='PYTHON')
-- 
2.10.2


From 36711e70e4de4a8f5eb1c24896f15b22a65c37c7 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:34:04 -0500
Subject: [PATCH 06/28] waf: disable-python - don't check for pytdb

If samba is set to use a system copy of tdb, and tdb wasn't built
with python support, then the system pytevent will not be found.  If
samba is being built without python support then pytdb is not needed,
so do not bother to try and find it.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 lib/tdb/wscript | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index 34058e4..2ff9fff 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -77,16 +77,17 @@ def configure(conf):
     conf.env.standalone_tdb = conf.IN_LAUNCH_DIR()
     conf.env.building_tdb = True
 
+    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+
     if not conf.env.standalone_tdb:
         if conf.CHECK_BUNDLED_SYSTEM_PKG('tdb', minversion=VERSION,
                                      implied_deps='replace'):
             conf.define('USING_SYSTEM_TDB', 1)
             conf.env.building_tdb = False
-            if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytdb', 'tdb', minversion=VERSION):
+            if not conf.env.disable_python and \
+                conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytdb', 'tdb', minversion=VERSION):
                 conf.define('USING_SYSTEM_PYTDB', 1)
 
-    conf.env.disable_python = getattr(Options.options, 'disable_python', False)
-
     if (conf.CONFIG_SET('HAVE_ROBUST_MUTEXES') and
         conf.env.building_tdb and
         not conf.env.disable_tdb_mutex_locking):
-- 
2.10.2


From 11076a3bce0d6ade67bf5750557ec076afcb1521 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:36:09 -0500
Subject: [PATCH 07/28] waf: disable-python - don't build pys3param

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source3/param/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source3/param/wscript_build b/source3/param/wscript_build
index c60e917..02c0a95 100644
--- a/source3/param/wscript_build
+++ b/source3/param/wscript_build
@@ -14,7 +14,8 @@ bld.SAMBA_GENERATOR('s3_param_proto_h',
                     group='build_source',
                     rule='${PYTHON} ${SRC[0].abspath(env)} --file ${SRC[1].abspath(env)} --output ${TGT} --mode=S3PROTO')
 
-bld.SAMBA3_PYTHON('pys3param',
+if not bld.env.disable_python:
+    bld.SAMBA3_PYTHON('pys3param',
                   source='pyparam.c',
                   deps='smbconf',
                   public_deps='samba-hostconfig pytalloc-util talloc',
-- 
2.10.2


From b65edb1d367c8cafd0d34ddd7ccb156399b05b1c Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:40:27 -0500
Subject: [PATCH 08/28] waf: disable-python - don't build pycredentials

pytalloc-util and pyparam_util dependencies are not available when
python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 auth/credentials/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/auth/credentials/wscript_build b/auth/credentials/wscript_build
index 009f5ec..d5a3844 100644
--- a/auth/credentials/wscript_build
+++ b/auth/credentials/wscript_build
@@ -24,7 +24,8 @@ bld.SAMBA_SUBSYSTEM('CREDENTIALS_NTLM',
 	source='credentials_ntlm.c',
 	deps='samba-credentials')
 
-bld.SAMBA_PYTHON('pycredentials',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pycredentials',
 	source='pycredentials.c',
 	public_deps='samba-credentials cmdline-credentials pytalloc-util pyparam_util CREDENTIALS_KRB5 CREDENTIALS_SECRETS',
 	realname='samba/credentials.so'
-- 
2.10.2


From adede4f8d5d025fc4afb96d5b25e507edb91c237 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:49:59 -0500
Subject: [PATCH 09/28] waf: disable-python - don't build python_netbios

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 libcli/nbt/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libcli/nbt/wscript_build b/libcli/nbt/wscript_build
index 090789c..a472c71 100644
--- a/libcli/nbt/wscript_build
+++ b/libcli/nbt/wscript_build
@@ -24,7 +24,8 @@ bld.SAMBA_BINARY('nmblookup' + bld.env.suffix4,
                  install=False
                  )
 
-bld.SAMBA_PYTHON('python_netbios',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_netbios',
                  source='pynbt.c',
                  public_deps='cli-nbt DYNCONFIG samba-hostconfig',
                  realname='samba/netbios.so'
-- 
2.10.2


From bfbe0654c9fc8deb857b68c1b00e1f2216c06b99 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 14:50:43 -0500
Subject: [PATCH 10/28] waf: disable-python - don't build pysecurity

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 libcli/security/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libcli/security/wscript_build b/libcli/security/wscript_build
index b529ec8..b987332 100644
--- a/libcli/security/wscript_build
+++ b/libcli/security/wscript_build
@@ -7,7 +7,8 @@ bld.SAMBA_LIBRARY('samba-security',
                   deps='talloc ndr NDR_SECURITY'
                   )
 
-bld.SAMBA_PYTHON('pysecurity',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pysecurity',
                  source='pysecurity.c',
                  deps='samba-security pytalloc-util',
                  realname='samba/security.so'
-- 
2.10.2


From 3a9223279ffb2c55e087c553f851fbc5a08be821 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:52:10 -0500
Subject: [PATCH 11/28] waf: disable-python - don't build libcli echo torture
 test

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 libcli/echo/tests/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libcli/echo/tests/wscript_build b/libcli/echo/tests/wscript_build
index 366c895..423455b 100644
--- a/libcli/echo/tests/wscript_build
+++ b/libcli/echo/tests/wscript_build
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
-bld.SAMBA_MODULE('TORTURE_LIBCLI_ECHO',
+if not bld.env.disable_python:
+    bld.SAMBA_MODULE('TORTURE_LIBCLI_ECHO',
         source='echo.c',
         subsystem='smbtorture',
         init_function='torture_libcli_echo_init',
-- 
2.10.2


From 26f1b95224318b2145546a2f3f7c3ea3d684d02c Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 09:54:05 -0500
Subject: [PATCH 12/28] waf: disable-python - don't build source4/pysmb

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/libcli/wscript_build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/source4/libcli/wscript_build b/source4/libcli/wscript_build
index 38a8f4e..a1a1e38 100644
--- a/source4/libcli/wscript_build
+++ b/source4/libcli/wscript_build
@@ -31,12 +31,13 @@ bld.SAMBA_SUBSYSTEM('LIBCLI_SMB_COMPOSITE',
 	private_headers='smb_composite/smb_composite.h',
 	)
 
-bld.SAMBA_PYTHON('pysmb',
-    source='pysmb.c',
-    deps='LIBCLI_SMB_COMPOSITE LIBCLI_SMB2 tevent-util pyparam_util pytalloc-util',
-	public_deps='cli_composite samba-credentials gensec LIBCLI_RESOLVE tevent param_options',
-    realname='samba/smb.so'
-    )
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pysmb',
+        source='pysmb.c',
+        deps='LIBCLI_SMB_COMPOSITE LIBCLI_SMB2 tevent-util pyparam_util pytalloc-util',
+	    public_deps='cli_composite samba-credentials gensec LIBCLI_RESOLVE tevent param_options',
+	realname='samba/smb.so'
+	)
 
 bld.SAMBA_SUBSYSTEM('LIBCLI_DGRAM',
 	source='dgram/dgramsocket.c dgram/mailslot.c dgram/netlogon.c dgram/browse.c',
-- 
2.10.2


From 3301fb79d0a06ac8e9ad3b07292954795e51b000 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 10:12:49 -0500
Subject: [PATCH 13/28] waf: disable-python - don't build samba4/librpc python
 bits

About half of samba4/librpc requires python, skip build and installation
of those parts when python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/librpc/wscript_build | 73 ++++++++++++++++++++++----------------------
 1 file changed, 37 insertions(+), 36 deletions(-)

diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index 60404f8..e9b0df0 100644
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -174,228 +174,229 @@ bld.SAMBA_LIBRARY('dcerpc',
 	vnum='0.0.1'
 	)
 
-bld.SAMBA_SUBSYSTEM('pyrpc_util',
+if not bld.env.disable_python:
+    bld.SAMBA_SUBSYSTEM('pyrpc_util',
 	source='rpc/pyrpc_util.c',
 	public_deps='pytalloc-util pyparam_util dcerpc MESSAGING',
 	pyext=True,
 	)
 
 
-bld.SAMBA_PYTHON('python_dcerpc',
+    bld.SAMBA_PYTHON('python_dcerpc',
 	source='rpc/pyrpc.c',
 	public_deps='LIBCLI_SMB samba-util samba-hostconfig dcerpc-samr RPC_NDR_LSA DYNCONFIG pyrpc_util gensec',
 	realname='samba/dcerpc/base.so'
 	)
 
-bld.SAMBA_PYTHON('python_srvsvc',
+    bld.SAMBA_PYTHON('python_srvsvc',
     source='../../librpc/gen_ndr/py_srvsvc.c',
     deps='RPC_NDR_SRVSVC pytalloc-util pyrpc_util',
     realname='samba/dcerpc/srvsvc.so'
     )
 
-bld.SAMBA_PYTHON('python_echo',
+    bld.SAMBA_PYTHON('python_echo',
 	source='../../librpc/gen_ndr/py_echo.c',
 	deps='RPC_NDR_ECHO pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/echo.so'
 	)
 
-bld.SAMBA_PYTHON('python_dns',
+    bld.SAMBA_PYTHON('python_dns',
 	source='../../librpc/gen_ndr/py_dns.c',
 	deps='NDR_DNS pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/dns.so'
 	)
 
-bld.SAMBA_PYTHON('python_auth',
+    bld.SAMBA_PYTHON('python_auth',
 	source='../../librpc/gen_ndr/py_auth.c',
 	deps='NDR_AUTH pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/auth.so'
 	)
 
-bld.SAMBA_PYTHON('python_krb5pac',
+    bld.SAMBA_PYTHON('python_krb5pac',
 	source='../../librpc/gen_ndr/py_krb5pac.c',
 	deps='ndr-krb5pac pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/krb5pac.so'
 	)
 
-bld.SAMBA_PYTHON('python_winreg',
+    bld.SAMBA_PYTHON('python_winreg',
 	source='../../librpc/gen_ndr/py_winreg.c',
 	deps='RPC_NDR_WINREG pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/winreg.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_dcerpc_misc',
+    bld.SAMBA_PYTHON('python_dcerpc_misc',
 	source='../../librpc/gen_ndr/py_misc.c',
 	deps='pytalloc-util pyrpc_util ndr-krb5pac',
 	realname='samba/dcerpc/misc.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_initshutdown',
+    bld.SAMBA_PYTHON('python_initshutdown',
 	source='../../librpc/gen_ndr/py_initshutdown.c',
 	deps='RPC_NDR_INITSHUTDOWN pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/initshutdown.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_epmapper',
+    bld.SAMBA_PYTHON('python_epmapper',
 	source='../../librpc/gen_ndr/py_epmapper.c',
 	deps='dcerpc pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/epmapper.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_mgmt',
+    bld.SAMBA_PYTHON('python_mgmt',
 	source='../../librpc/gen_ndr/py_mgmt.c',
 	deps='pytalloc-util dcerpc pyrpc_util',
 	realname='samba/dcerpc/mgmt.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_atsvc',
+    bld.SAMBA_PYTHON('python_atsvc',
 	source='../../librpc/gen_ndr/py_atsvc.c',
 	deps='RPC_NDR_ATSVC pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/atsvc.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_dcerpc_nbt',
+    bld.SAMBA_PYTHON('python_dcerpc_nbt',
 	source='../../librpc/gen_ndr/py_nbt.c',
 	deps='ndr_nbt RPC_NDR_NBT pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/nbt.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_samr',
+    bld.SAMBA_PYTHON('python_samr',
 	source='../../librpc/gen_ndr/py_samr.c',
 	deps='dcerpc-samr pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/samr.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_svcctl',
+    bld.SAMBA_PYTHON('python_svcctl',
 	source='../../librpc/gen_ndr/py_svcctl.c',
 	deps='RPC_NDR_SVCCTL pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/svcctl.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_lsa',
+    bld.SAMBA_PYTHON('python_lsa',
 	source='../../librpc/gen_ndr/py_lsa.c',
 	deps='RPC_NDR_LSA pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/lsa.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_wkssvc',
+    bld.SAMBA_PYTHON('python_wkssvc',
 	source='../../librpc/gen_ndr/py_wkssvc.c',
 	deps='RPC_NDR_WKSSVC pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/wkssvc.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_dfs',
+    bld.SAMBA_PYTHON('python_dfs',
 	source='../../librpc/gen_ndr/py_dfs.c',
 	deps='RPC_NDR_DFS pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/dfs.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_dcerpc',
+    bld.SAMBA_PYTHON('python_dcerpc_dcerpc',
 	source='../../librpc/gen_ndr/py_dcerpc.c',
 	deps='NDR_DCERPC pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/dcerpc.so'
 	)
 
-bld.SAMBA_PYTHON('python_unixinfo',
+    bld.SAMBA_PYTHON('python_unixinfo',
 	source='../../librpc/gen_ndr/py_unixinfo.c',
 	deps='RPC_NDR_UNIXINFO pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/unixinfo.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_irpc',
+    bld.SAMBA_PYTHON('python_irpc',
 	source='gen_ndr/py_irpc.c',
 	deps='RPC_NDR_IRPC pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/irpc.so'
 	)
 
-bld.SAMBA_PYTHON('python_server_id',
+    bld.SAMBA_PYTHON('python_server_id',
 	source='../../librpc/gen_ndr/py_server_id.c',
 	deps='RPC_NDR_SERVER_ID pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/server_id.so'
 	)
 
-bld.SAMBA_PYTHON('python_winbind',
+    bld.SAMBA_PYTHON('python_winbind',
 	source='../../librpc/gen_ndr/py_winbind.c',
 	deps='RPC_NDR_WINBIND pytalloc-util pyrpc_util python_netlogon',
 	realname='samba/dcerpc/winbind.so'
 	)
 
-bld.SAMBA_PYTHON('python_idmap',
+    bld.SAMBA_PYTHON('python_idmap',
 	source='../../librpc/gen_ndr/py_idmap.c',
 	deps='NDR_IDMAP pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/idmap.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_drsuapi',
+    bld.SAMBA_PYTHON('python_drsuapi',
 	source='../../librpc/gen_ndr/py_drsuapi.c',
 	deps='RPC_NDR_DRSUAPI pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/drsuapi.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_security',
+    bld.SAMBA_PYTHON('python_dcerpc_security',
 	source='../../librpc/gen_ndr/py_security.c',
 	deps='pytalloc-util pyrpc_util NDR_SECURITY',
 	realname='samba/dcerpc/security.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
+    bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
 	source='../../librpc/gen_ndr/py_drsblobs.c',
 	deps='pytalloc-util pyrpc_util NDR_SECURITY RPC_NDR_DRSBLOBS',
 	realname='samba/dcerpc/drsblobs.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_dnsp',
+    bld.SAMBA_PYTHON('python_dcerpc_dnsp',
 	source='../../librpc/gen_ndr/py_dnsp.c',
 	deps='pytalloc-util pyrpc_util NDR_SECURITY NDR_DNSP',
 	realname='samba/dcerpc/dnsp.so'
 	)
 
 
-bld.SAMBA_PYTHON('python_dcerpc_xattr',
+    bld.SAMBA_PYTHON('python_dcerpc_xattr',
 	source='../../librpc/gen_ndr/py_xattr.c',
 	deps='pytalloc-util pyrpc_util RPC_NDR_XATTR',
 	realname='samba/dcerpc/xattr.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_idmap',
+    bld.SAMBA_PYTHON('python_dcerpc_idmap',
 	source='../../librpc/gen_ndr/py_idmap.c',
 	deps='pytalloc-util pyrpc_util RPC_NDR_XATTR',
 	realname='samba/dcerpc/idmap.so'
 	)
 
-bld.SAMBA_PYTHON('python_netlogon',
+    bld.SAMBA_PYTHON('python_netlogon',
 	source='../../librpc/gen_ndr/py_netlogon.c',
 	deps='RPC_NDR_NETLOGON pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/netlogon.so'
 	)
 
-bld.SAMBA_PYTHON('python_dnsserver',
+    bld.SAMBA_PYTHON('python_dnsserver',
 	source='../../librpc/gen_ndr/py_dnsserver.c',
 	deps='RPC_NDR_DNSSERVER pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/dnsserver.so'
 	)
 
-bld.SAMBA_PYTHON('python_dcerpc_smb_acl',
+    bld.SAMBA_PYTHON('python_dcerpc_smb_acl',
 	source='../../librpc/gen_ndr/py_smb_acl.c',
 	deps='pytalloc-util pyrpc_util',
 	realname='samba/dcerpc/smb_acl.so'
 	)
 
-bld.SAMBA_SCRIPT('python_dcerpc_init',
+    bld.SAMBA_SCRIPT('python_dcerpc_init',
                  pattern='rpc/dcerpc.py',
                  installdir='python/samba/dcerpc',
                  installname='__init__.py')
 
-bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/dcerpc', 'rpc/dcerpc.py', destname='__init__.py')
+    bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/dcerpc', 'rpc/dcerpc.py', destname='__init__.py')
-- 
2.10.2


From 7d52aef68738d757bf0a511d8129f7eb3d68d740 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 10:18:21 -0500
Subject: [PATCH 14/28] waf: disable-python - don't build of pysmbd and
 pysmblib

They require pytalloc-util and pyrpc_util, which will be unavailable if
python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source3/wscript_build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/source3/wscript_build b/source3/wscript_build
index 815a540..fb601b3 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1314,13 +1314,14 @@ bld.SAMBA3_BINARY('vlp',
                       ''',
                  install=False)
 
-bld.SAMBA3_PYTHON('pysmbd',
+if not bld.env.disable_python:
+    bld.SAMBA3_PYTHON('pysmbd',
                   source='smbd/pysmbd.c',
                   deps='smbd_base pyrpc_util pytalloc-util',
                   realname='samba/samba3/smbd.so'
                   )
 
-bld.SAMBA3_PYTHON('pylibsmb',
+    bld.SAMBA3_PYTHON('pylibsmb',
                   source='libsmb/pylibsmb.c',
                   deps='smbclient samba-credentials pycredentials',
                   realname='samba/samba3/libsmb_samba_internal.so'
-- 
2.10.2


From 5aa48c56b6aa7e91ae980e53eb1e0d1f3aaa9db2 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 10:22:53 -0500
Subject: [PATCH 15/28] waf: disable-python - don't build python_samba__ldb

pyldb.c in lib/ldb-samba requires pyparam_util, pyldb-util, and
pyauth, none of which are available with python disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 lib/ldb-samba/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ldb-samba/wscript_build b/lib/ldb-samba/wscript_build
index d35b227..c60b274 100644
--- a/lib/ldb-samba/wscript_build
+++ b/lib/ldb-samba/wscript_build
@@ -19,7 +19,8 @@ bld.SAMBA_SUBSYSTEM('ldbwrap',
                     )
 
 
-bld.SAMBA_PYTHON('python_samba__ldb', 'pyldb.c',
+if not bld.env.disable_python:
+	bld.SAMBA_PYTHON('python_samba__ldb', 'pyldb.c',
                  deps='ldbsamba pyparam_util ldbwrap pyldb-util pyauth',
                  realname='samba/_ldb.so')
 
-- 
2.10.2


From 5869d7b88c50b1d326c223e02a1fca4cd636ff35 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 10:43:44 -0500
Subject: [PATCH 16/28] waf: disable-python - don't build pypassdb

It requires pyrpc_util which is not available when python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source3/passdb/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build
index f943597..ae3ae61 100644
--- a/source3/passdb/wscript_build
+++ b/source3/passdb/wscript_build
@@ -32,7 +32,8 @@ bld.SAMBA3_MODULE('pdb_samba_dsdb',
                   internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_samba_dsdb') and bld.AD_DC_BUILD_IS_ENABLED(),
                   enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_samba_dsdb') and bld.AD_DC_BUILD_IS_ENABLED())
 
-bld.SAMBA3_PYTHON('pypassdb',
+if not bld.env.disable_python:
+    bld.SAMBA3_PYTHON('pypassdb',
                   source='py_passdb.c',
                   deps='pdb',
                   public_deps='samba-util tdb talloc pyrpc_util pytalloc-util',
-- 
2.10.2


From fad65564dd18b4b5ec030eadc66332e43f56d6a3 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:25:18 -0500
Subject: [PATCH 17/28] waf: disable-python - don't build pygensec

It requires pytalloc-util and pyparam_util which is not available when
python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/auth/gensec/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/auth/gensec/wscript_build b/source4/auth/gensec/wscript_build
index 098826a..370f1cb 100644
--- a/source4/auth/gensec/wscript_build
+++ b/source4/auth/gensec/wscript_build
@@ -26,7 +26,8 @@ bld.SAMBA_MODULE('gensec_gssapi',
 	deps='gssapi samba-credentials authkrb5 com_err'
 	)
 
-bld.SAMBA_PYTHON('pygensec',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pygensec',
 	source='pygensec.c',
 	deps='gensec pytalloc-util pyparam_util',
 	realname='samba/gensec.so'
-- 
2.10.2


From 526402d99c9f763314d05e0b7d71e7c0d3585cda Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:26:14 -0500
Subject: [PATCH 18/28] waf: disable-python - don't build pyauth

It requires pytalloc-util and others which are not available without
python.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/auth/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/auth/wscript_build b/source4/auth/wscript_build
index 6742537..33831ef 100644
--- a/source4/auth/wscript_build
+++ b/source4/auth/wscript_build
@@ -43,7 +43,8 @@ bld.SAMBA_SUBSYSTEM('auth4_sam',
 	)
 
 
-bld.SAMBA_PYTHON('pyauth',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pyauth',
 	source='pyauth.c',
 	public_deps='auth_system_session',
 	deps='samdb pytalloc-util pyparam_util pyldb-util pycredentials auth4',
-- 
2.10.2


From 7435bbae781ee98215341270594f8fd868af0013 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:27:48 -0500
Subject: [PATCH 19/28] waf: disable-python - don't build python_dsdb

It requires pyldb-util and others which are not available when python is
disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/dsdb/wscript_build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build
index 97e4207..d452825 100644
--- a/source4/dsdb/wscript_build
+++ b/source4/dsdb/wscript_build
@@ -62,7 +62,9 @@ bld.SAMBA_MODULE('service_dns_update',
 	enabled=bld.AD_DC_BUILD_IS_ENABLED()
 	)
 
-bld.SAMBA_PYTHON('python_dsdb',
+
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_dsdb',
 	source='pydsdb.c',
 	# the dependency on dcerpc here is because gensec
 	# depends on dcerpc but the waf circular dependency finder
-- 
2.10.2


From c97ade0df307adf7bc8daae6cd7bcacac7366317 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:29:13 -0500
Subject: [PATCH 20/28] waf: disable-python - don't build python_dsdb_dns

pyldb-util and others are required but are unavailable when python is
disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/dns_server/wscript_build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
index 396ed76..4eed464 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -64,8 +64,8 @@ bld.SAMBA_LIBRARY('dlz_bind9_for_torture',
                   deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
                   enabled=bld.AD_DC_BUILD_IS_ENABLED())
 
-
-bld.SAMBA_PYTHON('python_dsdb_dns',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_dsdb_dns',
 	         source='pydns.c',
 	         deps='samdb pyldb-util pyrpc_util dnsserver_common pytalloc-util',
 	         realname='samba/dsdb_dns.so')
-- 
2.10.2


From dcfce454c7d6ac3907b894367d7563218b767e8a Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:30:55 -0500
Subject: [PATCH 21/28] waf: disable-python - don't build pycom

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/lib/com/wscript_build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source4/lib/com/wscript_build b/source4/lib/com/wscript_build
index 763de1f..541cbb7 100644
--- a/source4/lib/com/wscript_build
+++ b/source4/lib/com/wscript_build
@@ -26,8 +26,8 @@ bld.SAMBA_MODULE('com_simple',
 	init_function='com_simple_init'
 	)
 
-
-bld.SAMBA_PYTHON('pycom',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pycom',
 	source='pycom.c',
 	deps='COM',
 	realname='samba/com.so',
-- 
2.10.2


From 0154782531b6908ca2876e34e5a5055897febb56 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:31:59 -0500
Subject: [PATCH 22/28] waf: disable-python - don't build python_messaging

It requires pyparam_util which is not available when python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/lib/messaging/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/lib/messaging/wscript_build b/source4/lib/messaging/wscript_build
index 86877af..d68b74d 100644
--- a/source4/lib/messaging/wscript_build
+++ b/source4/lib/messaging/wscript_build
@@ -7,7 +7,8 @@ bld.SAMBA_LIBRARY('MESSAGING',
 	private_library=True
 	)
 
-bld.SAMBA_PYTHON('python_messaging',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_messaging',
 	source='pymessaging.c',
 	deps='MESSAGING events pyparam_util pytalloc-util',
 	realname='samba/messaging.so'
-- 
2.10.2


From 14cf0acc9716ee998650ac51c3547cd1d08084bd Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:35:09 -0500
Subject: [PATCH 23/28] waf: disable-python - don't build samba-policy,
 py_policy

py_policy requires pytalloc-util, and samba-policy requires samba-net
which in turn requires pytalloc-util.  As pytalloc-util is not available
when python is disabled, both of these modules must also be skipped.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/lib/policy/wscript_build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/source4/lib/policy/wscript_build b/source4/lib/policy/wscript_build
index b8ba638..40994f2 100644
--- a/source4/lib/policy/wscript_build
+++ b/source4/lib/policy/wscript_build
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
-bld.SAMBA_LIBRARY('samba-policy',
+if not bld.env.disable_python:
+    bld.SAMBA_LIBRARY('samba-policy',
 	source='gp_ldap.c gp_filesys.c gp_manage.c gp_ini.c',
 	pc_files='samba-policy.pc',
 	public_deps='ldb samba-net',
@@ -9,7 +10,7 @@ bld.SAMBA_LIBRARY('samba-policy',
 	public_headers='policy.h'
 	)
 
-bld.SAMBA_PYTHON('py_policy',
+    bld.SAMBA_PYTHON('py_policy',
 	source='pypolicy.c',
 	public_deps='samba-policy pytalloc-util',
 	realname='samba/policy.so'
-- 
2.10.2


From 36df2fcdfad28b8d21756ae6b52ddb1929689b62 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:47:03 -0500
Subject: [PATCH 24/28] waf: disable-python - don't build py_registry

It requires pytalloc-util and pyparam-util, which are unavailable when
python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/lib/registry/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/lib/registry/wscript_build b/source4/lib/registry/wscript_build
index c558b22..d305658 100644
--- a/source4/lib/registry/wscript_build
+++ b/source4/lib/registry/wscript_build
@@ -60,7 +60,8 @@ bld.SAMBA_SUBSYSTEM('torture_registry',
 	)
 
 
-bld.SAMBA_PYTHON('py_registry',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('py_registry',
 	source='pyregistry.c',
 	public_deps='registry pytalloc-util pyparam_util',
 	realname='samba/registry.so'
-- 
2.10.2


From cb7b4de909824ab643cf416585515998b6ac2644 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:54:17 -0500
Subject: [PATCH 25/28] waf: disable-python - don't build pywmi

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/lib/wmi/wscript_build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/lib/wmi/wscript_build b/source4/lib/wmi/wscript_build
index 59e0ce5..84e555f 100644
--- a/source4/lib/wmi/wscript_build
+++ b/source4/lib/wmi/wscript_build
@@ -19,7 +19,8 @@ bld.SAMBA_BINARY('wmis',
 	)
 
 
-bld.SAMBA_PYTHON('pywmi',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pywmi',
 	source='wmi_wrap.c',
 	public_deps='LIBCLI_SMB ndr samba-util samba-config WMI'
 	)
-- 
2.10.2


From f4fb35971a0fd3df46c7a8acab8547a89e602c44 Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 11:58:50 -0500
Subject: [PATCH 26/28] waf: disable-python - don't build samba-net et. al.

This patch skips the build of samba-net, python_net and python_dckeytab
when python is disabled:

samba-net requires PROVISION, which requires pyparam_util,
pytalloc-util and pyldb-util

python_net and python_dckeytab require pyrpc_util and others

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/libnet/wscript_build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source4/libnet/wscript_build b/source4/libnet/wscript_build
index 1274a82..1bb24b2 100644
--- a/source4/libnet/wscript_build
+++ b/source4/libnet/wscript_build
@@ -1,20 +1,20 @@
 #!/usr/bin/env python
 
-bld.SAMBA_LIBRARY('samba-net',
+if not bld.env.disable_python:
+    bld.SAMBA_LIBRARY('samba-net',
 	source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_samdump.c libnet_samsync_ldb.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c libnet_samsync.c',
 	autoproto='libnet_proto.h',
 	public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser PROVISION LIBCLI_SAMSYNC LIBTSOCKET',
 	private_library=True
 	)
 
-
-bld.SAMBA_PYTHON('python_net',
+    bld.SAMBA_PYTHON('python_net',
 	source='py_net.c',
 	deps='samba-net pyrpc_util pytalloc-util',
 	realname='samba/net.so'
 	)
 
-bld.SAMBA_PYTHON('python_dckeytab',
+    bld.SAMBA_PYTHON('python_dckeytab',
 	source='py_net_dckeytab.c libnet_export_keytab.c',
 	deps='pyrpc_util db-glue krb5 com_err',
 	realname='samba/dckeytab.so',
-- 
2.10.2


From b3315b904d4872d69a94827254355ef93e62be2f Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 12:05:36 -0500
Subject: [PATCH 27/28] waf: disable-python - don't build PROVISION, pyparam*

PROVISION, pyparam, and pyparam_util all cannot be built without
python support.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/param/wscript_build | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/source4/param/wscript_build b/source4/param/wscript_build
index 2ad753b..049dca9 100644
--- a/source4/param/wscript_build
+++ b/source4/param/wscript_build
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
-bld.SAMBA_SUBSYSTEM('PROVISION',
+if not bld.env.disable_python:
+    bld.SAMBA_SUBSYSTEM('PROVISION',
 	source='provision.c pyparam.c',
 	deps='LIBPYTHON pyparam_util ldb pytalloc-util pyldb-util',
 	pyext=True,
@@ -36,7 +37,8 @@ bld.SAMBA_SUBSYSTEM('SECRETS',
 	)
 
 
-bld.SAMBA_PYTHON('pyparam',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('pyparam',
 	source='pyparam.c',
 	deps='samba-hostconfig pytalloc-util',
 	realname='samba/param.so'
@@ -47,7 +49,8 @@ bld.SAMBA_SUBSYSTEM('param_options',
 	deps='samba-hostconfig')
 
 
-bld.SAMBA_SUBSYSTEM('pyparam_util',
+if not bld.env.disable_python:
+    bld.SAMBA_SUBSYSTEM('pyparam_util',
 	source='pyparam_util.c',
 	deps='LIBPYTHON samba-hostconfig pytalloc-util',
 	pyext=True,
-- 
2.10.2


From 3171ee4c368ab526a0e9fee5d361b2c4546be15d Mon Sep 17 00:00:00 2001
From: Ian Stakenvicius <axs at gentoo.org>
Date: Fri, 20 Jan 2017 12:07:39 -0500
Subject: [PATCH 28/28] waf: disable-python - don't build python_xattr et. al.

python_xattr_native, python_xattr_tdb, and python_posix_eadb all
require pyparam_util which is not available if python is disabled.

Signed-off-by: Ian Stakenvicius <axs at gentoo.org>
---
 source4/ntvfs/posix/wscript_build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/source4/ntvfs/posix/wscript_build b/source4/ntvfs/posix/wscript_build
index a07da33..1365db9 100644
--- a/source4/ntvfs/posix/wscript_build
+++ b/source4/ntvfs/posix/wscript_build
@@ -30,7 +30,6 @@ if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'):
                     enabled=False
     )
 
-
     bld.SAMBA_MODULE('ntvfs_posix',
 	             source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c',
 	             autoproto='vfs_posix_proto.h',
@@ -41,7 +40,8 @@ if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'):
     )
 
 
-bld.SAMBA_PYTHON('python_xattr_native',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_xattr_native',
 	source='python/pyxattr_native.c',
 	deps='ndr ldb samdb samba-credentials pyparam_util attr',
 	realname='samba/xattr_native.so'
@@ -53,13 +53,14 @@ bld.SAMBA_LIBRARY('posix_eadb',
                   autoproto='posix_eadb_proto.h',
                   private_library=True)
 
-bld.SAMBA_PYTHON('python_posix_eadb',
+if not bld.env.disable_python:
+    bld.SAMBA_PYTHON('python_posix_eadb',
 	source='python/pyposix_eadb.c',
 	deps='pyparam_util posix_eadb tdb',
 	realname='samba/posix_eadb.so'
 	)
 
-bld.SAMBA_PYTHON('python_xattr_tdb',
+    bld.SAMBA_PYTHON('python_xattr_tdb',
 	source='python/pyxattr_tdb.c',
 	deps='pyparam_util xattr_tdb',
 	realname='samba/xattr_tdb.so'
-- 
2.10.2



More information about the samba-technical mailing list