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