#!/usr/bin/env python
import os, Options
-from samba_utils import TOUCH_FILE, EXPAND_VARIABLES
# work out what python external libraries we need to install
external_libs = {
list = []
-for module, package in external_libs.iteritems():
+for module, package in external_libs.items():
try:
__import__(module)
except ImportError:
bld.INSTALL_WILDCARD('${PYTHONDIR}/samba/external', e + '/**/*', flat=False,
exclude='*.pyc', trim_path=os.path.dirname(e))
-if Options.is_install:
- # we need a blank __init__.py in samba/external
- TOUCH_FILE(bld.EXPAND_VARIABLES('${PYTHONDIR}/samba/external/__init__.py'))
+bld.SAMBA_GENERATOR('external_init_py',
+ rule='touch ${TGT}',
+ target='empty_file')
+
+bld.INSTALL_FILES('${PYTHONDIR}/samba/external', 'empty_file', destname='__init__.py')