clear screen on exit
[tore.git] / setup.py
blobfe9214d4ab1592b821f4b5a202f3f18e1e9bbbab
1 from setuptools import setup, find_packages, Extension
2 from setuptools import setup, find_packages, Extension
3 from distutils import sysconfig
5 #from distutils.core import setup, Extension
7 import platform
8 import glob
9 import os
11 python_version = platform.python_version()[0:3]
14 for remove in ['-g', '-Wstrict-prototypes']:
15 sysconfig.get_config_vars()["CFLAGS"] = sysconfig.get_config_vars()["CFLAGS"].replace(remove, " ")
17 # The libtorrent extension
18 _extra_compile_args = [
19 "-Wno-missing-braces",
20 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP",
21 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP",
22 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP",
23 "-DTORRENT_LINKING_SHARED",
24 "-DTORRENT_BUILDING_SHARED",
25 #"-DNDEBUG",
26 "-g",
27 #"-pg",
28 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
29 "-DBOOST_THREAD_USE_LIB",
30 "-D_FILE_OFFSET_BITS=64",
31 "-DHAVE_PTHREAD",
32 "-DTORRENT_USE_OPENSSL",
33 "-DHAVE_SSL",
34 "-DTORRENT_DISABLE_GEO_IP",
37 _include_dirs = [
38 './libtorrent',
39 './libtorrent/include',
40 './libtorrent/include/libtorrent',
41 '/usr/include/python' + python_version,
42 '/opt/local/include/'
45 _libraries = [
46 'boost_filesystem-mt',
47 'boost_date_time-mt',
48 'boost_thread-mt',
49 'boost_python-mt',
50 'boost_iostreams-mt',
51 #'boost_system-mt',
52 #'GeoIP',
53 'z',
54 'pthread',
55 'ssl'
58 _sources = glob.glob("./libtorrent/src/*.cpp") + \
59 glob.glob("./libtorrent/src/kademlia/*.cpp") + \
60 glob.glob("./libtorrent/bindings/python/src/*.cpp")
62 for source in _sources:
63 if "file_win.cpp" in source: _sources.remove(source)
64 if "mapped_storage.cpp" in source: _sources.remove(source)
66 libtorrent = Extension(
67 'libtorrent',
68 include_dirs = _include_dirs,
69 library_dirs = ["/opt/local/lib/"],
70 libraries = _libraries,
71 extra_compile_args = _extra_compile_args,
72 sources = _sources,
73 define_macros = []
76 pytx = Extension(
77 'pytx',
78 sources = glob.glob("./pytx/*.c"),
79 libraries = ['ncurses', 'panel'],
80 extra_compile_args = ['-g', '-pg']
83 setup(
84 name = "tore",
85 fullname = "Tore: client/daemon bittorrent software shipped with a NCurses client",
86 version = "0.3",
87 author = "Josh Davis",
88 author_email = "sivad77@gmail.com",
89 include_package_data = True,
90 description = "Curses bittorrent client/daemon",
91 ext_modules = [pytx, libtorrent],
92 entry_points = """
93 [console_scripts]
94 tord = tord.tord:main
95 torc = torc.torc:main
96 """