- Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
106 lines (99 loc) · 3.14 KB
/
Copy pathsetup.py
File metadata and controls
106 lines (99 loc) · 3.14 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/python -u
#
# Python Bindings for libevent
#
# Copyright (c) 2010-2011 by Joachim Bauch, mail@joachim-bauch.de
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
importsys, os
try:
fromsetuptoolsimportsetup, Extension
exceptImportError:
fromez_setupimportuse_setuptools
use_setuptools()
fromsetuptoolsimportsetup, Extension
importversion
LIBEVENT_ROOT=os.environ.get('LIBEVENT_ROOT')
ifLIBEVENT_ROOTisNone:
raiseTypeError('Please set the environment variable LIBEVENT_ROOT ' \
'to the path of your libevent root directory and make sure ' \
'to pass "--with-pic" to configure when building it')
descr="Python bindings for libevent"
modules= [
'libevent',
]
c_files= [
'src/_libevent.c',
'src/pybase.c',
'src/pybuffer.c',
'src/pybufferevent.c',
'src/pyevent.c',
'src/pyhttp.c',
'src/pylistener.c',
]
include_dirs= [
os.path.join(LIBEVENT_ROOT, 'include'),
]
library_dirs= [
]
libraries= [
]
extra_link_args= [
]
ifos.name=='posix':
# enable thread support
extra_link_args.extend([
os.path.join(LIBEVENT_ROOT, '.libs', 'libevent.a'),
os.path.join(LIBEVENT_ROOT, '.libs', 'libevent_pthreads.a'),
'-lrt',
'-lpthread',
])
libraries.append('rt')
libraries.append('pthread')
elifos.name=='nt':
# enable thread support
extra_link_args.extend([
os.path.join(LIBEVENT_ROOT, 'libevent.lib'),
])
libraries.append('ws2_32')
libraries.append('Advapi32')
extens= [
Extension('_libevent', c_files, libraries=libraries,
include_dirs=include_dirs, library_dirs=library_dirs,
extra_link_args=extra_link_args),
]
setup(
name="python-libevent",
version=version.get_git_version(),
description=descr,
author="Joachim Bauch",
author_email="mail@joachim-bauch.de",
url="http://www.joachim-bauch.de/projects/python-libevent/",
download_url="http://pypi.python.org/pypi/python-libevent/",
license='LGPL',
keywords="libevent network",
classifiers= [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
],
py_modules=modules,
ext_modules=extens,
test_suite='tests.suite',
)