4 sys
.path
.append("dbus")
6 from distutils
.core
import setup
7 from distutils
.extension
import Extension
8 from distutils
.command
.clean
import clean
12 sys
.path
.append("test")
13 from dbus_python_check
import dbus_python_check
16 if os
.path
.exists(filename
):
19 class full_clean(clean
):
24 includedirs_flag
= ['-I.']
25 dbus_includes
= ['.', 'include']
26 dbus_glib_includes
= ['.', 'include']
28 pipe
= os
.popen3("pkg-config --cflags dbus-1")
29 output
= pipe
[1].read().strip()
30 error
= pipe
[2].read().strip()
34 print "ERROR: running pkg-config (%s)" % (error
)
36 includedirs_flag
.extend(output
.split())
37 dbus_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
39 pipe
= os
.popen3("pkg-config --cflags dbus-glib-1")
40 output
= pipe
[1].read().strip()
41 error
= pipe
[2].read().strip()
45 print "ERROR: running pkg-config (%s)" % (error
)
47 includedirs_flag
.extend(output
.split())
48 dbus_glib_includes
.extend([ x
.replace("-I", "") for x
in output
.split() ])
50 #create ChangeLog only if this is a git repo
51 if os
.path
.exists(".git"):
53 pipe
= os
.popen3("git-log --stat")
55 output
= pipe
[1].read().strip()
56 error
= pipe
[2].read().strip()
62 pipe
= os
.popen3("git-log")
63 output
= pipe
[1].read().strip()
64 error
= pipe
[2].read().strip()
67 print "ERROR: running git-log (%s)" % (error
)
73 file = open("ChangeLog", "w")
74 file.writelines(output
)
80 pipe
= os
.popen3("pkg-config --libs-only-L dbus-1")
81 output
= pipe
[1].read().strip()
82 error
= pipe
[2].read().strip()
86 print "ERROR: running pkg-config (%s)" % (error
)
88 dbus_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
90 pipe
= os
.popen3("pkg-config --libs-only-L dbus-glib-1")
91 output
= pipe
[1].read().strip()
92 error
= pipe
[2].read().strip()
96 print "ERROR: running pkg-config (%s)" % (error
)
98 dbus_glib_libs
.extend([ x
.replace("-L", "") for x
in output
.split() ])
100 long_desc
= '''D-BUS is a message bus system, a simple way for applications to
103 D-BUS supplies both a system daemon (for events such as "new hardware device
104 added" or "printer queue changed") and a per-user-login-session daemon (for
105 general IPC needs among user applications). Also, the message bus is built on
106 top of a general one-to-one message passing framework, which can be used by any
107 two apps to communicate directly (without going through the message bus daemon).
108 Currently the communicating applications are on one computer, but TCP/IP option
109 is available and remote support planned.'''
114 description
='D-Bus Python bindings',
115 long_description
=long_desc
,
116 url
='http://dbus.freedesktop.org/',
117 author
='John (J5) Palmieri',
118 author_email
='johnp@redhat.com',
119 maintainer
='John (J5) Palmieri',
120 maintainer_email
='johnp@redhat.com',
121 package_dir
={'dbus':'dbus'},
131 "dbus/introspect_parser",
136 Extension("_dbus_bindings", ["_dbus_bindings/module.c"],
137 include_dirs
=dbus_includes
,
138 library_dirs
=dbus_libs
,
139 libraries
=["dbus-1"],
141 Extension("_dbus_glib_bindings", ["_dbus_glib_bindings/module.c"],
142 include_dirs
=dbus_glib_includes
,
143 library_dirs
=dbus_glib_libs
,
144 libraries
=["dbus-glib-1", "dbus-1", "glib-2.0"],
147 cmdclass
={'clean': full_clean
, 'check': dbus_python_check
}
150 # vim:ts=4:sw=4:tw=80:si:ai:showmatch:et