Move configure part of third party to third_party/wscript.
[samba.git] / third_party / wscript
1 #!/usr/bin/env python
2
3 import os
4
5 # work out what python external libraries we need to install
6 external_libs = {
7     "dns.resolver": "dnspython/dns",
8     "iso8601": "pyiso8601/iso8601",
9     }
10
11
12 def configure(conf):
13     conf.RECURSE('popt')
14     conf.RECURSE('zlib')
15
16
17 def build(bld):
18     list = []
19
20     for module, package in external_libs.items():
21         try:
22             __import__(module)
23         except ImportError:
24             list.append(package)
25
26     for e in list:
27         bld.INSTALL_WILDCARD('${PYTHONARCHDIR}/samba/third_party', e + '/**/*', flat=False,
28                              exclude='*.pyc', trim_path=os.path.dirname(e))
29
30     bld.SAMBA_GENERATOR('third_party_init_py',
31                         rule='touch ${TGT}',
32                         target='empty_file')
33
34     bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/third_party', 'empty_file', destname='__init__.py')
35     bld.RECURSE('zlib')
36     bld.RECURSE('popt')