binhng's blog

There's no certainty, only opportunity.

Rebuilding rtorrent with color patch on debian/ubuntu

with 3 comments

Note: Although the following was done on Debian Squeeze, the process should be the same on Ubuntu, as long as the rtorrent/libtorrent version is 0.8.6/0.12.6

Since i use Slackware as my main os, building packages is one of the thing in the linux world that i am familiar with. On Slackware it’s just creating/modifying a SlackBuild file, downloading source, running the SlackBuild and the binary is there for you.

Now that i want to be more familiar with a deb system, i try to apply color patch for rtorrent on Debian. After googling a while, it seems that the process of building pkgs on a deb system is rather more complicated than on Slackware. You need to create many files and folders rather than just a SlackBuild on Slack.

Anyway, since rtorrent is present on Debian repos, the rebuilding of it is simpler than i thought at first. Now the steps:

1- Get the source from a Debian repo, so you can then have a building structure adhering to Debian standard

mkdir rtorrent-color && cd rtorrent-color
apt-get source rtorrent

Since apt-get source will get the sources and put them in pwd, the first command is for avoiding the messed-up.

2- Now you need to install dependencies for building. Debian has a method for this

 aptitude build-dep rtorrent

3- Get the color patch here. I got it from AUR’s rtorrent-color. At the time of this writing, the patch is for rtorrent 0.8.6, which is the version i used on Slackware/Arch/Debian Squeeze.

Put that patch into the patches folder in the Debian’s build tree

 mv rtorrent-0.8.6-canvas-fix.patch rtorrent-0.8.6/debian/patches/

4- Finally go to the extraced source folder and rebuild it

 cd rtorrent-0.8.6
 debuild -us -uc

The two flags is to tell the building process not to sign the package.

After the rebuilding is finish, the deb file is waiting for you in the parent folder rtorrent-color. Just go up and install/upgrade it

 cd ..
 dpkg -i rtorrent_0.8.6-1_i386.deb

To prevent this modified version to be upgraded to the original version in Debian’s repo, ‘hold’ it so APT will ignore each time we upgrade our machine.

 aptitude hold rtorrent

For rtorrent to show colors, some color configurations must be put into ~/.rtorrent.rc. This is from mine

 The configuration for color patch

Nice, isn’t it?
rtorrent-color in action
(Image borrowed from howtoforge).

See here if you wish to use other colors.


Written by binhng

April 16, 2010 at 3:20 pm

Posted in Uncategorized

Tagged with ,

3 Responses

Subscribe to comments with RSS.

  1. Thanks for the tip. It worked like a charm!


    May 15, 2010 at 2:08 am

  2. Thanks! This worked great for me as well. Just FYI, the color codes seem to be the same as for .Xdefaults, as follows:

    0 = black
    1 = red
    2 = green
    3 = yellow
    4 = blue
    5 = purple
    6 = cyan
    7 = white
    8 = gray


    August 22, 2011 at 1:06 pm

  3. This was great, thanks. To keep “apt-get upgrade” from trying to upgrade rtorrent I also had to add:

    echo “rtorrent hold” | dpkg –set-selections


    August 28, 2011 at 11:38 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: