HowTo Compile In RedHat-Fedora

From AMule Project FAQ
Revision as of 14:49, 26 June 2008 by Iz0bbz (Talk | contribs)

Jump to: navigation, search

This article is being rewritten. Work in progress!

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 available as well as building from sources.


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 perform a rpm -i livna-release-x.rpm

Then, you can install amule simply doing a :

yum install amule

All dependencies will be automagically 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

In order to compile amule you need to install 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 g++ bison gettext-devel flex GeoIP-devel wxGTK-devel

Work in progress!

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 on it and type
make
make install
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

Work in progress!

The following is an example, but it will work on RedHat/Fedora systems and it's been used for quite some time when building the "official" aMule RPMs. Anyway, your system or your opinion may be different, so feel free to change the options if you feel like changing them.

Note: If you're building aMule => 2.0rc7 you will have an embedded crypto lib that makes libcrypto++ installation obsolete. It's enabled by default, so you don't need to change your configure options.

Go to the directory you created, change into the aMule sources and type (check the configure article): ./configure --prefix=/usr --enable-optimize --enable-amulecmd --enable-webserver --enable-utf8-systray --with-wx-config=/usr/bin/wxgtk-2.4-config --with-wxbase-config=/usr/bin/wxbase-2.4-config

Now you should see a bunch of output, while your system tries to configure aMule for building. If you're NOT building a CVS Version and you encounter problems, join the [[IRC|aMule IRC channel] at #amule on irc.freenode.net and prepare to paste some info. If your building a CVS version you should probably wait a day and try again - it may just be some of those days where CVS sources are not really working out for unexperienced users ;). If you're suspecting an interesting bug or just want to build that tarball whatever it takes, you're welcome to IRC in #amule as well, but bring some time because solving problems may not be as easy as installing RPMs.

Once configure is done (should not take that long... 30 - 60 seconds on a modern system, a little more on older systems) type make, sit down and relax. Depending on your systems speed this can take some time. 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 IRC, come to #amule 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 IRC in #amule on irc.freenode.net 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 and you had a good day on CVS versions 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 IRC at #amule on irc.freenode.net 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.

If nothing works and your home built aMule won't run, don't worry, try one of our RPMs ;)

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.
* Don't drink and drive.

... to be continued ...

Additional fun

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.