Build Rtorrent for Server

Great Article when Paired with a NFS and SAMBA setup you can make the complete Network Media and File Server. This howto works for Ubuntu 10.04 Lucid Lynx and for Debian 5 Lenny. The difference is that commands that contain sudo must be executed as root.

In this howto I assume you download and compile the sources from your ~/rtorrent resp. ~/rtorrent/trunk folder.

 

1. Remove current rtorrent installation

sudo apt-get remove rtorrent libtorrent*

 

2. Install necessary packages

sudo apt-get install subversion build-essential libtool automake openssl libsigc++-2.0-dev libncurses5-dev libncursesw5-dev libcurl4-openssl-dev libcppunit-dev

 

3. Create rtorrent folder

mkdir ~/rtorrent

 

4. Go into the rtorrent folder

cd ~/rtorrent

Current location: /home/USER/rtorrent

 

5. Get the rtorrent sources by svn

svn co svn://rakshasa.no/libtorrent/trunk

Current rtorrent version is: rev. 1169.

 

6. Get into the trunk folder

cd trunk

Current location: /home/USER/rtorrent/trunk

 

7. Download the patches

Colour support for rtorrent:

wget http://www.simplylinux.ch/rtorrent/canvas-color_1169.patch

This patch enables you to colorize the rtorrent cli interfaces. It differentiaties between completed/uncompleted torrents and active/inactive ones. I first had to get used to it also but meanwhile I think it’s really a good enhancement. The patch was originally supplied here: wget http://www.simplylinux.ch/rtorrent/trackerinfo.patch

This patch shows the number of seeders/leechers/completed as supplied by the tracker in the tracker view. Often it’s not accurate however it’s usefull for me to check if a tracker has any peers at all listed for a given torrent.

 

8. Apply the patches

Colour support for rtorrent:

patch -p0 < canvas-color_1169.patch

Torrent Tracker Stats:

patch -p0 < trackerinfo.patch

 

9. Get into the libtorrent folder

cd libtorrent

Current location: /home/USER/rtorrent/trunk/libtorrent

 

10. Run the autogen.sh script

./autogen.sh

 

11. Configure libtorrent

./configure

 

12. Compile libtorrent

make

 

13. Install libtorrent

sudo make install

 

14. Extend /etc/ld.so.conf

echo “include /usr/local/lib” | sudo tee -a /etc/ld.so.conf

 

15. Updated ld.so cache

sudo ldconfig

 

16. Get into the rtorrent folder

cd ../rtorrent

Current location: /home/USER/rtorrent/trunk/rtorrent

 

17. Run the autogen.sh script

./autogen.sh

 

18. Configure rtorrent

./configure

 

19. Compile rtorrent

make

 

20. Install rtorrent

sudo make install

 

21. Extend rtorrent configuration

Magnet Link support as provided by this howto requires a session folder. If there is no session folder defined yet in the ~/.rtorrent.rc config file or if that config file does not exist yet, then it has to be added. An example for an ~/.rtorrent.rc file can be found here: http://libtorrent.rakshasa.no/browser/trunk/rtorrent/doc/rtorrent.rc#latest. In addition I would also set the DHT option to “on”.

You can also just copy the .rtorrent.rc config file from the trunk and then edit it:

cp ~/rtorrent/trunk/rtorrent/doc/rtorrent.rc ~/.rtorrent.rc

To make use of the colour patch, also the colour options need to be added to the ~/.rtorrent.rc config. I use this example below:

# Color / Canvas patch
done_fg_color = 2
#done_bg_color = 2
active_fg_color = 1
#active_bg_color = 4

With these options inactive completed torrents will be displayed as dark green, active ones as bright green, inactive incompleted torrents are displayed in dark red, active ones in bright red. To customize this further you can use those colours: 0 = black; 1 = red; 2 = green; 3 = yellow; 4 = blue; 5 = magenta; 6 = cyan; 7 = white

If you don’t have a .rtorrent.rc config file in your home dir then you can get one with the command below. However it needs a lot of work (especially enabling a download and session dir)

wget http://libtorrent.rakshasa.no/export/1169/trunk/rtorrent/doc/rtorrent.rc -O ~/.rtorrent.rc

 

22. Run rtorrent

rtorrent