s4-waf: added new install system for external python libs
authorAndrew Tridgell <tridge@samba.org>
Thu, 1 Apr 2010 21:47:38 +0000 (08:47 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:22 +0000 (20:27 +1000)
lib/wscript_build [new file with mode: 0644]

diff --git a/lib/wscript_build b/lib/wscript_build
new file mode 100644 (file)
index 0000000..c47dfc0
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+import os
+
+# work out what python external libraries we need to install
+external_libs = {
+    "dns.resolver": "dnspython/dns",
+    "subunit": "subunit/python/subunit",
+    "testtools": "testtools/testtools"}
+
+list = []
+
+for module, package in external_libs.iteritems():
+    try:
+        __import__(module)
+    except ImportError:
+        list.append(package)
+
+for e in list:
+    bld.INSTALL_WILDCARD('${PYTHONDIR}', e + '/**/*', flat=False,
+                         exclude='*.pyc', trim_path=os.path.dirname(e))