fixed application of config settings.
[tore.git] / setup.py
blob14b68eb62056a7c9b2f48b6dc5374bfc69bd8154
1 from setuptools import setup, find_packages, Extension
2 from setuptools import setup, find_packages, Extension
4 #from distutils.core import setup, Extension
6 import platform
7 import glob
8 import os
10 python_version = platform.python_version()[0:3]
12 # The libtorrent extension
13 _extra_compile_args = [
14 "-Wno-missing-braces",
15 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP",
16 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP",
17 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP",
18 "-DTORRENT_LINKING_SHARED",
19 "-DTORRENT_BUILDING_SHARED",
20 #"-DNDEBUG",
21 "-g",
22 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
23 "-DBOOST_THREAD_USE_LIB",
24 "-D_FILE_OFFSET_BITS=64",
25 "-DHAVE_PTHREAD",
26 "-DTORRENT_USE_OPENSSL",
27 "-DHAVE_SSL",
28 "-DTORRENT_DISABLE_GEO_IP",
31 _include_dirs = [
32 './libtorrent',
33 './libtorrent/include',
34 './libtorrent/include/libtorrent',
35 '/usr/include/python' + python_version,
36 '/opt/local/include/'
39 _libraries = [
40 'boost_filesystem-mt',
41 'boost_date_time-mt',
42 'boost_thread-mt',
43 'boost_python-mt',
44 'boost_iostreams-mt',
45 #'boost_system-mt',
46 #'GeoIP',
47 'z',
48 'pthread',
49 'ssl'
52 _sources = glob.glob("./libtorrent/src/*.cpp") + \
53 glob.glob("./libtorrent/src/kademlia/*.cpp") + \
54 glob.glob("./libtorrent/bindings/python/src/*.cpp")
56 for source in _sources:
57 if "file_win.cpp" in source:
58 _sources.remove(source)
59 break
61 libtorrent = Extension(
62 'libtorrent',
63 include_dirs = _include_dirs,
64 library_dirs = ["/opt/local/lib/"],
65 libraries = _libraries,
66 extra_compile_args = _extra_compile_args,
67 sources = _sources,
68 define_macros = []
71 pytx = Extension(
72 'pytx',
73 sources = glob.glob("./pytx/*.c"),
74 libraries = ['ncurses', 'panel'],
75 extra_compile_args = ['-g']
78 setup(
79 name = "tore",
80 fullname = "Tore: client/daemon bittorrent software shipped with a NCurses client",
81 version = "0.3",
82 author = "Josh Davis",
83 author_email = "sivad77@gmail.com",
84 include_package_data = True,
85 description = "Curses bittorrent client/daemon",
86 ext_modules = [pytx, libtorrent],
87 entry_points = """
88 [console_scripts]
89 tord = tord.tord:main
90 torc = torc.torc:main
91 """