HowTo Compile In RedHat-Fedora

From AMule Project FAQ
Revision as of 09:34, 27 June 2008 by Iz0bbz (Talk | contribs | merge | delete)

Jump to: navigation, search


aMule in Fedora

rev 0.1 by bootstrap
rev 0.9 by iz0bbz, June 2008 - WORK in PROGRESS

Contents

This page explains how to get a working aMule installation on Fedora distributions.

It covers installing by pre-compiled RPM packages as well as building from sources.

It applies to Fedora 8 and 9 distributions, and aMule v2.2.1

Installing pre-compiled packages

First of all, be aware that pre-compiled packages may or may not include all amule features. It depends on configuration choices done by the packager.
You can be sure that the amule 'monolithic' version is always included, but cannot say about other features (amule daemon, link creator or so).


Installing via yum

Amule is not included by default in official fedora repositories. But it can be installed and automatically updated adding additional, external repositories to your Fedora system.

Livna or freshrpms are known to include the amule package in their repository.
IMPORTANT NOTE: currently (June 2008) the 'old' amule 2.1.x versions only are available.

You must first configure your Fedora system to use the external repositories. This is usually done manually installing a rpm, there are instructions available at repositories home page. For example, for livna you have to download:

http://rpm.livna.org/livna-release-9.rpm (for Fedora 9)
or
http://rpm.livna.org/livna-release-8.rpm (for Fedora 8)

and then install it typing "rpm -i livna-release-x.rpm" as root.

Then, you can install amule simply with:

yum install amule

All dependencies will be automatically resolved by yum, and it will download and install the amule rpm package as well as all other rpm packages needed to run amule (wxGTK etc.)

That's it ! Now you can just run 'amule' !

Installing user-contributed RPM packages

You can find in the aMule forum user-contributed RPM packages for amule, both for the stable version and for development versions

You need to install (if not already done)some libraries in order for amule to run. Having a working internet connection, become 'root' user and do a :

yum install wxGTK gettext GeoIP

and then you can install the RPM package via a:

rpm -i <your-amule-RPM-package>

If there are other libraries still missing, rpm will warn you about the dependencies needed and stops the installation process. In that case you need to find out and install the missing libraries and repeat the command.

If everything goes fine, drop your root privileges and run amule ... buttons are now present on your Gnome Desktop menus; alternatively, just run "amule &" in a shell.

Compiling & installing amule from sources

The "do-it-yourself" section ...

Setting up a compilation environment

The starting point is the amule source code, that you can find in the amule project website at http://www.amule.org/files/files.php?cat=34 . Download it.

Even if it is not strictly related to aMule compilation, I recommend to update your Fedora installation to the latest package versions. It could help you avoiding problems later. You can update already installed packages with (run as root):

yum update

Then, in order to compile amule sources, you need to install on your Fedora system much more packages than a regular user.

You need the C / C++ compiler, wxWidgets development libraries, crypto++ libraries and a few spare others.

Here again, yum helps us:

yum install gcc gcc-g++ make bison flex binutils-devel gettext-devel GeoIP-devel wxGTK-devel

If you want to build your own amule rpm package, you need also:

yum install rpm-build

Downloading & compiling crypto++

crypto++ is a cryptographic library needed by amule compilation process. You won't find it on standard repositories, so you need to compile and install it yourself.

Download latest crypto++ sources from http://www.cryptopp.com (version 5.5.2 at June 2008)

Unzip crypto++ sources in a directory, open a shell and change directory on it.
Then get root privileges and type:

make
make install
ldconfig

The make process will produce two files, libcryptopp.a (this is the static library used by amule) and cryptest.exe.
In order to validate your crypto++ build , you must run "cryptest.exe v" and check if all tests are passed.

Configuring your aMule build

Unzip aMule source file in the current directory with:

tar -xvjf amule-x.y.z.tar.bz2

Change into the aMule sources directory created by the untar operation and type :

./configure --prefix=/usr --enable-optimize --disable-ccache --disable-debug --enable-geoip --enable-webserver

or, if you want to compile almost everything (including the amule daemon and all companion tools), you can prefer a

./configure --prefix=/usr --with-denoise-level=4 --enable-optimize --disable-debug --enable-cas --enable-wxcas --enable-alc --enable-alcc --enable-amulecmd --enable-amule-daemon --enable-amule-gui --enable-geoip --enable-webserver --enable-verbose --disable-ccache

