Ubuntu:Compiling Linux DCpp

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Contents

[edit] Introduction

These are instructions on how to build the Linux DC++ (linuxdcpp) Direct Connect client on Ubuntu Linux 5.04 (Hoary Hedgehog). Actually, these directions are fairly generic and should work on most any distribution. The Ubuntu-specific parts are the dependencies section (your distribution may use a different install method, and have different names for the packages), and the part about adding a menu entry (which is really just Gnome-specific, so if you're using KDE use its menu editor).

[edit] Dependencies

First, install the following packages and all their dependencies:

  • g++-3.4
  • scons
  • libgtk2.0-dev
  • libglade2-dev
  • libbz2-dev
  • cvs
  • libssl-dev

You can install these through Synaptic, or just enter the following command at a terminal:

sudo apt-get install cvs g++-3.4 scons libgtk2.0-dev libglade2-dev libbz2-dev libssl-dev

[edit] Get the source code from CVS

To check out the linuxdcpp code, enter the following commands as a non-root user. When prompted for a password just press enter.

cd /home/user/place_where_you_want_to_put_it/
cvs -d:pserver:anonymous@cvs.linuxdcpp.berlios.de:/cvsroot/linuxdcpp login
cvs -z3 -d:pserver:anonymous@cvs.linuxdcpp.berlios.de:/cvsroot/linuxdcpp co linuxdcpp

Note: If you get an error (cvs: command not found) that means you do not have cvs installed. Install it like this:

$ sudo apt-get install cvs

[edit] Building

If things go well then you will have a new subdirectory called "linuxdcpp". Now, change to this directory and compile the program with scons.

cd linuxdcpp
scons

This should take a few minutes depending on the speed of your machine.

[edit] Running

When the compile is finished, you can run the program which will appear as a binary called "linuxdcpp" in the linuxdcpp directory.

./linuxdcpp

[edit] Adding a menu entry

If you like, you can use a menu editor to do this, but here's a quicker way. We will create a new file in /home/user/.local/share/applications called dcpp.desktop. We'll use the gedit editor for simplicity, but you can use whatever you like.

gedit ~/.local/share/applications/dcpp.desktop

Into this new file you need to insert the following.

[Desktop Entry]
Name=DC++
Comment=Direct Connect client
Exec=/home/user/place_where_you_put_it/linuxdcpp/linuxdcpp
Path=/home/user/place_where_you_put_it/linuxdcpp/
Icon=/home/user/place_where_you_put_it/linuxdcpp/pixmaps/linuxdcpp.png
Terminal=false
Type=Application
Categories=Application;Network;

Note: Make sure you change the paths in the Exec and Icon sections to the correct ones or it will not work!

Note: It seems like dcpp needs to be executed while the CWD is the same as the directory that the dcpp executable is in, so ensure you add the Path keyword

Save the file. Now to reload your panel (so the new menu entry will show up). Issue this command:

killall gnome-panel

Wait a few seconds for it to reload. You should now see an entry "DC++" under Applications -> Internet.

[edit] Adding locales for non-standard characters

If your system runs UTF-8 you may not be able to search or recieve messages which contain non-standard characters, such as Å, Ä and Ö. You can add any locale, however this example will explain how to add support for Swedish.

Type the following command to display the currently installed locales:

locale -a

You will need ISO-8859-1 to display Swedish characters. Type:

sudo dpkg-reconfigure locales

Move down the list and mark "sv_SE ISO-8859-1" with the space button. Press tab and choose "Ok". For the next screen, Default system environment locale, just choose "Ok". Your new locale will now be installed.

Issue the following command to start LinuxDC++ with Swedish locales:

$ env LC_ALL=sv_SE dcpp

You can use the same command line in your menu entry.

[edit] Updating

Whenever the developers check new code into the CVS tree, you can update your copy of the source code and recompile. To do this, simply go back into the directory where you originally built the program, update the code and recompile:

cd /home/user/place_where_you_put_it/linuxdcpp
cvs update
scons

Note: Warning! The developers may break code or introduce undesirable bugs in the CVS tree as they develop. In this case you will want to go back to the last revision.

To go back to a known good revision use the following command, where you replace the number below with the revision number you want to use.

cvs update -r 888

Alternately you can use the -D option and supply a date.

cvs update -D 2005-09-16

Note: The -r and -D switches are "sticky" meaning that it will remember this date for future updates. Once the bugs you don't like are fixed, continue updating from the latest revision.

To clear the -r and -D switches, use the following command to check out the latest code:

cvs update -A

[edit] Removal

To uninstall the Linux DC++ client, simply delete the directory you installed it in.

Note: Warning: the -rf flags for the rm command cannot be undone! If you delete the wrong directory you may regret it very much. Make sure you are deleting the correct directory before proceeding. You will not be prompted, all the files will be recursively deleted!

cd /home/user/place_where_you_put_it/
rm -rf linuxdcpp

If you added a menu entry, be sure to remove it too.

cd ~/.local/share/applications
rm dcpp.desktop

That's it. The program and all its files have been completely removed.

Navigation: Ubuntu Index
Personal tools