summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRobert McQueen <robot101@thubuntu.(none)>2006-07-12 21:53:57 +0100
committerRobert McQueen <robot101@thubuntu.(none)>2006-07-12 21:53:57 +0100
commit82a4e8afb8ca163416f602fdb1df96b11765ecb2 (patch)
tree3950f361a7eb204916788df49c6d54c656bb8ce0 /setup.py
parent172f80244f21a681609e6918c1f043b3272949f3 (diff)
downloaddbus-python-82a4e8afb8ca163416f602fdb1df96b11765ecb2.tar.gz
setup.py, dbus/extract.py: Patch from Osvaldo Santana Neto
<osvaldo.santana@indt.org.br> to make the python bindings build and install with distutils. Not quite working yet because of path madness with the extract.py stuff.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py108
1 files changed, 108 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..cb642df
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,108 @@
+import os
+import sys
+
+sys.path.append("dbus")
+
+from distutils.core import setup
+from distutils.extension import Extension
+from distutils.command.clean import clean
+from Pyrex.Distutils import build_ext
+
+import extract
+
+def remove(filename):
+ if os.path.exists(filename):
+ os.remove(filename)
+
+class full_clean(clean):
+ def run(self):
+ clean.run(self)
+ remove("dbus/extract.pyo")
+ remove("dbus/dbus_bindings.pxd")
+ remove("dbus/dbus_bindings.c")
+ remove("dbus/dbus_glib_bindings.c")
+
+includedirs_flag = ['-I.']
+dbus_includes = ['.']
+dbus_glib_includes = ['.']
+
+pipe = os.popen3("pkg-config --cflags dbus-1")
+output = pipe[1].read().strip()
+error = pipe[2].read().strip()
+for p in pipe:
+ p.close()
+if error:
+ print "ERROR: running pkg-config (%s)" % (error)
+ raise SystemExit
+includedirs_flag.extend(output.split())
+dbus_includes.extend([ x.replace("-I", "") for x in output.split() ])
+
+pipe = os.popen3("pkg-config --cflags dbus-glib-1")
+output = pipe[1].read().strip()
+error = pipe[2].read().strip()
+for p in pipe:
+ p.close()
+if error:
+ print "ERROR: running pkg-config (%s)" % (error)
+ raise SystemExit
+includedirs_flag.extend(output.split())
+dbus_glib_includes.extend([ x.replace("-I", "") for x in output.split() ])
+
+output = open("dbus/dbus_bindings.pxd", 'w')
+includedirs_flag.append('dbus')
+extract.main("dbus/dbus_bindings.pxd.in", includedirs_flag, output)
+output.close()
+
+long_desc = '''D-BUS is a message bus system, a simple way for applications to
+talk to one another.
+
+D-BUS supplies both a system daemon (for events such as "new hardware device
+added" or "printer queue changed") and a per-user-login-session daemon (for
+general IPC needs among user applications). Also, the message bus is built on
+top of a general one-to-one message passing framework, which can be used by any
+two apps to communicate directly (without going through the message bus daemon).
+Currently the communicating applications are on one computer, but TCP/IP option
+is available and remote support planned.'''
+
+setup(
+ name='dbus',
+ version='0.70',
+ description='D-Bus Python bindings',
+ long_description=long_desc,
+ url='http://dbus.freedesktop.org/',
+ author='John (J5) Palmieri',
+ author_email='johnp@redhat.com',
+ maintainer='Osvaldo Santana Neto',
+ maintainer_email='osvaldo.santana@indt.org.br',
+ package_dir={'':'dbus'},
+ py_modules=[
+ "_dbus",
+ "exceptions",
+ "glib",
+ "__init__",
+ "matchrules",
+ "service",
+ "types",
+ "decorators",
+ "introspect_parser",
+ "proxies",
+ "_util",
+ ],
+ ext_modules=[
+ Extension("dbus_bindings", ["dbus/dbus_bindings.pyx"],
+ include_dirs=dbus_includes,
+ libraries=["dbus-1"],
+
+ ),
+ Extension("dbus_glib_bindings", ["dbus/dbus_glib_bindings.pyx"],
+ include_dirs=dbus_glib_includes,
+ libraries=["dbus-glib-1", "dbus-1", "glib-2.0"],
+ define_macros=[
+ ('DBUS_API_SUBJECT_TO_CHANGE', '1')
+ ],
+ ),
+ ],
+ cmdclass={'build_ext': build_ext, 'clean': full_clean}
+)
+
+# vim:ts=4:sw=4:tw=80:si:ai:showmatch:et