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
30 sys
.path
.append("dbus")
32 from distutils
.core
import setup
33 from distutils
.extension
import Extension
34 from distutils
.command
.clean
import clean
36 sys
.path
.append("test")
37 from dbus_python_check
import dbus_python_check
40 if os
.path
.exists(filename
):
43 class full_clean(clean
):
48 includedirs_flag
= ['-I.']
49 dbus_includes
= ['.', 'include']
50 dbus_glib_includes
= ['.', 'include']
52 pipe
= os
.popen3("pkg-config --cflags dbus-1")
53 output
= pipe
[1].read().strip()
54 error
= pipe
[2].read().strip()
58 print "ERROR: running pkg-config (%s)" % (error
)
60 includedirs_flag
.extend(output
.split())
61 dbus_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
63 pipe
= os
.popen3("pkg-config --cflags dbus-glib-1")
64 output
= pipe
[1].read().strip()
65 error
= pipe
[2].read().strip()
69 print "ERROR: running pkg-config (%s)" % (error
)
71 includedirs_flag
.extend(output
.split())
72 dbus_glib_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
74 #create ChangeLog only if this is a git repo
75 if os
.path
.exists(".git"):
77 pipe
= os
.popen3("git-log --stat")
79 output
= pipe
[1].read().strip()
80 error
= pipe
[2].read().strip()
86 pipe
= os
.popen3("git-log")
87 output
= pipe
[1].read().strip()
88 error
= pipe
[2].read().strip()
91 print "ERROR: running git-log (%s)" % (error
)
97 file = open("ChangeLog", "w")
98 file.writelines(output
)
104 pipe
= os
.popen3("pkg-config --libs-only-L dbus-1")
105 output
= pipe
[1].read().strip()
106 error
= pipe
[2].read().strip()
110 print "ERROR: running pkg-config (%s)" % (error
)
112 dbus_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
114 pipe
= os
.popen3("pkg-config --libs-only-L dbus-glib-1")
115 output
= pipe
[1].read().strip()
116 error
= pipe
[2].read().strip()
120 print "ERROR: running pkg-config (%s)" % (error
)
122 dbus_glib_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
124 long_desc
= '''D-BUS is a message bus system, a simple way for applications to
127 D-BUS supplies both a system daemon (for events such as "new hardware device
128 added" or "printer queue changed") and a per-user-login-session daemon (for
129 general IPC needs among user applications). Also, the message bus is built on
130 top of a general one-to-one message passing framework, which can be used by any
131 two apps to communicate directly (without going through the message bus daemon).
132 Currently the communicating applications are on one computer, but TCP/IP option
133 is available and remote support planned.'''
137 if 'CFLAGS' in os
.environ
:
138 extra_ext_args
['extra_compile_args'] = os
.environ
['CFLAGS'].split()
143 description
='D-Bus Python bindings',
144 long_description
=long_desc
,
145 url
='http://dbus.freedesktop.org/',
146 author
='John (J5) Palmieri',
147 author_email
='johnp@redhat.com',
148 maintainer
='John (J5) Palmieri',
149 maintainer_email
='johnp@redhat.com',
150 package_dir
={'dbus':'dbus'},
160 "dbus/introspect_parser",
164 Extension("_dbus_bindings", ["_dbus_bindings/module.c"],
165 include_dirs
=dbus_includes
,
166 library_dirs
=dbus_libs
,
167 libraries
=["dbus-1"],
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"],
177 cmdclass
={'clean': full_clean
, 'check': dbus_python_check
}
180 # vim:ts=4:sw=4:tw=80:si:ai:showmatch:et