fbb55f0d25ec9199ea23b5a808a5decb13e48da5
[python-purple] / setup.py
1 #!/usr/bin/env python
2
3 from distutils.core import setup
4 from distutils.extension import Extension
5
6 from Cython.Distutils import build_ext
7
8 from subprocess import Popen, PIPE
9
10 cflags = Popen(['pkg-config', '--cflags', 'purple'], stdout=PIPE).communicate()[0].split()
11 ldflags = Popen(['pkg-config', '--libs', 'purple'], stdout=PIPE).communicate()[0].split()
12
13 purplemodule = Extension('purple',
14                          sources=['c_purple.c','purple.pyx'],
15                          extra_compile_args=cflags,
16                          extra_link_args=ldflags)
17
18 long_description = "\
19 Python bindings for libpurple, a multi-protocol instant messaging library."
20
21 class pypurple_build_ext(build_ext):
22     def finalize_options(self):
23         build_ext.finalize_options(self)
24         self.include_dirs.insert(0, 'libpurple')
25         self.pyrex_include_dirs.extend(self.include_dirs)
26
27 setup(name = 'python-purple',
28       version = '0.1',
29       author ='Bruno Abinader',
30       author_email = 'bruno.abinader@openbossa.org',
31       description = 'Python bindings for Purple',
32       long_description = long_description,
33       ext_modules = [purplemodule],
34       cmdclass = {'build_ext': pypurple_build_ext},
35       )