_dbus_bindings: debug-impl.h -> debug.c
[dbus-python-phuang.git] / setup.py
blobd9da7fbb4cbf67a708e0f1fea3c188ae5b06c163
1 # Copyright (C) 2003, 2004, 2005, 2006 Red Hat Inc. <http://www.redhat.com/>
2 # Copyright (C) 2003 David Zeuthen
3 # Copyright (C) 2004 Rob Taylor
4 # Copyright (C) 2005, 2006 Collabora Ltd. <http://www.collabora.co.uk/>
5 # Copyright (C) 2006 Osvaldo Santana Neto
6 # Copyright (C) 2006 Joseph Sacco
8 # Licensed under the Academic Free License version 2.1
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 import os
28 import sys
30 sys.path.append("dbus")
32 from distutils.core import setup
33 from distutils.extension import Extension
35 sys.path.append("test")
36 from dbus_python_check import dbus_python_check
38 includedirs_flag = ['-I.']
39 dbus_includes = ['.', 'include']
40 dbus_glib_includes = ['.', 'include']
42 pipe = os.popen3("pkg-config --cflags dbus-1")
43 output = pipe[1].read().strip()
44 error = pipe[2].read().strip()
45 for p in pipe:
46 p.close()
47 if error:
48 print "ERROR: running pkg-config (%s)" % (error)
49 raise SystemExit
50 includedirs_flag.extend(output.split())
51 dbus_includes.extend([ x.replace("-I", "") for x in output.split() ])
53 pipe = os.popen3("pkg-config --cflags dbus-glib-1")
54 output = pipe[1].read().strip()
55 error = pipe[2].read().strip()
56 for p in pipe:
57 p.close()
58 if error:
59 print "ERROR: running pkg-config (%s)" % (error)
60 raise SystemExit
61 includedirs_flag.extend(output.split())
62 dbus_glib_includes.extend([ x.replace("-I", "") for x in output.split() ])
64 #create ChangeLog only if this is a git repo
65 if os.path.exists(".git"):
66 pipe = ""
67 pipe = os.popen3("git-log --stat")
69 output = pipe[1].read().strip()
70 error = pipe[2].read().strip()
72 if error:
73 for p in pipe:
74 p.close()
76 pipe = os.popen3("git-log")
77 output = pipe[1].read().strip()
78 error = pipe[2].read().strip()
80 if error:
81 print "ERROR: running git-log (%s)" % (error)
82 raise SystemExit
84 for p in pipe:
85 p.close()
87 file = open("ChangeLog", "w")
88 file.writelines(output)
89 file.close()
91 dbus_libs = []
92 dbus_glib_libs = []
94 pipe = os.popen3("pkg-config --libs-only-L dbus-1")
95 output = pipe[1].read().strip()
96 error = pipe[2].read().strip()
97 for p in pipe:
98 p.close()
99 if error:
100 print "ERROR: running pkg-config (%s)" % (error)
101 raise SystemExit
102 dbus_libs.extend([ x.replace("-L", "") for x in output.split() ])
104 pipe = os.popen3("pkg-config --libs-only-L dbus-glib-1")
105 output = pipe[1].read().strip()
106 error = pipe[2].read().strip()
107 for p in pipe:
108 p.close()
109 if error:
110 print "ERROR: running pkg-config (%s)" % (error)
111 raise SystemExit
112 dbus_glib_libs.extend([ x.replace("-L", "") for x in output.split() ])
114 long_desc = '''D-BUS is a message bus system, a simple way for applications to
115 talk to one another.
117 D-BUS supplies both a system daemon (for events such as "new hardware device
118 added" or "printer queue changed") and a per-user-login-session daemon (for
119 general IPC needs among user applications). Also, the message bus is built on
120 top of a general one-to-one message passing framework, which can be used by any
121 two apps to communicate directly (without going through the message bus daemon).
122 Currently the communicating applications are on one computer, but TCP/IP option
123 is available and remote support planned.'''
125 extra_ext_args = {}
127 if 'CFLAGS' in os.environ:
128 extra_ext_args['extra_compile_args'] = os.environ['CFLAGS'].split()
130 setup(
131 name='dbus-python',
132 version='0.80rc1',
133 description='D-Bus Python bindings',
134 long_description=long_desc,
135 url='http://dbus.freedesktop.org/',
136 author='John (J5) Palmieri',
137 author_email='johnp@redhat.com',
138 maintainer='John (J5) Palmieri',
139 maintainer_email='johnp@redhat.com',
140 package_dir={'dbus':'dbus'},
141 py_modules=[
142 "dbus_bindings",
143 "dbus/dbus_bindings",
144 "dbus/_dbus",
145 "dbus/exceptions",
146 "dbus/glib",
147 "dbus/__init__",
148 "dbus/service",
149 "dbus/types",
150 "dbus/decorators",
151 "dbus/introspect_parser",
152 "dbus/proxies",
153 "dbus/lowlevel",
154 "dbus/mainloop/__init__",
155 "dbus/mainloop/glib",
157 ext_modules=[
158 Extension("_dbus_bindings", [
159 "_dbus_bindings/module.c",
160 "_dbus_bindings/conn.c",
161 "_dbus_bindings/conn-methods.c",
162 "_dbus_bindings/debug.c",
163 "_dbus_bindings/bus.c",
165 include_dirs=dbus_includes,
166 library_dirs=dbus_libs,
167 libraries=["dbus-1"],
168 **extra_ext_args
170 Extension("_dbus_glib_bindings", ["_dbus_glib_bindings/module.c"],
171 include_dirs=dbus_glib_includes,
172 library_dirs=dbus_glib_libs,
173 libraries=["dbus-glib-1", "dbus-1", "glib-2.0"],
174 **extra_ext_args
177 cmdclass={'check': dbus_python_check}
180 # vim:ts=4:sw=4:tw=80:si:ai:showmatch:et