s4-waf: updates for the new python installer from jelmer
authorAndrew Tridgell <tridge@samba.org>
Thu, 1 Apr 2010 13:13:26 +0000 (00:13 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:22 +0000 (20:27 +1000)
buildtools/wafsamba/wafsamba.py
source4/scripting/python/samba_external/wscript_build [deleted file]
source4/scripting/python/wscript_build
source4/wscript_build

index 4658c59aeb6df4723cae4e0e43ee4906c277afea..dc91336c903821c2abe66503251dce13ee3917bc 100644 (file)
@@ -534,7 +534,7 @@ Build.BuildContext.SAMBA_SCRIPT = SAMBA_SCRIPT
 
 
 def install_file(bld, destdir, file, chmod=0644, flat=False,
-                 python_fixup=False, destname=None):
+                 python_fixup=False, destname=None, base_name=None):
     '''install a file'''
     destdir = bld.EXPAND_VARIABLES(destdir)
     if not destname:
@@ -550,27 +550,37 @@ def install_file(bld, destdir, file, chmod=0644, flat=False,
                             source=file,
                             target=inst_file)
         file = inst_file
+    if base_name:
+        file = os.path.join(base_name, file)
     bld.install_as(dest, file, chmod=chmod)
 
 
 def INSTALL_FILES(bld, destdir, files, chmod=0644, flat=False,
-                  python_fixup=False, destname=None):
+                  python_fixup=False, destname=None, base_name=None):
     '''install a set of files'''
     for f in TO_LIST(files):
         install_file(bld, destdir, f, chmod=chmod, flat=flat,
-                     python_fixup=python_fixup, destname=destname)
+                     python_fixup=python_fixup, destname=destname,
+                     base_name=base_name)
 Build.BuildContext.INSTALL_FILES = INSTALL_FILES
 
 
 def INSTALL_WILDCARD(bld, destdir, pattern, chmod=0644, flat=False,
-                     python_fixup=False, exclude=None):
+                     python_fixup=False, exclude=None, trim_path=None):
     '''install a set of files matching a wildcard pattern'''
     files=TO_LIST(bld.path.ant_glob(pattern))
+    if trim_path:
+        files2 = []
+        for f in files:
+            files2.append(os_path_relpath(f, trim_path))
+        files = files2
+
     if exclude:
         for f in files[:]:
             if fnmatch.fnmatch(f, exclude):
                 files.remove(f)
-    INSTALL_FILES(bld, destdir, files, chmod=chmod, flat=flat, python_fixup=python_fixup)
+    INSTALL_FILES(bld, destdir, files, chmod=chmod, flat=flat,
+                  python_fixup=python_fixup, base_name=trim_path)
 Build.BuildContext.INSTALL_WILDCARD = INSTALL_WILDCARD
 
 
diff --git a/source4/scripting/python/samba_external/wscript_build b/source4/scripting/python/samba_external/wscript_build
deleted file mode 100644 (file)
index 45e00d0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-
-# work out what external modules need to be installed
-external_list = []
-try:
-    import dns.resolver
-except:
-    external_list.append("dnspython")
-
-for e in external_list:
-    bld.INSTALL_WILDCARD('${PYTHONDIR}/samba_external', e + '/**/*', flat=False, exclude='*.pyc')
index 0d0fabd54e7c6f006d6b1a4bcbc1cd4a8761f74a..2a09869a210d4bd3e0cf374783fd3f96026332bb 100644 (file)
@@ -39,6 +39,4 @@ bld.SAMBA_SCRIPT('samba_python',
                  pattern='samba/**/*.py',
                  installdir='python')
 
-bld.BUILD_SUBDIR('samba_external')
-
 bld.INSTALL_WILDCARD('${PYTHONDIR}', 'samba/**/*.py', flat=False)
index a8b0375d2fde6445cb6c7d6c495bf440eeb066a8..f3b20eab36e636e7e5cbeb914cce78308b9987ef 100644 (file)
@@ -116,3 +116,4 @@ bld.BUILD_SUBDIR('../codepages')
 bld.BUILD_SUBDIR('setup')
 bld.BUILD_SUBDIR('scripting')
 bld.BUILD_SUBDIR('../pidl')
+bld.BUILD_SUBDIR('../lib')