LT SYNC (BUT BUGGY)
[tore.git] / setup.py
blob8fecb35290299f79087f609f3c6504910cc4b1e6
1 from setuptools import setup, find_packages, Extension
2 from setuptools import setup, find_packages, Extension
3 import platform
4 import glob
5 import os
7 python_version = platform.python_version()[0:3]
9 # The libtorrent extension
10 _extra_compile_args = [
11 "-Wno-missing-braces",
12 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP",
13 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP",
14 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP",
15 "-DTORRENT_LINKING_SHARED",
16 "-DTORRENT_BUILDING_SHARED",
17 "-DNDEBUG",
18 "-g",
19 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
20 "-DBOOST_THREAD_USE_LIB",
21 "-D_FILE_OFFSET_BITS=64",
22 "-DHAVE_PTHREAD",
23 "-DTORRENT_USE_OPENSSL",
24 "-DHAVE_SSL",
25 "-DTORRENT_DISABLE_GEO_IP",
28 _include_dirs = [
29 './libtorrent',
30 './libtorrent/include',
31 './libtorrent/include/libtorrent',
32 '/usr/include/python' + python_version,
33 '/opt/local/include/'
36 _libraries = [
37 'boost_filesystem-mt',
38 'boost_date_time-mt',
39 'boost_thread-mt',
40 'boost_python-mt',
41 'boost_iostreams-mt',
42 #'boost_system-mt',
43 #'GeoIP',
44 'z',
45 'pthread',
46 'ssl'
49 _sources = glob.glob("./libtorrent/src/*.cpp") + \
50 glob.glob("./libtorrent/src/kademlia/*.cpp") + \
51 glob.glob("./libtorrent/bindings/python/src/*.cpp")
53 for source in _sources:
54 if "file_win.cpp" in source:
55 _sources.remove(source)
56 break
58 libtorrent = Extension(
59 'libtorrent',
60 include_dirs = _include_dirs,
61 library_dirs = ["/opt/local/lib/"],
62 libraries = _libraries,
63 extra_compile_args = _extra_compile_args,
64 sources = _sources,
65 define_macros = []
68 pytx = Extension(
69 'pytx',
70 sources = glob.glob("./pytx/*.c"),
71 libraries = ['ncurses', 'panel'],
74 setup(
75 name = "tore",
76 fullname = "Tore: client/daemon bittorrent software shipped with a NCurses client",
77 version = "0.3",
78 author = "Josh Davis",
79 author_email = "sivad77@gmail.com",
80 include_package_data = True,
81 description = "Curses bittorrent client/daemon",
82 ext_modules = [pytx, libtorrent],
83 entry_points = """
84 [console_scripts]
85 tord = tord.tord:main
86 torc = torc.torc:main
87 """