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
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
41 if os
.path
.exists(filename
):
44 class full_clean(clean
):
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()
59 print "ERROR: running pkg-config (%s)" % (error
)
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()
70 print "ERROR: running pkg-config (%s)" % (error
)
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"):
78 pipe
= os
.popen3("git-log --stat")
80 output
= pipe
[1].read().strip()
81 error
= pipe
[2].read().strip()
87 pipe
= os
.popen3("git-log")
88 output
= pipe
[1].read().strip()
89 error
= pipe
[2].read().strip()
92 print "ERROR: running git-log (%s)" % (error
)
98 file = open("ChangeLog", "w")
99 file.writelines(output
)
105 pipe
= os
.popen3("pkg-config --libs-only-L dbus-1")
106 output
= pipe
[1].read().strip()
107 error
= pipe
[2].read().strip()
111 print "ERROR: running pkg-config (%s)" % (error
)
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()
121 print "ERROR: running pkg-config (%s)" % (error
)
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
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.'''
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'},
156 "dbus/introspect_parser",
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