(You may want to check the configure article to understand the configure switches and eventually try different configurations.
)

Now you should see a bunch of output, while your system tries to configure aMule for building. The configure phase should not take that long (30 - 60 seconds on a modern system, a little more on older systems), and it ends with a summary of the selected options & installed libraries which will be used in the compilation.

Compiling your aMule build

Type "make" then sit down and relax. Depending on your systems speed this can take 'a while'. Prepare for at least 5 minutes of strange output.
If make stops check the last few lines of output for something that looks like an error message. If you can find something that looks like an error message, again, join the amule forum and prepare for pasting or do a "make clean", try to change some of your configure options and restart "make".
If it's still not working, ask someone at the amule forum for help.

If your build completed without error you're nearly done.

Get root privileges and type make install to install your newly built aMule. Now drop your root privileges and try to start aMule with "amule &". If your build was ok you may have a great piece of software running by now.

If your aMule instantly dies and produces a bunch of output containing words like "backtrace" - don't worry, join the amule forum and somebody might help you.

After building you can remove the directory you just built aMule in, as well as you can remove the installed -devel RPMs. I suggest you leave the RPMs in place in case you want to rebuild or build a new version some other day.

Suggestions

This section is quite small (at the time of this writing) and contains some tips regarding aMule usage.

* Drop your root privileges. Don't work/play/watch movies/drive a car/{you're favourite way to waste some time here} as root. Working as root can be dangerous. One mistake can lead to some interesting hours, restoring your system's health. If you know what you're doing: fine, but it's probably still better if you don't work as root.
* Keep an eye on the aMule forum and the aMule Project FAQ and probably use the search function: most questions have been answered before.

Additional fun

This section needs to be updated

This section covers additional ways to have fun with or around aMule.

VNC Server. Did you ever think about using aMule on your server? If you don't like webservers and want to have more access to your system but a limited web GUI, this info is for you.

Using aMule in VNC is quite easy in RedHat/Fedora, because you don't need more than a simple RPM install of vnc-server and a minor modification to a startup script.

Just install vnc-server (RPM comes with your installation CDs) and drop your root privileges. This howto assumes that your default user is named bob. As 'bob' do: vncserver -depth 16 :1. If you never used VNC as 'bob' before, the VNC server should ask you for a password. This password is used to connect to your VNC session. It is not the password your user 'bob' has and it should not be set to the same password. Furthermore your VNC password can be only 8 letters/digits long, so you really should not set your users pw here. The next step would be to test if your server is running as expected. Use you desktop or any other remote system to connect to your VNC session. To make sure you get the right port, use the following syntax: pizza:1 or 192.168.100.1 assuming your server is named pizza and your DNS is running, or your server is running on the IP 192.168.100.1 - if not, change the values to your needs. Once your connection is up, you should be watching a very simple and nearly ugly desktop by now (i'm pretty sure the twm folks will kill me if they read this... sorry guys). This is because the default setting is to start only a little set of applications and a small window manager inside VNC. Go back to your shell and stop VNC using vncserver -kill :1 as 'bob'. Now your VNC server should immediatly go offline. As next step edit /home/bob/.vnc/xstartup - uncomment the two lines below "Uncomment the following two lines for a normal desktop" and comment the rest. If you now start your VNC server again, you will have a fully functional RedHat/Fedora desktop. Now open a shell or use your window manager to start aMule and enjoy. One last hint: VNC uses encryption and timeouts to protect your password, but it's not perfectly secure. To get an even more secure system, I'd recommend using a screensaver on your newly created desktop. If you're using KDE you should have a nice button on your taskbar already. That should protect your system, even if your VNC password has been compromised.

To get the VNC server to launch when the machine boots, you can add the following to the end of /etc/rc.d/rc.local

su username -c vncserver

(replace username with the name of the user who'll be running all this.)

How to use RPM

There are several how to's on RPM available so I won't try to write a new one. Here are some short hints to help you out in case you're completely new to your system and just want to follow the aMule installation from part 2.

Install: rpm -i rpmname (use the complete filename of your RPM, like: openssl-0.9.7a-35.i386.rpm)

Remove: rpm -e rpmname (don't use the complete filename here, just the package name. Like openssl, but not openssl-0.9.7a-35)

Update: rpm -U rpmname (use the complete filename of your rpm, like: openssl-0.9.7a-35.i386.rpm)

If you need any further info on RPM, please consult the rpm howto or use man rpm.