AUTO_LT_SYNC
[tore.git] / setup.py
blob6acb80d92f10f47b83af7e8f8f7702593215cfb8
1 from setuptools import setup, find_packages, Extension
2 from setuptools import setup, find_packages, Extension
3 from distutils import sysconfig
4 from distutils.core import Command
6 #from distutils.core import setup, Extension
8 import platform
9 import glob
10 import os
12 python_version = platform.python_version()[0:3]
15 for remove in ['-g', '-Wstrict-prototypes']:
16 sysconfig.get_config_vars()["CFLAGS"] = sysconfig.get_config_vars()["CFLAGS"].replace(remove, " ")
18 # The libtorrent extension
19 _extra_compile_args = [
20 "-Wno-missing-braces",
21 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP",
22 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP",
23 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP",
24 "-DTORRENT_LINKING_SHARED",
25 "-DTORRENT_BUILDING_SHARED",
26 "-DNDEBUG",
27 #"-g",
28 #"-pg",
29 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
30 "-DBOOST_THREAD_USE_LIB",
31 # "-DBOOST_NO_EXCEPTIONS",
32 "-D_FILE_OFFSET_BITS=64",
33 "-DHAVE_PTHREAD",
34 "-DTORRENT_USE_OPENSSL",
35 "-DHAVE_SSL",
36 "-DTORRENT_DISABLE_GEO_IP",
39 _include_dirs = [
40 './libtorrent',
41 './libtorrent/include',
42 './libtorrent/include/libtorrent',
43 '/usr/include/python' + python_version,
44 '/opt/local/include/'
47 _libraries = [
48 'boost_filesystem-mt',
49 'boost_date_time-mt',
50 'boost_thread-mt',
51 'boost_python-mt',
52 'boost_iostreams-mt',
53 #'boost_system-mt',
54 #'GeoIP',
55 'z',
56 'pthread',
57 'ssl'
60 _sources = glob.glob("./libtorrent/src/*.cpp") + \
61 glob.glob("./libtorrent/src/kademlia/*.cpp") + \
62 glob.glob("./libtorrent/bindings/python/src/*.cpp")
64 for source in _sources:
65 if "file_win.cpp" in source: _sources.remove(source)
66 if "mapped_storage.cpp" in source: _sources.remove(source)
68 libtorrent = Extension(
69 'libtorrent',
70 include_dirs = _include_dirs,
71 library_dirs = ["/opt/local/lib/"],
72 libraries = _libraries,
73 extra_compile_args = _extra_compile_args,
74 sources = _sources,
75 define_macros = []
78 pytx = Extension(
79 'pytx',
80 sources = glob.glob("./pytx/*.c"),
81 libraries = ['ncurses', 'panel'],
82 extra_compile_args = ['-g', '-pg']
85 class SelfUpdate( Command ):
86 descritpion = 'Perform a "svn up"'
87 user_options = [ ]
89 def initialize_options( self ): pass
91 def finalize_options( self ): pass
93 def run( self ):
94 os.chdir('./libtorrent')
95 os.system('svn up')
96 os.system('svn diff')
97 os.system('git commit -a -m AUTO_LT_SYNC')
99 setup(
100 cmdclass = {'Update': SelfUpdate},
101 name = "tore",
102 fullname = "Tore: client/daemon bittorrent software shipped with a NCurses client",
103 version = "0.3",
104 author = "Josh Davis",
105 author_email = "sivad77@gmail.com",
106 include_package_data = True,
107 description = "Curses bittorrent client/daemon",
108 ext_modules = [pytx, libtorrent],
109 entry_points = """
110 [console_scripts]
111 tord = tord.tord:main
112 torc = torc.torc:main