Added hacker's method to install libelliptics_python.so into python dir
[elliptics.git] / bindings / python / setup.py
blob8ac907fa409e116aaee9804cd87fd5128f356b19
1 #!/usr/bin/env python
3 from distutils.core import setup
4 from distutils.core import Extension
6 from distutils.command.build_ext import build_ext as _build_ext
7 from distutils.command.install_lib import install_lib as _install_lib
9 class build_ext(_build_ext):
10 def run(self):
11 pass
14 class install_lib(_install_lib):
15 def run(self):
16 self.mkpath(self.install_dir)
17 self.copy_file('libelliptics_python.so', self.install_dir)
19 _install_lib.run(self)
21 vstr = '0.0.1'
22 try:
23 f = open('../../CMakeLists.txt')
25 for qstr in f:
26 if 'ELLIPTICS_VERSION_ABI' in qstr:
27 vstr = qstr.split()[1].split(')')[0].strip('"')
28 break
29 f.close()
30 except:
31 pass
33 setup(name='elliptics',
34 version=vstr,
35 description='Elliptics - client library for distributed storage system',
36 url='http://www.ioremap.net/projects/elliptics',
37 py_modules=['elliptics'],
38 license = 'GPLv2',
39 cmdclass={'build_ext': build_ext, 'install_lib' : install_lib},
40 ext_modules=[Extension('libelliptics_python', [])],