s4-waf: replace TOUCH_FILE() with normal install rules
[kai/samba.git] / lib / wscript_build
1 #!/usr/bin/env python
2
3 import os, Options
4 from samba_utils import TOUCH_FILE, EXPAND_VARIABLES
5
6 # work out what python external libraries we need to install
7 external_libs = {
8     "dns.resolver": "dnspython/dns",
9     "subunit": "subunit/python/subunit",
10     "testtools": "testtools/testtools"}
11
12 list = []
13
14 for module, package in external_libs.iteritems():
15     try:
16         __import__(module)
17     except ImportError:
18         list.append(package)
19
20 for e in list:
21     bld.INSTALL_WILDCARD('${PYTHONDIR}/samba/external', e + '/**/*', flat=False,
22                          exclude='*.pyc', trim_path=os.path.dirname(e))
23
24 bld.SAMBA_GENERATOR('external_init_py',
25                     rule='touch ${TGT}',
26                     target='empty_file')
27
28 bld.INSTALL_FILES('${PYTHONDIR}/samba/external', 'empty_file', destname='__init__.py')