lib: Make async_sock includable on its own
[kai/samba.git] / lib / wscript_build
index 44bf8108c8341e8a5fce0e8fbfd42214301c099e..97c3cfa2404cf857a8c8fa812b6fda1148648e55 100644 (file)
@@ -1,7 +1,6 @@
 #!/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 = {
@@ -11,17 +10,25 @@ external_libs = {
 
 list = []
 
-for module, package in external_libs.iteritems():
+for module, package in external_libs.items():
     try:
         __import__(module)
     except ImportError:
         list.append(package)
 
 for e in list:
-    bld.INSTALL_WILDCARD('${PYTHONDIR}/samba/external', e + '/**/*', flat=False,
+    bld.INSTALL_WILDCARD('${PYTHONARCHDIR}/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('${PYTHONARCHDIR}/samba/external', 'empty_file', destname='__init__.py')
+
+# a grouping library for event and socket related subsystems
+bld.SAMBA_LIBRARY('samba-sockets',
+                  source=[],
+                  private_library=True,
+                  grouping_library=True,
+                  deps='LIBTSOCKET samba_socket tevent-util')