4 sys
.path
.append("dbus")
6 from distutils
.core
import setup
7 from distutils
.extension
import Extension
8 from distutils
.command
.clean
import clean
9 from Pyrex
.Distutils
import build_ext
13 sys
.path
.append("test")
14 from dbus_python_check
import dbus_python_check
17 if os
.path
.exists(filename
):
20 class full_clean(clean
):
23 remove("dbus/extract.pyo")
24 remove("dbus/_dbus_bindings.pxd")
25 remove("dbus/_dbus_bindings.c")
26 remove("dbus/_dbus_glib_bindings.c")
29 includedirs_flag
= ['-I.']
31 dbus_glib_includes
= ['.']
33 pipe
= os
.popen3("pkg-config --cflags dbus-1")
34 output
= pipe
[1].read().strip()
35 error
= pipe
[2].read().strip()
39 print "ERROR: running pkg-config (%s)" % (error
)
41 includedirs_flag
.extend(output
.split())
42 dbus_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
44 pipe
= os
.popen3("pkg-config --cflags dbus-glib-1")
45 output
= pipe
[1].read().strip()
46 error
= pipe
[2].read().strip()
50 print "ERROR: running pkg-config (%s)" % (error
)
52 includedirs_flag
.extend(output
.split())
53 dbus_glib_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
55 #create ChangeLog only if this is a git repo
56 if os
.path
.exists(".git"):
58 pipe
= os
.popen3("git-log --stat")
60 output
= pipe
[1].read().strip()
61 error
= pipe
[2].read().strip()
67 pipe
= os
.popen3("git-log")
68 output
= pipe
[1].read().strip()
69 error
= pipe
[2].read().strip()
72 print "ERROR: running git-log (%s)" % (error
)
78 file = open("ChangeLog", "w")
79 file.writelines(output
)
85 pipe
= os
.popen3("pkg-config --libs-only-L dbus-1")
86 output
= pipe
[1].read().strip()
87 error
= pipe
[2].read().strip()
91 print "ERROR: running pkg-config (%s)" % (error
)
93 dbus_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
95 pipe
= os
.popen3("pkg-config --libs-only-L dbus-glib-1")
96 output
= pipe
[1].read().strip()
97 error
= pipe
[2].read().strip()
101 print "ERROR: running pkg-config (%s)" % (error
)
103 dbus_glib_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
105 output
= open("dbus/_dbus_bindings.pxd", 'w')
106 includedirs_flag
.append('-Idbus/')
107 extract
.main("dbus/_dbus_bindings.pxd.in", includedirs_flag
, output
)
110 long_desc
= '''D-BUS is a message bus system, a simple way for applications to
113 D-BUS supplies both a system daemon (for events such as "new hardware device
114 added" or "printer queue changed") and a per-user-login-session daemon (for
115 general IPC needs among user applications). Also, the message bus is built on
116 top of a general one-to-one message passing framework, which can be used by any
117 two apps to communicate directly (without going through the message bus daemon).
118 Currently the communicating applications are on one computer, but TCP/IP option
119 is available and remote support planned.'''
124 description
='D-Bus Python bindings',
125 long_description
=long_desc
,
126 url
='http://dbus.freedesktop.org/',
127 author
='John (J5) Palmieri',
128 author_email
='johnp@redhat.com',
129 maintainer
='John (J5) Palmieri',
130 maintainer_email
='johnp@redhat.com',
131 package_dir
={'dbus':'dbus'},
141 "dbus/introspect_parser",
146 Extension("_dbus_bindings", ["dbus/_dbus_bindings.pyx"],
147 include_dirs
=dbus_includes
,
148 library_dirs
=dbus_libs
,
149 libraries
=["dbus-1"],
152 Extension("_dbus_glib_bindings", ["dbus/_dbus_glib_bindings.pyx"],
153 include_dirs
=dbus_glib_includes
,
154 library_dirs
=dbus_glib_libs
,
155 libraries
=["dbus-glib-1", "dbus-1", "glib-2.0"],
157 ('DBUS_API_SUBJECT_TO_CHANGE', '1')
161 cmdclass
={'build_ext': build_ext
, 'clean': full_clean
, 'check': dbus_python_check
}
164 # vim:ts=4:sw=4:tw=80:si:ai:showmatch:et