AUTO_LT_SYNC
[tore.git] / setup.py
blobbc414affd72d4cafd6647e5aae1dde3fae7b706d
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 "-D_FILE_OFFSET_BITS=64",
32 "-DHAVE_PTHREAD",
33 "-DTORRENT_USE_OPENSSL",
34 "-DHAVE_SSL",
35 "-DTORRENT_DISABLE_GEO_IP",
38 _include_dirs = [
39 './libtorrent',
40 './libtorrent/include',
41 './libtorrent/include/libtorrent',
42 '/usr/include/python' + python_version,
43 '/opt/local/include/'
46 _libraries = [
47 'boost_filesystem-mt',
48 'boost_date_time-mt',
49 'boost_thread-mt',
50 'boost_python-mt',
51 'boost_iostreams-mt',
52 #'boost_system-mt',
53 #'GeoIP',
54 'z',
55 'pthread',
56 'ssl'
59 _sources = glob.glob("./libtorrent/src/*.cpp") + \
60 glob.glob("./libtorrent/src/kademlia/*.cpp") + \
61 glob.glob("./libtorrent/bindings/python/src/*.cpp")
63 for source in _sources:
64 if "file_win.cpp" in source: _sources.remove(source)
65 if "mapped_storage.cpp" in source: _sources.remove(source)
67 libtorrent = Extension(
68 'libtorrent',
69 include_dirs = _include_dirs,
70 library_dirs = ["/opt/local/lib/"],
71 libraries = _libraries,
72 extra_compile_args = _extra_compile_args,
73 sources = _sources,
74 define_macros = []
77 pytx = Extension(
78 'pytx',
79 sources = glob.glob("./pytx/*.c"),
80 libraries = ['ncurses', 'panel'],
81 extra_compile_args = ['-g', '-pg']
84 class SelfUpdate( Command ):
85 descritpion = 'Perform a "svn up"'
86 user_options = [ ]
88 def initialize_options( self ): pass
90 def finalize_options( self ): pass
92 def run( self ):
93 os.chdir('./libtorrent')
94 os.system('svn up')
95 os.system('svn diff')
96 os.system('git commit -a -m AUTO_LT_SYNC')
98 setup(
99 cmdclass = {'Update': SelfUpdate},
100 name = "tore",
101 fullname = "Tore: client/daemon bittorrent software shipped with a NCurses client",
102 version = "0.3",
103 author = "Josh Davis",
104 author_email = "sivad77@gmail.com",
105 include_package_data = True,
106 description = "Curses bittorrent client/daemon",
107 ext_modules = [pytx, libtorrent],
108 entry_points = """
109 [console_scripts]
110 tord = tord.tord:main
111 torc = torc.torc:main