Friday 3 July 2009

Compile and upgrade or install libtorrent-0.12.4 and rtorrent-0.8.4

Chose a directory where can download the sources to. For instance

/usr/src

we do not need to create this one, as it should already exist.

# mkdir /usr/src


next, get the sources for libtorrent and rtorrent:

# cd /usr/src
# wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.4.tar.gz
# wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.4.tar.gz

Unpack both archives with

# tar xvzf libtorrent-0.12.4.tar.gz
# tar xzvf rtorrent-0.8.4.tar.gz

If you have already compiled and installed rtorrent before and created the symlinks according to my earlier tutorial, we will need to remove the symlinks and create new ones pointing to the new sources:

# rm rtorrent
# rm libtorrent

# ln -s libtorrent-0.12.4 libtorrent
# ln -s rtorrent-0.8.4 rtorrent

After that, enter the respective directories and run ./autogen.sh, then configure, the make. Before you run make install, make sure you have quit any running instances of rtorrent.

cd to libtorrent, later to rtorrent and run:
# ./autogen.sh
# make
# make install

After the long compiling process we want to make sure, rtorrent is actually working. run rtorrent

# rtorrent

Should you get an error message like this:

error while loading shared libraries: libtorrent.so.11: cannot open shared object file: No such file or directory


Run ldconfig to create and cache the links.

# ldconfig

This should solve the problem.

Saturday 13 June 2009

compile and install current rtorrent for debian lenny on NSLU2

A solution without using subversion. For subversion we would only need the client, but you only get the full package from the repositories, together with all dependencies we would quickly reach > 50 MB. It's just too much for my little slug (1 GB USB-Flash Stick).

Well,

first of all, we create a directory in /usr/src named rtorrent. This is where we will download the sources to and where we are going to decompress the archives.:

# mkdir /usr/src/rtorrent
# cd /usr/src/rtorrent

We get the sources (note that the numbers in the filenames will change with new versions. It's best you verify at http://libtorrent.rakshasa.no/wiki.

# wget libtorrent-0.12.2.tar.gz
# wget rtorrent-0.8.2.tar.gz

assuming a fresh basic install of debian lenny, we need:

# apt-get install build-essential
# apt-get install libtool
# apt-get install automake autoconf
# apt-get install libsigc++-2.0-dev
# apt-get install pkg-config
# apt-get install libssl-dev
# apt-get install libcurl3-dev [libcurl4-openssl-dev]
# apt-get install libncurses5 libncurses5-dev


now we unzip the sources:

# tar xvzf libtorrent-0.12.2.tar.gz
# tar xzvf rtorrent-0.8.2.tar.gz

create a symbolic link to the cryptic extracted directories:

# ln -s libtorrent-0.12.2 libtorrent
# ln -s rtorrent-0.8.2 rtorrent


then move up to the libtorrent directory:

# cd libtorrent


I got an error like "make[4]: *** [file_list_iterator.lo] Error 1" when compiling with make. Fortunately, this is known and can be easily fixed by applying the libtorrent-gcc43-v2.patch before compiling.

So, when in the libtorrent source directory, wget the patch

# wget http://libtorrent.rakshasa.no/raw-attachment/ticket/1266/libtorrent-gcc43-v2.patch

and apply it with

# patch -p1 < libtorrent-gcc43-v2.patch

next, we start the usual procedure (cf. here). Before we begin we open a screen session, so that we don't need to stay connected to the NSLU2 the whole time. If you've not already done so, install screen (you will probably use it with rtorrent anyways).

# apt-get install screen

Then, start a new screen session. We name it rtorrcompiling (chose whatever you want).

# screen -S rtorrcompiling.

Now do:

# ./autogen.sh
# ./configure
# make

note that make is going to take several hours (in my case more than 6). Sigh. You can detach the screen with CTRL-A d. Logout, power off your PC (not the NSLU ;)), get a coffee or go to sleep. Or you can take a look how hard your slug is working by

# top

Exit top by pressing q.

If you want to check how far make got, login to your slug and resume the screen session with

# screen -r

When make is done, go on with

# make install

and we're done with libtorrent. Next is rtorrent:

# cd ..
# cd rtorrent
# wget http://libtorrent.rakshasa.no/raw-attachment/ticket/1554/rtorrent-0.8.2-g%2B%2B4.3.patch
# patch -p1 < rtorrent-0.8.2-g++4.3.patch
# ./autogen.sh
# ./configure
# make
# make install

That's it.
Please leave a comment if this worked or not worked for you. Thanks.