Libtorrent

Website: http://www.rasterbar.com/products/libtorrent/
Build instructions: http://www.rasterbar.com/products/libtorrent/building.html
Docs: http://www.rasterbar.com/products/libtorrent/manual.html
Examples: http://www.rasterbar.com/products/libtorrent/python_binding.html#using

Building on gentoo.

Building libtorrent.

Check out libtorrent from SF svn:

svn co https://libtorrent.svn.sourceforge.net/svnroot/libtorrent libtorrent

Check out ASIO from SF cvs:

cvs -z3 -d:pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio co -P asio

"Copy the asio/include/asio/ directory into the libtorrent/include/libtorrent/ directory. Alternatively you can make a symbolic link."

"Copy asio/include/asio.hpp into libtorrent/include/libtorrent"

aclocal -I m4
autoheader
libtoolize --copy --force
automake --add-missing --copy --gnu
autoconf

"On darwin/OSX you have to run glibtoolize instead of libtoolize."

NOTE: You may have to edit config.in.

Index: configure.in
===================================================================
RCS file: /cvsroot/libtorrent/libtorrent/configure.in,v
retrieving revision 1.15
diff -r1.15 configure.in
7c7
< # AM_CONFIG_HEADER(config.h)
---
> AC_CONFIG_HEADERS(config.h)
./configure
make clean
make

NOTE: I did this a while back so it may not work. (hehe)

Building the libtorrent bindings.

Download boost from http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=376197 .

Extract. I did to /tmp so the rest of the commands will relate to that. Below SOMEWHERE refers to the root of libtorrent (usually trunk).

cd /tmp/boost_1_33_1/tools/build/jam_src
./build.sh
cp bin.linuxx86/bjam SOMEWHERE/libtorrent/bindings/python
cd SOMEWHERE/libtorrent/bindings/python
export BOOST_BUILD_PATH=/tmp/boost_1_33_1/tools/build/v2

Edit /tmp/boost_1_33_1/tools/build/v2/user-config.jam to include:

using gcc ;
using python : 2.4 ;

NOTE: The spaces are important.

export BOOST_ROOT=/tmp/boost_1_33_1
./bjam release

Now the libtorrrent.so file should be in bin/gcc/release/dht-support-on/logging-none/threading-multi/ .
Copy it into your python site-packages. For me thats /usr/lib/python2.4/site-packages/ .

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.