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
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",
29 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
30 "-DBOOST_THREAD_USE_LIB",
31 # "-DBOOST_NO_EXCEPTIONS",
32 "-D_FILE_OFFSET_BITS=64",
34 "-DTORRENT_USE_OPENSSL",
36 "-DTORRENT_DISABLE_GEO_IP",
41 './libtorrent/include',
42 './libtorrent/include/libtorrent',
43 '/usr/include/python' + python_version
,
48 'boost_filesystem-mt',
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(
70 include_dirs
= _include_dirs
,
71 library_dirs
= ["/opt/local/lib/"],
72 libraries
= _libraries
,
73 extra_compile_args
= _extra_compile_args
,
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"'
89 def initialize_options( self
): pass
91 def finalize_options( self
): pass
94 os
.chdir('./libtorrent')
97 os
.system('git commit -a -m AUTO_LT_SYNC')
100 cmdclass
= {'Update': SelfUpdate
},
102 fullname
= "Tore: client/daemon bittorrent software shipped with a NCurses client",
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
],
111 tord = tord.tord:main
112 torc = torc.torc:main