Rebuilding rtorrent with color patch on debian/ubuntu
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
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 done_fg_color=2 #done_bg_color=3 active_fg_color=1 #active_bg_color=5
Nice, isn’t it?
(Image borrowed from howtoforge).
See here if you wish to use other colors.