Build.BuildContext.IS_NEWER = IS_NEWER
-def TOUCH_FILE(file, install_dir=False):
- '''touch a file'''
- if install_dir:
- if file[0] == '/':
- file = Options.options.destdir + file
- else:
- file = Options.options.destdir + '/' + file
- mkdir_p(os.path.dirname(file))
- f = open(file, 'w')
- f.close()
-
-
-
@conf
def RECURSE(ctx, directory):
'''recurse into a directory, relative to the curdir or top level'''
Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
-def SAMBA_GENERATOR(bld, name, rule, source, target,
+def SAMBA_GENERATOR(bld, name, rule, source='', target='',
group='generators', enabled=True,
public_headers=None,
header_path=None,
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'),
- install_dir=True)
+bld.SAMBA_GENERATOR('external_init_py',
+ rule='touch ${TGT}',
+ target='empty_file')
+
+bld.INSTALL_FILES('${PYTHONDIR}/samba/external', 'empty_file', destname='__init__.py')