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 "-D_FILE_OFFSET_BITS=64",
33 "-DTORRENT_USE_OPENSSL",
35 "-DTORRENT_DISABLE_GEO_IP",
40 './libtorrent/include',
41 './libtorrent/include/libtorrent',
42 '/usr/include/python' + python_version
,
47 'boost_filesystem-mt',
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(
69 include_dirs
= _include_dirs
,
70 library_dirs
= ["/opt/local/lib/"],
71 libraries
= _libraries
,
72 extra_compile_args
= _extra_compile_args
,
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"'
88 def initialize_options( self
): pass
90 def finalize_options( self
): pass
93 os
.chdir('./libtorrent')
96 os
.system('git commit -a -m AUTO_LT_SYNC')
99 cmdclass
= {'Update': SelfUpdate
},
101 fullname
= "Tore: client/daemon bittorrent software shipped with a NCurses client",
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
],
110 tord = tord.tord:main
111 torc = torc.torc:main