-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
72 lines (57 loc) · 2.26 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
import os
import sys
import shutil
from setuptools import setup
from distutils.core import Extension
from distutils.command.build_ext import build_ext
NAME = 'komodo-python-dbgp'
class Dbgp_build_ext(build_ext):
# a fake build_ext, copy our provided pre-built binaries to the right target
def build_extensions(self):
scriptdir = os.path.dirname(os.path.abspath(sys.argv[0]))
# weird, for me plat_name is 'linux-i686' on a 32bit linux
if 'win32' in self.plat_name:
plat = 'win32-x86'
elif 'linux' in self.plat_name:
if '64' in self.plat_name:
plat = 'linux-x86_64'
else:
plat = 'linux-x86'
sourcepath = os.path.join(scriptdir, 'libs', plat)
if os.path.exists(sourcepath):
# not all platforms have binaries
buildpath = os.path.dirname(self.get_ext_fullpath('dbgp._client'))
targetpath = os.path.join(os.getcwd(), buildpath)
for fn in os.listdir(sourcepath):
src = os.path.join(sourcepath, fn)
tgt = os.path.join(targetpath, fn)
shutil.copyfile(src, tgt)
print NAME, "prebuilt binaries were copied"
setup(
name=NAME,
version='11.1.dev0',
description='The ActiveState Komodo DBGP server',
author="Shane Caraveo, Trent Mick",
author_email="komodo-feedback@ActiveState.com",
maintainer='Adam Groszer',
maintainer_email='agroszer@gmail.com',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.4",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: Implementation :: CPython",
],
url='http://github.com/agroszer/komodo-python-dbgp',
packages=['dbgp'],
scripts=['bin/pydbgp',
'bin/pydbgpproxy'],
zip_safe=False,
ext_modules=[Extension("dbgp._client", ["_client.c"])], # dummy
cmdclass={"build_ext": Dbgp_build_ext}, # WE provide our own build
)