1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/third_party/wscript
Andrew Bartlett 2b7224ab7c third_party: Remove zlib from third_party
We require zlib 1.2.3.

We stopped requring a patched zlib with 5631a1b9bc

As discussed on samba-technical here:

https://lists.samba.org/archive/samba-technical/2019-May/133476.html

In short, zlib contains some (old, now broken) crypto code that while not compiled
in Samba is best left out of our tarball to ease crypto audits.  It is also very
very out of date and is a slightly modified copy of something otherwise very
likely available on our supported host OSs.  It would be strange to say that
GnuTLS and dependencies are an acceptable burden to install but say zlib is
a step to far.

So it is removed from Samba's third_party with this commit.

The diff between zlib in Samba and official zlib 1.2.3 is included
in third_party/zlib/last-samba-from-1.2.3.diff

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-08-17 03:50:40 +00:00

94 lines
2.8 KiB
Python

#!/usr/bin/env python
import os
import sys
import samba_git
from waflib import Options, Errors
# work out what python external libraries we need to install
external_pkgs = {
"iso8601": "pyiso8601/iso8601",
}
def find_third_party_module(conf, module, package):
conf.COMPOUND_START("Checking for third party Python module %s" % module)
try:
__import__(module)
except ImportError:
pass
else:
# Installed on the system
conf.COMPOUND_END("system")
old_path = sys.path
try:
sys.path.append(os.path.join(conf.path.abspath(), os.path.dirname(package)))
try:
__import__(module)
except ImportError:
if samba_git.has_submodules(conf.srcnode.abspath()):
raise Errors.WafError("""\
Unable to find Python module '%s'. Please install the system package or check \
out the relevant submodule by running 'git submodule update --init'.
""" % module)
else:
raise Errors.WafError("""\
Unable to find Python module '%s'. Please install the system package or place a copy in
%s.
""" % (module, package))
else:
conf.COMPOUND_END("bundled")
finally:
sys.path = old_path
def configure(conf):
for module, package in external_pkgs.items():
find_third_party_module(conf, module, package)
conf.RECURSE('cmocka')
conf.RECURSE('popt')
conf.RECURSE('aesni-intel')
if conf.CONFIG_GET('ENABLE_SELFTEST'):
conf.RECURSE('socket_wrapper')
conf.RECURSE('nss_wrapper')
conf.RECURSE('resolv_wrapper')
conf.RECURSE('uid_wrapper')
if Options.options.with_pam:
conf.RECURSE('pam_wrapper')
def build(bld):
if not bld.env.disable_python:
list = []
for module, package in external_pkgs.items():
try:
__import__(module)
except ImportError:
list.append(package)
for e in list:
bld.INSTALL_WILDCARD('${PYTHONARCHDIR}/samba/third_party', e + '/**/*', flat=False,
exclude='*.pyc', trim_path=os.path.dirname(e))
bld.SAMBA_GENERATOR('third_party_init_py',
rule='touch ${TGT}',
target='empty_file')
bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/third_party', 'empty_file', destname='__init__.py')
bld.RECURSE('cmocka')
bld.RECURSE('popt')
bld.RECURSE('aesni-intel')
if bld.CONFIG_GET('SOCKET_WRAPPER'):
bld.RECURSE('socket_wrapper')
if bld.CONFIG_GET('NSS_WRAPPER'):
bld.RECURSE('nss_wrapper')
if bld.CONFIG_GET('RESOLV_WRAPPER'):
bld.RECURSE('resolv_wrapper')
if bld.CONFIG_GET('UID_WRAPPER'):
bld.RECURSE('uid_wrapper')
if bld.CONFIG_GET('PAM_WRAPPER'):
bld.RECURSE('pam_wrapper')