Difference between revisions of "HowTo Compile In RedHat-Fedora"

From AMule Project FAQ
Jump to: navigation, search
m
(Running rpmbuild)
 
(100 intermediate revisions by 11 users not shown)
Line 1: Line 1:
<h1>aMule in RedHat/Fedora</h1>
+
<h1>aMule in Fedora</h1>  
  
<h3>''(rev 0.1 by [[User:bootstrap|bootstrap]])''</h3>
+
== Contents  ==
  
== What's this all about?  ==
+
This page explains how to get a working [[aMule]] installation on [http://www.fedoraproject.org Fedora] distributions.<br>
  
This mini-howto explains how to get a working [[aMule]] installation on [http://www.redhat.com RedHat]/[http://fedora.redhat.com Fedora] based installations.<br>
+
It covers installing by pre-compiled [http://www.rpm.org RPM] packages as well as building from sources.<br>
It covers installing by [http://www.rpm.org RPM] as well as building from source.<br>
+
Focus is to keep things easy so that probably everybody will be able to follow this instructions without learning to rebuild a complete system from scratch ;)
+
  
== Show me the way... ==
+
It applies to Fedora 9 and later distributions, and aMule v2.2.x
  
This Section is divided into 2 parts. Part (a) <!-- link --> will cover the easy way using [http://www.rpm.org RPM]s (which is quite easy, so I really don't like to write it down, but there have been questions, and I won't leave them unanswered...), while part (b) <!-- link --> covers the more complex way: using the sources to build your own [[aMule]].
+
== Installing pre-compiled packages ==
  
=== Easy ===
+
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.<br>
 +
You can be sure that the amule 'monolithic' version is always included, but cannot say about other features (amule daemon, link creator or so).<br>
  
I said it's easy and it really is. The one and only rule to get an [http://www.rpm.org RPM] based [[aMule]] installation up and running is:
 
  
: Get the right [http://www.rpm.org RPM]s. That means:
+
=== Installing via [http://fedoraproject.org/wiki/Tools/yum yum] ===
  
: 1. Get [[wxWidgets|wxGTK]] and [[wxWidgets|wxBase]] from http://www.wxwidgets.org (you don't need the -devel packages to get [[aMule]] running) and install <!-- this should be a link --> them. Whatever someone else may say or you might think, don't use any other [[WxWidgets|wx]] [http://www.rpm.org RPM].
+
aMule is not included by default in official fedora repositories.
  
: 2. Install some additional [http://www.rpm.org RPM]s. On a common [http://www.redhat.com RedHat]-ish system you will have most of them, but I've read some questions regarding libcrypto (not [[libcrypto]]++, that's next...), so it's better to say that you will need to have openssl installed. If you're installing aMule <= 2.0rc6 you will also need to install [[libcrypto]]++ (we're talking about [[libcrypto]]++ from [http://www.eskimo.com/~weidai/cryptlib.html http://www.eskimo.com/~weidai/cryptlib.html]). You can find [http://www.rpm.org RPM]s for [http://www.redhat.com RedHat]/[http://fedora.redhat.org Fedora] on http://www.hirnriss.net or links on the [http://www.amule.org/amule/download.php aMule download page]. That should probably be all you [http://www.rpm.org RPM]s you will need to install by hand (actually [http://www.openssl.org openssl] will be installed on most systems, but as I mentioned before, there have been questions about that, so here you are...). If you're still getting a dependency problem and can't figure it out on your own, contact us through [[IRC]] (come to irc.freenode.net and visit #amule). Somebody will surely help you. Some rpms you should probably check are libcurl, openssl and automake >= 1.7.
+
But it can be installed and automatically updated adding additional, external repositories to your Fedora system.<br>
  
: 3. Get [[aMule]] from http://www.amule.org/dl/index.php?category=22 and install <!-- "install" should be a link to part 5 --> it.
+
[http://rpmfusion.org  Rpmfusion] free packages repository includes amule stable packages<br>
  
That's it. If nothing went wrong you can drop your root privileges <!-- "root privileges" should be a link to part 3 --> and start [[aMule]]. That's as easy as typing ''amule &'' in your favourite shell. Have fun!
+
You must first configure your Fedora system to use the external repositories. This is usually done manually installing a rpm. For example, for [http://rpmfusion.org rpmfusion] you have to do as root:<br>
  
=== Not that easy ===
+
<code>rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm</code>
  
==== First notes ====
+
Then, you can install amule simply with:<br>
  
So you're one of that guys that don't like [http://www.rpm.org RPM]s? Well - you asked for it...
+
<code>yum install amule</code><br>
  
Preparation:
+
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.)<br>
  
You will need to get some [[wxWidgets|wx]] stuff. If you'd like to build [[wxBase]] and [[wxWidgets|wxGTK]] yourself, you will have to look into another howto. Building [[wxWidgets|wx]] can be complex and takes some time, so i really recommend to use the http://www.wxwidgets.org [http://www.rpm.org RPM]s.
+
That's it ! Now you can just run 'amule' !<br>
  
As you want to build [[aMule]] yourself, you will need some more [http://www.rpm.org RPM]s than other people. Install [[wxWidgets|wxGTK]], [[wxBase]], [[wxWidgets|wxGTK]]-devel and [[wxBase]]-devel.
+
=== Installing user-contributed RPM packages ===
 +
You can find in the [http://forum.amule.org aMule forum] user-contributed RPM packages for amule, both for the [http://forum.amule.org/index.php?board=69.0 stable version] and for [http://forum.amule.org/index.php?board=70.0 development versions]<br>
  
If you're building [[aMule]] <= 2.0rc6 you will also need [[libcrypto]]pp and [[libcrypto]]pp-devel ([http://www.redhat.com RedHat]/[http://fedora.redhat.com Fedora] downloads at [http://www.hirnriss.net http://www.hirnriss.net]) to get [[aMule]] compiled. Skip this if you're building [[aMule]] => 2.0rc7.
+
Having a working internet connection, download the amule packages, become 'root' user and do a :<br>
  
Get the sources you want (probably a cvs tarball from http://amule.hirnriss.net ?) from http://www.amule.org and un[http://www.gnu.org/software/tar/tar.html tar] it (if you don't know about tarballs, use [http://www.rpm.org RPM]s. Please!) into a directory you'd like to work in.
+
<code>yum --nogpgcheck localinstall <your-amule-RPM-package></code><br>
  
Drop your root privileges <!-- "root privileges" should be a link to part 3 --> and proceed to the fun part...
+
aMule requires other libraries (wxGTK, GeoIP, uPnP ...) to be installed, if they are missing on your system yum will download & install them together with the amule package.
 +
 
 +
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.<br>
 +
 
 +
== Compiling & installing amule from sources ==
 +
 
 +
The "do-it-yourself" section ...
 +
 
 +
Please, be sure to have enough space. You need 700Mb-1Gbyte of temporary space on your disk.
 +
The last nuclear-powered,speed-of light capable CPU is not necessary (even if it helps!).
 +
 
 +
 
 +
=== 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.<br>
 +
 
 +
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):<br>
 +
 
 +
<code>yum update</code> <br>
 +
 
 +
Then, in order to compile amule sources, you need to install on your Fedora system much more packages than a regular user.<br>
 +
 
 +
You need the C / C++ compiler, wxWidgets development libraries, crypto++ libraries and a few spare others.<br>
 +
 
 +
Here again, yum helps us:<br>
 +
 
 +
<code>yum install gcc gcc-c++ make bison flex binutils-devel gettext-devel GeoIP-devel wxGTK-devel zlib-devel libpng-devel gd-devel libupnp-devel cryptopp-devel</code> <br><br>
 +
 
 +
Many other packages are installed by yum together with the ones above, due to dependencies. That's regular.<br><br>
 +
If you want to build your own amule rpm package, you need also:<br>
 +
 
 +
<code>yum install rpm-build redhat-rpm-config</code>
 +
 
 +
=== Downloading & compiling crypto++ ===
 +
 
 +
[http://www.cryptopp.com crypto++] is a cryptographic library needed by amule compilation process.
 +
 
 +
On Fedora 9 and later, this library is included in standard Fedora repositories and you should have installed such library following the previous section instructions.
 +
 
 +
On Fedora 8 and below, or if you want to compile crypto++ libraries yourself for whatever reasons, here follows the steps required.
 +
 
 +
Download latest crypto++ sources from http://www.cryptopp.com (version 5.5.2 at December 2008).
 +
 
 +
Unzip crypto++ sources in a directory, open a shell and change directory on it.<br>
 +
Then get root privileges and type:<br><br>
 +
<code>make</code><br>
 +
<code>make install</code><br>
 +
<code>ldconfig</code><br><br>
 +
The make process will produce two files, libcryptopp.a (this is the static library used by amule) and cryptest.exe. <br>
 +
In order to validate your crypto++ build , you '''must''' run "<code>cryptest.exe v</code>" and check if all tests are passed.
 +
 
 +
 
 +
Hint:<br>
 +
If crypto++ tests fail, you can try to modify compilations options as follows: go to the crypto++ sources directory. Locate the "GNUmakefile" file and edit it. In the first line, change<br>
 +
<code>CXXFLAGS = -DNDEBUG -g -O2</code><br>
 +
to<br>
 +
<code>CXXFLAGS = -DNDEBUG -g -O0 -DCRYPTOPP_DISABLE_X86ASM</code><br>
 +
and then recompile / test your crypto++ build again as written above.
 +
 
 +
=== The usual way: configure/compile/install ===
  
 
==== Configuring your [[aMule]] build ====
 
==== Configuring your [[aMule]] build ====
  
The following is an example, but it will work on [http://www.redhat.com RedHat]/[http://fedora.redhat.com Fedora] systems and it's been used for quite some time when building the "official" [[aMule]] [http://www.rpm.org RPM]s. Anyway, your system or your opinion may be different, so feel free to change the options if you feel like changing them.
+
Unzip aMule source file in the current directory with:<br>
  
''Note: If you're building [[aMule]] => 2.0rc7 you will have an embedded [http://www.openssl.org/docs/crypto/crypto.html crypto] lib that makes [[libcrypto]]++ installation obsolete. It's enabled by default, so you don't need to change your configure options.''
+
<code>tar -xvjf amule-''x.y.z''.tar.bz2</code>
  
Go to the directory you created, change into the [[aMule]] sources and type: ''./configure --prefix=/usr --enable-optimize --enable-amulecmd --enable-amulecmdgui --enable-webserver --enable-webservergui --enable-utf8-systray --with-wx-config=/usr/bin/wxgtk-2.4-config --with-wxbase-config=/usr/bin/wxbase-2.4-config''
+
Change into the [[aMule]] sources directory created by the untar operation and type :<br>
  
Now you should see a bunch of output, while your system tries to configure [[aMule]] for building. If you're '''NOT''' building a [http://www.gnu.org/software/cvs 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 [http://www.gnu.org/software/cvs CVS] version you should probably wait a day and try again - it may just be some of those days where [http://www.gnu.org/software/cvs 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 [http://www.rpm.org RPM]s.
+
<code>./configure --prefix=/usr --enable-optimize --disable-ccache --disable-debug --enable-geoip --enable-webserver</code> <br>
  
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.
+
or, if you want to compile almost everything (including the amule daemon and all companion tools), you can prefer a
 +
 
 +
<code>./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</code><br>
 +
 
 +
(You may want to check the [[configure|configure article]] to understand switches meaning and eventually try different configurations.)<br>
 +
 
 +
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.<br>
 +
 
 +
==== Compiling your [[aMule]] build ====
 +
 
 +
Type "<code>make</code>" then sit down and relax. Depending on your systems speed this can take 'a while'. Prepare for at least 5 minutes of strange output.<br>
 +
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 "<code>make clean</code>", try to change some of your configure options and restart "<code>make</code>".<br>
 +
If it's still not working, ask someone at the amule forum for help.
  
 
If your build completed without error you're nearly done.
 
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 <!-- "root privileges" should be a link to part 3 --> and try to start [[aMule]] with ''amule &''. If your build was ok and you had a good day on [http://www.gnu.org/software/cvs 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.
+
==== Installing your [[aMule]] build ====
 +
 
 +
Get root privileges and type <code>make install</code> to install your newly built [[aMule]]. Now drop your root privileges and try to start [[aMule]] with "<code>amule &</code>". If your build was ok you may have a great piece of software running by now. <br>
 +
 
 +
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 [http://www.rpm.org RPM]s. I suggest you leave the [http://www.rpm.org RPM]s in place in case you want to rebuild or build a new version some other day.
 
After building you can remove the directory you just built [[aMule]] in, as well as you can remove the installed -devel [http://www.rpm.org RPM]s. I suggest you leave the [http://www.rpm.org RPM]s 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 [http://www.rpm.org RPM]s ;)
+
=== Creating your own RPM packages ===
  
== Suggestions ==
+
Creating RPM files *implies* running configure/make/build as written in the section before, but, as an advantage:
  
This section is quite small (at the time of this writing) and contains some tips regarding [[aMule]] usage.
+
It performs such steps in a controlled way, following "instructions" contained in a file (the spec file)
 +
 
 +
Having RPM package(s) in output, it gives you much more control on how to install/update software on your PC.
 +
 +
As a prerequisite, please install on your fedora system the following two packages, which installs 'rpmbuild' - the application needed to create RPM packages- and set up the standard Fedora RPM configuration.
 +
 
 +
<code>yum install rpm-build redhat-rpm-config</code>
 +
 
 +
==== The spec file ====
 +
In this file you give instructions to rpmbuild on how to configure and compile amule - and how to organize the output packages.
 +
 
 +
Here follows a (quite complex) example based on aMule 2.2.5 , which builds several packages following the rpmfusion convention.
 +
 
 +
Please update the spec file your information "Packager" and changing the "Version" row as appropriate.
 +
 
 +
 
 +
Name:          amule
 +
Version:        2.2.5
 +
Release:        1%{?dist}
 +
Summary:        File sharing client
 +
License:        GPLv2+
 +
Group:          Applications/Internet
 +
Source:        aMule-%{version}.tar.bz2
 +
Packager:      thepackager <thepackager@yourmail.com>
 +
URL:            http://www.amule.org
 +
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 +
BuildRequires:  wxGTK-devel >= 2.8.9, desktop-file-utils
 +
BuildRequires:  gettext-devel, flex, bison, GeoIP-devel
 +
BuildRequires:  gd-devel >= 2.0.0, libpng-devel
 +
BuildRequires:  cryptopp-devel, libupnp-devel
 +
Requires(pre):  chkconfig
 +
Requires:      %{name}-nogui = %{version}-%{release}
 +
 +
 +
%description
 +
aMule is a peer to peer file sharing client, based on the well known eMule.
 +
aMule works on Linux, Mac, *BSD and Windows, which makes it the first
 +
multi-platform edonkey network client.
 +
 +
%package nogui
 +
Summary:        aMule components which don't require a GUI (for servers)
 +
Group:          Applications/Internet
 +
 +
%description nogui
 +
This package containes the aMule components which don't require a GUI.
 +
It is useful for servers which don't have Xorg.
 +
 +
 +
%package -n xchat-%{name}
 +
Summary:        Plugin to display aMule's statistics in XChat
 +
Group:          Applications/Internet
 +
Requires:      %{name} = %{version}-%{release}
 +
Requires:      xchat
 +
 +
%description -n xchat-%{name}
 +
This plugins allows you to display aMule statistics in XChat
 +
 +
 +
%prep
 +
%setup -q -n aMule-%{version}
 +
 +
%build
 +
%configure \
 +
  --prefix=/usr \
 +
  --with-denoise-level=4 \
 +
  --enable-optimize \
 +
  --enable-debug \
 +
  --enable-alc \
 +
  --enable-alcc \
 +
  --enable-cas \
 +
  --enable-wxcas \
 +
  --enable-amulecmd \
 +
  --enable-amule-daemon \
 +
  --enable-amule-gui \
 +
  --enable-geoip \
 +
  --enable-webserver \
 +
  --enable-xas \
 +
  --disable-ccache
 +
 +
%{__make}
 +
 +
%install
 +
%{__rm} -rf $RPM_BUILD_ROOT _docs
 +
%{__make} install DESTDIR=$RPM_BUILD_ROOT
 +
 +
%find_lang %{name}
 +
# desktop files
 +
desktop-file-install --vendor "" \
 +
                      --delete-original\
 +
                      --dir $RPM_BUILD_ROOT%{_datadir}/applications\
 +
                      $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
 +
 +
iconv -f ISO-8859-1 -t UTF-8 < src/utils/aLinkCreator/alc.desktop \
 +
      > $RPM_BUILD_ROOT%{_datadir}/applications/alc.desktop
 +
desktop-file-install --vendor "" \
 +
                      --delete-original\
 +
                      --dir $RPM_BUILD_ROOT%{_datadir}/applications\
 +
                      $RPM_BUILD_ROOT%{_datadir}/applications/alc.desktop
 +
 +
desktop-file-install --vendor "" \
 +
                      --delete-original\
 +
                      --dir $RPM_BUILD_ROOT%{_datadir}/applications\
 +
                      $RPM_BUILD_ROOT%{_datadir}/applications/wxcas.desktop
 +
 +
desktop-file-install --vendor "" \
 +
                      --delete-original\
 +
                      --dir $RPM_BUILD_ROOT%{_datadir}/applications\
 +
                      $RPM_BUILD_ROOT%{_datadir}/applications/%{name}gui.desktop
 +
 +
%clean
 +
%{__rm} -rf $RPM_BUILD_ROOT
 +
 +
%files -f %{name}.lang
 +
 +
%defattr(-,root,root)
 +
%doc %{_datadir}/doc/aMule-%{version}
 +
%{_bindir}/alc
 +
%{_bindir}/amule
 +
%{_bindir}/wxcas
 +
%{_bindir}/amulegui
 +
%{_datadir}/%{name}/
 +
%{_datadir}/applications/*.desktop
 +
%{_datadir}/pixmaps/*
 +
%{_mandir}/man1/alc.1.gz
 +
%{_mandir}/*/man1/alc.1.gz
 +
%{_mandir}/man1/amule.1.gz
 +
%{_mandir}/*/man1/amule.1.gz
 +
%{_mandir}/man1/wxcas.1.gz
 +
%{_mandir}/*/man1/wxcas.1.gz
 +
%{_mandir}/man1/amulegui.1.gz
 +
%{_mandir}/*/man1/amulegui.1.gz
 +
%exclude %{_datadir}/%{name}/webserver
 +
 +
%files nogui
 +
%{_bindir}/alcc
 +
%{_bindir}/amulecmd
 +
%{_bindir}/amuled
 +
%{_bindir}/amuleweb
 +
%{_bindir}/cas
 +
%{_bindir}/ed2k
 +
%{_datadir}/%{name}/webserver
 +
%{_datadir}/cas
 +
%{_mandir}/man1/alcc.1.gz
 +
%{_mandir}/*/man1/alcc.1.gz
 +
%{_mandir}/man1/amulecmd.1.gz
 +
%{_mandir}/*/man1/amulecmd.1.gz
 +
%{_mandir}/man1/amuled.1.gz
 +
%{_mandir}/*/man1/amuled.1.gz
 +
%{_mandir}/man1/amuleweb.1.gz
 +
%{_mandir}/*/man1/amuleweb.1.gz
 +
%{_mandir}/man1/cas.1.gz
 +
%{_mandir}/*/man1/cas.1.gz
 +
%{_mandir}/man1/ed2k.1.gz
 +
%{_mandir}/*/man1/ed2k.1.gz
 +
 +
 +
%files -n xchat-%{name}
 +
%defattr(-,root,root)
 +
%{_bindir}/autostart-xas
 +
%{_libdir}/xchat/plugins/xas.pl
 +
%{_mandir}/man1/xas.1.gz
 +
%{_mandir}/*/man1/xas.1.gz
 +
 +
 +
%changelog
 +
* Wed Apr 05 2009 iz0bbz <iz0bbz at libero dot it>
 +
- Updated to aMule 2.2.4
 +
- Fixed dependency between amule and amule-nogui
 +
* Wed Dec 28 2008 iz0bbz <iz0bbz at libero dot it>
 +
- Alignment to rpmfusion spec file
 +
- gui/nogui split
 +
 
 +
==== Running rpmbuild ====
 +
Put the aMule source file (aMule-2.2.5.tar.bz2) into your ~/rpmbuild/SOURCES directory.
 +
 
 +
Put the spec file into ~/rpmbuild/SPECS/aMule-2.2.5.spec
 +
 
 +
Build the packages (binary, sources, debuginfo) with
 +
 
 +
rpmbuild -ba ~/rpmbuild/SPECS/aMule-2.2.5.spec
 +
 
 +
If everything goes fine, you have your packages built in the following directory:
 +
 
 +
Source RPM package in ~/rpmbuild/SRPMS
 +
 
 +
Binary RPM packages, including debuginfo packages:
 +
 
 +
Fedora 12 and later in ~/rpmbuild/RPMS/i686
 +
 
 +
Fedora 11 in ~/rpmbuild/RPMS/i586
 +
 
 +
Fedora 10 and previous in ~/rpmbuild/RPMS/i386
 +
 
 +
== Suggestions ==
  
 
: * 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.
 
: * 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.
Line 73: Line 340:
 
: * Keep an eye on the [http://forum.amule.org aMule forum] and the [[Main_Page|aMule Project FAQ]] and probably use the search function: most questions have been answered before.
 
: * Keep an eye on the [http://forum.amule.org aMule forum] and the [[Main_Page|aMule Project FAQ]] and probably use the search function: most questions have been answered before.
  
: * Don't drink and drive.
+
=Creating RPMs for RHEL 5 (CentOS 5)=
 +
==Prerequisites==
 +
# Working rpmforge repository.
 +
# Source packages for wxGTK and compat-wxGTK26 gotten from FC9 repositories.
 +
# Installed libcrypto++ (and headers).
 +
# Installed and updated version of flex (2.5.35 for example)
 +
# amule-2.2.1 SPEC file.
 +
# amule-2.2.1 sources.
 +
# Working rpmbuild tools (and compilers and all the packages needed and listed in this page).
 +
 
 +
==Steps==
 +
===Configure rpmforge repository===
 +
If you hasn't it, see the how to here: https://rpmrepo.org/RPMforge/Using and install it.
 +
I don't use "atrpms" repository, rpmforge packages appears to be more stable than atrpms ones.
 +
 
 +
===Install wxGTK 2.8.x===
 +
You can go to FC9 repository ( http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Everything/i386/os/Packages/ ) and download wxGTK binaries and install them.
 +
 
 +
If you has any wxGTK 2.6 dependences, you'll need compat-wxGTK26 package too.
 +
 
 +
===Install libcrypto++===
 +
You can install libcrypto from scratch (no problem) as explained below for FC or you can package it (a bit work).
 +
 
 +
To package it for CentOS 5, use this SPEC file:
 +
  Name: libcrypto++
 +
  Version: 5.5.2
 +
  Release: 1_ArcosCom
 +
 
 +
  Summary: Crypto++: a C++ Class Library of Cryptographic Primitives
 +
  License: BSD-like
 +
  Group: System/Libraries
 +
  Url: http://www.cryptopp.com
 +
  Packager: Andrey Semenov <mitrofan@altlinux.ru>
 +
 
 +
  Source: crypto-%version.tar.bz2
 +
 
 +
  # Automatically added by buildreq on Sat May 15 2004
 +
  BuildRequires: gcc-c++ libstdc++-devel
 +
  BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 +
 
 +
  %description
 +
  Crypto++: a C++ Class Library of Cryptographic Primitives
 +
 
 +
  %package -n %name-devel
 +
  Summary: Development files for libcrypto
 +
  Group: Development/C
 +
  PreReq: %name = %version-%release
 +
  License: Compilation Copyright (c) 1995-2003 by Wei Dai.  All rights reserved.
 +
 
 +
  %description -n %name-devel
 +
  This package contains development files required for packaging
 +
  libcrypto-based software.
 +
 
 +
  %prep
 +
  %setup -q -n crypto-%version
 +
 
 +
  %build
 +
  make -f GNUmakefile
 +
 
 +
  %install
 +
  %__mkdir_p ${RPM_BUILD_ROOT}%_includedir/cryptopp
 +
  %__cp *.h ${RPM_BUILD_ROOT}%_includedir/cryptopp
 +
  %__mkdir_p ${RPM_BUILD_ROOT}%_libdir
 +
  %__cp libcryptopp.a ${RPM_BUILD_ROOT}%_libdir
 +
 
 +
  %post -n %name -p /sbin/ldconfig
 +
 
 +
  %postun -n %name -p /sbin/ldconfig
 +
 
 +
  %files -n %name
 +
  %doc Readme.txt License.txt
 +
  %_libdir/*.a
 +
 
 +
  %files -n %name-devel
 +
  %_includedir/cryptopp
 +
 
 +
  %changelog
 +
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 5.5.2-1_ArcosCom
 +
  - Updated to 5.5.2
 +
  - Rebuild for CentOS 5.2
 +
 
 +
  * Tue Aug 03 2004 Andrey Semenov <mitrofan@altlinux.ru> 5.2.1-alt1
 +
  - fix realese
 +
 
 +
  * Tue May 11 2004 Andrey Semenov <mitrofan@altlinux.ru> 5.1-alt1
 +
  - First version of RPM package
 +
 
 +
You'll need a tar.bz2, not a zip file as you download from http://www.cryptopp.com/#download, to make it do:
 +
  # wget http://www.cryptopp.com/cryptopp552.zip
 +
  # mkdir crypto-5.5.2
 +
  # cd crypto-5.5.2
 +
  # unzip ../cryptopp552.zip
 +
  # cd ..
 +
  # tar -cf crypto-5.5.2.tar crypto-5.5.2/
 +
  # bzip2 crypto-5.5.2.tar
 +
 
 +
Then, with the libcrypto++.spec file in ~/rpmbuild/SPECS and the crypto-5.5.2.tar.bz2 in ~/rpmbuild/SOURCES you can build your binary package (and source package too) with:
 +
  # rpmbuild -ba ~/rpmbuild/SPECS/libcrypto++.spec
 +
 
 +
And install it (and the devel one) as root:
 +
  # sudo rpm -ihv ~/rpmbuild/RPMS/i386/libcrypto++.i386.rpm
 +
  # sudo rpm -ihv ~/rpmbuild/RPMS/i386/libcrypto++-devel.i386.rpm
 +
 
 +
===Upgrade flex===
 +
When I tried to build amule package, I encountered problems with the flex version in CentOS 5.x, amule need a more recent version of flex and I have to create an upgraded package for it.
  
... to be continued ...
+
Be warned: An updated version of flex is only needed for compile/build amule, if you have a binary package YOU DON'T NEED IT.
  
== Additional fun ==
+
Go to you ~/rpmbuild/SOURCES and download a recent flex version:
 +
  # wget http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.bz2?download
  
This section covers additional ways to have fun with or around [[aMule]].
+
Download your flex 2.5.4a source package too, to get an initial SPEC file and the patches:
 +
  # cd ~/rpmbuild/SRPMS
 +
  # wget http://mirror.centos.org/centos/5/os/SRPMS/flex-2.5.4a-41.fc6.src.rpm
 +
  # rpm -ihv flex-2.5.4a-41.fc6.src.rpm
  
[http://www.uk.research.att.com/vnc 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.
+
Now you will have an initial SPEC file in ~/rpmbuild/SPECS and you can edit it to change into this one:
 +
  Summary: A tool for creating scanners (text pattern recognizers).
 +
  Name: flex
 +
  Version: 2.5.35
 +
  Release: 1_ArcosCom%{?dist}
 +
  License: BSD
 +
  Group: Development/Tools
 +
  URL: http://www.gnu.org/software/flex/
 +
  BuildRoot: %{_tmppath}/%{name}-root
 +
  Source: %{name}-%{version}.tar.bz2
 +
  Patch0: flex-2.5.4a-skel.patch
 +
  Patch1: flex-2.5.4-glibc22.patch
 +
  Patch2: flex-2.5.4a-gcc3.patch
 +
  Patch3: flex-2.5.4a-gcc31.patch
 +
  Patch4: flex-2.5.4a2.patch
 +
  Patch5: flex-pic.patch
 +
  Patch6: flex-2.5.4a2-std.patch
 +
  Patch7: flex-2.5.4a2-warn.patch
 +
  Patch8: flex-2.5.4a2-shapwarn.patch
 +
  Patch9: flex-2.5.4a2-iniscan.patch
 +
  Patch10: flex-2.5.4a-Makefile.in.patch
 +
  #Patch11: flex-2.5.4a-posix.patch
 +
  BuildRequires: autoconf, byacc
 +
 
 +
  %description
 +
  The flex program generates scanners.  Scanners are programs which can
 +
  recognize lexical patterns in text.  Flex takes pairs of regular
 +
  expressions and C code as input and generates a C source file as
 +
  output.  The output file is compiled and linked with a library to
 +
  produce an executable.  The executable searches through its input for
 +
  occurrences of the regular expressions.  When a match is found, it
 +
  executes the corresponding C code.  Flex was designed to work with
 +
  both Yacc and Bison, and is used by many programs as part of their
 +
  build process.
 +
 
 +
  You should install flex if you are going to use your system for
 +
  application development.
 +
 
 +
  %prep
 +
  %setup -q -n %{name}-%{version}
 +
  %patch0 -p1
 +
  #%patch1 -p1 -b .glibc22
 +
  #%patch2 -p1 -b .glib3
 +
  #%patch3 -p1 -b .gcc31
 +
  #%patch4 -p1 -b .yynoinput
 +
  #%patch5 -p1 -b .pic
 +
  #%patch6 -p1 -b .std
 +
  #%patch7 -p1 -b .warn
 +
  #%patch8 -p1 -b .shapwarn
 +
  #%patch9 -p1 -b .iniscan
 +
  #%patch10 -p1
 +
  #%patch11 -p1
 +
 
 +
  %build
 +
  autoconf
 +
  %configure
 +
  make
 +
 
 +
  %install
 +
  rm -rf $RPM_BUILD_ROOT
 +
 
 +
  %makeinstall mandir=$RPM_BUILD_ROOT/%{_mandir}/man1
 +
 
 +
  ( cd ${RPM_BUILD_ROOT}
 +
    ln -sf flex .%{_bindir}/lex
 +
    ln -s flex.1 .%{_mandir}/man1/lex.1
 +
    ln -s flex.1 .%{_mandir}/man1/flex++.1
 +
    ln -s libfl.a .%{_libdir}/libl.a
 +
  )
 +
 
 +
  %check
 +
  echo ============TESTING===============
 +
  #make bigcheck
 +
  echo ============END TESTING===========
 +
 
 +
  %clean
 +
  rm -rf ${RPM_BUILD_ROOT}
 +
 
 +
  %files
 +
  %defattr(-,root,root)
 +
  %doc COPYING NEWS README
 +
  %{_bindir}/*
 +
  %{_mandir}/man1/*
 +
  %{_libdir}/*.a
 +
  %{_includedir}/FlexLexer.h
 +
  %{_datadir}/info/dir
 +
  %{_datadir}/info/flex.info-1.gz
 +
  %{_datadir}/info/flex.info-2.gz
 +
  %{_datadir}/info/flex.info.gz
 +
  %{_datadir}/locale/ca/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/da/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/de/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/es/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/fr/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/ga/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/ko/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/nl/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/pl/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/pt_BR/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/ro/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/ru/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/sv/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/tr/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/vi/LC_MESSAGES/flex.mo
 +
  %{_datadir}/locale/zh_CN/LC_MESSAGES/flex.mo
 +
 
 +
  %changelog
 +
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 2.5.35-1_ArcosCom
 +
  - Updated to 2.5.35
 +
 
 +
  * Tue Jul 18 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-41
 +
  - Reverting posix patch.  Imposing posix because of warning is too
 +
    much of a restriction.
 +
 
 +
  * Sun Jul 16 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-40
 +
  - using dist tag
 +
 
 +
  * Fri Jul 14 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-39
 +
  - fileno is defined in posix standard, so adding #define _POSIX_SOURCE
 +
    to compile without warnings (#195687)
 +
  - dropping 183098 test, since the original bug was already resolved
 +
 
 +
  * Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-38.1
 +
  - rebuild
 +
 
 +
  * Fri Mar 10 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-38
 +
  - Caught the real cause of #183098.  It failed because the parser
 +
    built with `flex -f' *sometimes* made it into the final package, and
 +
    -f assumes seven-bit tables.  Solution has two steps.  Move `make
 +
    bigcheck' to `%%check' part, where it belongs anyway, so that flexes
 +
    built during `make bigcheck' don't overwrite original build.  And
 +
    change makefile so that `make bigcheck' will *always* execute *all*
 +
    check commands.
 +
 
 +
  * Wed Mar  8 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.4
 +
  - adding test for #183098 into build process
 +
 
 +
  * Fri Mar  2 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.3
 +
  - rebuilt, no changes inside. In hunt for #183098
 +
 
 +
  * Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.2
 +
  - bump again for double-long bug on ppc(64)
 +
 
 +
  * Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.1
 +
  - rebuilt for new gcc4.1 snapshot and glibc changes
 +
 
 +
  * Wed Feb 02 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-37
 +
  - adding `make bigcheck' into build process.  Refreshing initscan.c to
 +
    make this possible.
 +
 
 +
  * Wed Jan 18 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-36
 +
  - Applying Jonathan S. Shapiro's bugfix-fixing patch. More std:: fixes
 +
    and better way to silent warnings under gcc.
 +
 
 +
  * Fri Jan 13 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-35
 +
  - Adding `std::' prefixes, got rid of `using namespace std'. (#115354)
 +
  - Dummy use of `yy_flex_realloc' to silent warnings. (#30943)
 +
  - Adding URL of flex home page to spec (#142675)
 +
 
 +
  * Sun Dec 18 2005 Jason Vas Dias<jvdias@redhat.com>
 +
  - rebuild with 'flex-pic.patch' to enable -pie links
 +
    on x86_64 (patch from Jesse Keating) .
 +
 
 +
  * Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Sun Apr 10 2005 Jakub Jelinek <jakub@redhat.com> 2.5.4a-34
 +
  - rebuilt with GCC 4
 +
  - add %%check script
 +
 
 +
  * Tue Aug 24 2004 Warren Togami <wtogami@redhat.com> 2.5.4a-33
 +
  - #116407 BR byacc
 +
 
 +
  * Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Wed Jan 22 2003 Tim Powers <timp@redhat.com>
 +
  - rebuilt
 +
 
 +
  * Tue Jan  7 2003 Jeff Johnson <jbj@redhat.com> 2.5.4a-28
 +
  - don't include -debuginfo files in package.
 +
 
 +
  * Mon Nov  4 2002 Than Ngo <than@redhat.com> 2.5.4a-27
 +
  - YY_NO_INPUT patch from Jean Marie
 +
 
 +
  * Fri Jun 21 2002 Tim Powers <timp@redhat.com>
 +
  - automated rebuild
 +
 
 +
  * Tue Jun 18 2002 Than Ngo <than@redhat.com> 2.5.4a-25
 +
  - don't forcibly strip binaries
 +
 
 +
  * Thu May 23 2002 Tim Powers <timp@redhat.com>
 +
  - automated rebuild
 +
 
 +
  * Tue Apr  2 2002 Than Ngo <than@redhat.com> 2.5.4a-23
 +
  - More ISO C++ 98 fixes (#59670)
 +
 
 +
  * Tue Feb 26 2002 Than Ngo <than@redhat.com> 2.5.4a-22
 +
  - rebuild in new enviroment
 +
 
 +
  * Wed Feb 20 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.5.4a-21
 +
  - More ISO C++ 98 fixes (#59670)
 +
 
 +
  * Tue Feb 19 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.5.4a-20
 +
  - Fix ISO C++ 98 compliance (#59670)
 +
 
 +
  * Wed Jan 23 2002 Than Ngo <than@redhat.com> 2.5.4a-19
 +
  - fixed #58643
 +
 
 +
  * Wed Jan 09 2002 Tim Powers <timp@redhat.com>
 +
  - automated rebuild
 +
 
 +
  * Tue Nov  6 2001 Than Ngo <than@redhat.com> 2.5.4a-17
 +
  - fixed for working with gcc 3 (bug #55778)
 +
 
 +
  * Sat Oct 13 2001 Than Ngo <than@redhat.com> 2.5.4a-16
 +
  - fix wrong License (bug #54574)
 +
 
 +
  * Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
 +
  - Bump release + rebuild.
 +
 
 +
  * Sat Sep 30 2000 Bernhard Rosenkraenzer <bero@redhat.com>
 +
  - Fix generation of broken code (conflicting isatty() prototype w/ glibc 2.2)
 +
    This broke, among other things, the kdelibs 2.0 build
 +
  - Fix source URL
 +
 
 +
  * Thu Sep  7 2000 Jeff Johnson <jbj@redhat.com>
 +
  - FHS packaging (64bit systems need to use libdir).
 +
 
 +
  * Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
 +
  - automatic rebuild
 +
 
 +
  * Tue Jun  6 2000 Bill Nottingham <notting@redhat.com>
 +
  - rebuild, FHS stuff.
 +
 
 +
  * Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
 +
  - handle compressed man pages
 +
 
 +
  * Fri Jan 28 2000 Bill Nottingham <notting@redhat.com>
 +
  - add a libl.a link to libfl.a
 +
 
 +
  * Wed Aug 25 1999 Jeff Johnson <jbj@redhat.com>
 +
  - avoid uninitialized variable warning (Erez Zadok).
 +
 
 +
  * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
 +
  - auto rebuild in the new build environment (release 6)
 +
 
 +
  * Fri Dec 18 1998 Bill Nottingham <notting@redhat.com>
 +
  - build for 6.0 tree
 +
 
 +
  * Mon Aug 10 1998 Jeff Johnson <jbj@redhat.com>
 +
  - build root
 +
 
 +
  * Mon Apr 27 1998 Prospector System <bugs@redhat.com>
 +
  - translations modified for de, fr, tr
 +
 
 +
  * Thu Oct 23 1997 Donnie Barnes <djb@redhat.com>
 +
  - updated from 2.5.4 to 2.5.4a
 +
 
 +
  * Mon Jun 02 1997 Erik Troan <ewt@redhat.com>
 +
  - built against glibc
 +
 
 +
  * Thu Mar 20 1997 Michael Fulbright <msf@redhat.com>
 +
  - Updated to v. 2.5.4
  
Using [[aMule]] in [http://www.uk.research.att.com/vnc VNC] is quite easy in [http://www.redhat.com RedHat]/[http://fedora.redhat.com Fedora], because you don't need more than a simple [http://www.rpm.com RPM] install <!-- "install" should be a link to part 5 --> of vnc-server and a minor modification to a startup script.
+
The changes against the oficial SPEC were:
 +
#) Added comments for the don't needed patches.
 +
#) Comment the test step.
 +
#) Upgrade the version and release.
 +
#) Don't remember more.
  
Just install vnc-server ([http://www.rpm.org RPM] comes with your installation CDs) and drop your root privileges<!-- "root privileges" should be a link to part 3 -->.
+
Build your flex package:
This howto assumes that your default user is named ''bob''.
+
  # rpmbuild -ba ~/rpmbuild/SPECS/flex.spec
As 'bob' do: ''vncserver -depth 16 :1''. If you never used [http://www.uk.research.att.com/vnc VNC] as 'bob' before, the [http://www.uk.research.att.com/vnc VNC] server should ask you for a password. This password is used to connect to your [http://www.uk.research.att.com/vnc VNC] session. It is ''not'' the password your user 'bob' has and it should not be set to the same password. Furthermore your [http://www.uk.research.att.com/vnc 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 [http://www.uk.research.att.com/vnc 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 [http://www.dns.net/dnsrd DNS] is running, or your server is running on the [http://www.faqs.org/rfcs/rfc791.html 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 [http://www.uk.research.att.com/vnc VNC]. Go back to your shell and stop [http://www.uk.research.att.com/vnc VNC] using ''vncserver -kill :1'' as 'bob'. Now your [http://www.uk.research.att.com/vnc 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 [http://www.uk.research.att.com/vnc 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: [http://www.uk.research.att.com/vnc 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 [http://www.kde.org KDE] you should have a nice button on your taskbar already. That should protect your system, even if your [http://www.uk.research.att.com/vnc VNC] password has been compromised.
+
  
== How to use [http://www.rpm.org RPM] ==
+
Update/install your flex binary package:
 +
  # rpm -Uhv --force ~/rpmbuild/RPMS/i386/flex-2.5.35.i386.rpm (for update)
 +
  # rpm -ihv --force ~/rpmbuild/RPMS/i386/flex-2.5.35.i386.rpm (for install)
  
There are several how to's on [http://www.rpm.org 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.
+
Warning: some files are overwriten installing/updating flex, that is the "--force" parameter presence.
 +
  # rpm -Uhv --force ~/rpmbuild/RPMS/i386/flex-2.5.35-1_ArcosCom.i386.rpm  
 +
  Preparing...                ########################################### [100%]
 +
      1:flex                  warning: /usr/share/info/dir saved as /usr/share/info/dir.rpmsave
 +
  ########################################### [100%]
  
Install: ''rpm -i rpmname'' (use the complete filename of your [http://www.rpm.org RPM], like: ''openssl-0.9.7a-35.i386.rpm'')
+
===Upgrade/Install aMule-2.2.1===
 +
# Download aMule-2.2.1.tar.bz2 into your ~/rpmbuild/SOURCES directory.
 +
# Use this SPEC file (create into your ~/rpmbuild/SPECS directory):
 +
  Summary:        aMule - another eMule p2p client
 +
  Name:          amule
 +
  Version:        2.2.1
 +
  Release:        1_ArcosCom
 +
  License:        GPL
 +
  Group:          Applications/Internet
 +
  Packager:      The aMule Team (http://forum.amule.org/)
 +
  Vendor:        The aMule Project
 +
  URL:            http://www.amule.org/
 +
  Source:        aMule-%{version}.tar.bz2
 +
  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 +
  #BuildRoot: /usr/src/redhat/BUILDROOT/%{name}-%{version}-%{release}-root
 +
  BuildRequires:  wxGTK-devel >= 2.8.0
 +
  BuildRequires:  gettext-devel, bison, GeoIP-devel
 +
  BuildRequires: libcrypto++-devel >= 5.1.0
 +
  BuildRequires:  flex >= 2.5.33
 +
  Requires: libcrypto++ >= 5.1.0
 +
 
 +
  %description
 +
  aMule is a peer to peer file sharing client, based on the well known eMule.
 +
  Starting with 2.0.0 aMule works on Linux, Mac, *BSD and Windows, which makes it
 +
  the first multi-platform edonkey network client.
 +
 
 +
  %prep
 +
  %setup -q -n aMule-2.2.1
 +
 
 +
  %build
 +
  %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
 +
 
 +
  %{__make}
 +
 
 +
  %install
 +
  [ ! "$RPM_BUILD_ROOT" = "/" ] && %{__rm} -rf $RPM_BUILD_ROOT _docs
 +
  %{__make} install DESTDIR=$RPM_BUILD_ROOT
 +
 
 +
  %clean
 +
  [ ! "$RPM_BUILD_ROOT" = "/" ] && %{__rm} -rf "$RPM_BUILD_ROOT"
 +
 
 +
  %files
 +
  %defattr(-,root,root)
 +
  %doc %{_datadir}/doc/*
 +
  %{_bindir}/*
 +
  %{_libdir}/*
 +
  %{_datadir}/*
 +
  %{_datadir}/applications/*
 +
  %{_datadir}/amule/*
 +
  %{_datadir}/locale/*
 +
  %{_datadir}/pixmaps/*
 +
  %{_mandir}/*
 +
 
 +
  %changelog
 +
 
 +
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 2.2.1-1_ArcosCom
 +
  - Rebuild for CentOS 5.2.
 +
 
 +
  * Tue Jun 13 2008 iz0bbz 1.1.2-1
 +
  - Initial version
  
Remove: ''rpm -e rpmname'' (don't use the complete filename here, just the package name. Like ''openssl'', but not ''openssl-0.9.7a-35'')
+
Thanks to iz0bbz for the initial version of this SPEC.
 +
# Build your binary and source packages:
 +
  # rpmbuild -ba ~/rpmbuild/SPECS/amule-2.2.1_ArcosCom.spec
 +
# Install (or update) as root:
 +
  # rpm -ihv /rpmbuild/RPMS/i386/amule-2.2.1_ArcosCom.i386.spec (for install)
 +
  # rpm -Uhv /rpmbuild/RPMS/i386/amule-2.2.1_ArcosCom.i386.spec (for update)
  
Update: ''rpm -U rpmname'' (use the complete filename of your rpm, like: ''openssl-0.9.7a-35.i386.rpm'')
+
#Enjoy!!
  
If you need any further info on [http://www.rpm.org RPM], please consult the rpm howto or use ''[http://www.rpm.org/max-rpm/rpm.8.html man rpm]''.
+
==Notes==
 +
# You can download the packages from FC9 repository (or livna ones) and use them instead build the binaries from sources.
 +
# rpmforge is for RHEL 5 as livna is for FC8/9.

Latest revision as of 12:00, 22 December 2010

aMule in Fedora

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 9 and later distributions, and aMule v2.2.x

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.

Rpmfusion free packages repository includes amule stable packages

You must first configure your Fedora system to use the external repositories. This is usually done manually installing a rpm. For example, for rpmfusion you have to do as root:

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

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

Having a working internet connection, download the amule packages, become 'root' user and do a :

yum --nogpgcheck localinstall <your-amule-RPM-package>

aMule requires other libraries (wxGTK, GeoIP, uPnP ...) to be installed, if they are missing on your system yum will download & install them together with the amule package.

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 ...

Please, be sure to have enough space. You need 700Mb-1Gbyte of temporary space on your disk. The last nuclear-powered,speed-of light capable CPU is not necessary (even if it helps!).


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-c++ make bison flex binutils-devel gettext-devel GeoIP-devel wxGTK-devel zlib-devel libpng-devel gd-devel libupnp-devel cryptopp-devel

Many other packages are installed by yum together with the ones above, due to dependencies. That's regular.

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

yum install rpm-build redhat-rpm-config

Downloading & compiling crypto++

crypto++ is a cryptographic library needed by amule compilation process.

On Fedora 9 and later, this library is included in standard Fedora repositories and you should have installed such library following the previous section instructions.

On Fedora 8 and below, or if you want to compile crypto++ libraries yourself for whatever reasons, here follows the steps required.

Download latest crypto++ sources from http://www.cryptopp.com (version 5.5.2 at December 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.


Hint:
If crypto++ tests fail, you can try to modify compilations options as follows: go to the crypto++ sources directory. Locate the "GNUmakefile" file and edit it. In the first line, change
CXXFLAGS = -DNDEBUG -g -O2
to
CXXFLAGS = -DNDEBUG -g -O0 -DCRYPTOPP_DISABLE_X86ASM
and then recompile / test your crypto++ build again as written above.

The usual way: configure/compile/install

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 switches meaning 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.

Installing your aMule build

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.

Creating your own RPM packages

Creating RPM files *implies* running configure/make/build as written in the section before, but, as an advantage:

It performs such steps in a controlled way, following "instructions" contained in a file (the spec file)

Having RPM package(s) in output, it gives you much more control on how to install/update software on your PC.

As a prerequisite, please install on your fedora system the following two packages, which installs 'rpmbuild' - the application needed to create RPM packages- and set up the standard Fedora RPM configuration.

yum install rpm-build redhat-rpm-config

The spec file

In this file you give instructions to rpmbuild on how to configure and compile amule - and how to organize the output packages.

Here follows a (quite complex) example based on aMule 2.2.5 , which builds several packages following the rpmfusion convention.

Please update the spec file your information "Packager" and changing the "Version" row as appropriate.


Name:           amule
Version:        2.2.5
Release:        1%{?dist}
Summary:        File sharing client
License:        GPLv2+
Group:          Applications/Internet
Source:         aMule-%{version}.tar.bz2
Packager:       thepackager <thepackager@yourmail.com>
URL:            http://www.amule.org
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires:  wxGTK-devel >= 2.8.9, desktop-file-utils
BuildRequires:  gettext-devel, flex, bison, GeoIP-devel
BuildRequires:  gd-devel >= 2.0.0, libpng-devel
BuildRequires:  cryptopp-devel, libupnp-devel
Requires(pre):  chkconfig
Requires:       %{name}-nogui = %{version}-%{release}


%description
aMule is a peer to peer file sharing client, based on the well known eMule.
aMule works on Linux, Mac, *BSD and Windows, which makes it the first
multi-platform edonkey network client.

%package nogui
Summary:        aMule components which don't require a GUI (for servers)
Group:          Applications/Internet

%description nogui
This package containes the aMule components which don't require a GUI.
It is useful for servers which don't have Xorg.


%package -n xchat-%{name}
Summary:        Plugin to display aMule's statistics in XChat
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
Requires:       xchat

%description -n xchat-%{name}
This plugins allows you to display aMule statistics in XChat


%prep
%setup -q -n aMule-%{version}

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

%{__make}

%install
%{__rm} -rf $RPM_BUILD_ROOT _docs
%{__make} install DESTDIR=$RPM_BUILD_ROOT

%find_lang %{name}
# desktop files
desktop-file-install --vendor "" \
                     --delete-original\
                     --dir $RPM_BUILD_ROOT%{_datadir}/applications\
                     $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

iconv -f ISO-8859-1 -t UTF-8 < src/utils/aLinkCreator/alc.desktop \
      > $RPM_BUILD_ROOT%{_datadir}/applications/alc.desktop
desktop-file-install --vendor "" \
                     --delete-original\
                     --dir $RPM_BUILD_ROOT%{_datadir}/applications\
                     $RPM_BUILD_ROOT%{_datadir}/applications/alc.desktop

desktop-file-install --vendor "" \
                     --delete-original\
                     --dir $RPM_BUILD_ROOT%{_datadir}/applications\
                     $RPM_BUILD_ROOT%{_datadir}/applications/wxcas.desktop

desktop-file-install --vendor "" \
                     --delete-original\
                     --dir $RPM_BUILD_ROOT%{_datadir}/applications\
                     $RPM_BUILD_ROOT%{_datadir}/applications/%{name}gui.desktop

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.lang

%defattr(-,root,root)
%doc %{_datadir}/doc/aMule-%{version}
%{_bindir}/alc
%{_bindir}/amule
%{_bindir}/wxcas
%{_bindir}/amulegui
%{_datadir}/%{name}/
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*
%{_mandir}/man1/alc.1.gz
%{_mandir}/*/man1/alc.1.gz
%{_mandir}/man1/amule.1.gz
%{_mandir}/*/man1/amule.1.gz
%{_mandir}/man1/wxcas.1.gz
%{_mandir}/*/man1/wxcas.1.gz
%{_mandir}/man1/amulegui.1.gz
%{_mandir}/*/man1/amulegui.1.gz
%exclude %{_datadir}/%{name}/webserver

%files nogui
%{_bindir}/alcc
%{_bindir}/amulecmd
%{_bindir}/amuled
%{_bindir}/amuleweb
%{_bindir}/cas
%{_bindir}/ed2k
%{_datadir}/%{name}/webserver
%{_datadir}/cas
%{_mandir}/man1/alcc.1.gz
%{_mandir}/*/man1/alcc.1.gz
%{_mandir}/man1/amulecmd.1.gz
%{_mandir}/*/man1/amulecmd.1.gz
%{_mandir}/man1/amuled.1.gz
%{_mandir}/*/man1/amuled.1.gz
%{_mandir}/man1/amuleweb.1.gz
%{_mandir}/*/man1/amuleweb.1.gz
%{_mandir}/man1/cas.1.gz
%{_mandir}/*/man1/cas.1.gz
%{_mandir}/man1/ed2k.1.gz
%{_mandir}/*/man1/ed2k.1.gz


%files -n xchat-%{name}
%defattr(-,root,root)
%{_bindir}/autostart-xas
%{_libdir}/xchat/plugins/xas.pl
%{_mandir}/man1/xas.1.gz
%{_mandir}/*/man1/xas.1.gz


%changelog
* Wed Apr 05 2009 iz0bbz <iz0bbz at libero dot it> 
- Updated to aMule 2.2.4
- Fixed dependency between amule and amule-nogui
* Wed Dec 28 2008 iz0bbz <iz0bbz at libero dot it>
- Alignment to rpmfusion spec file
- gui/nogui split

Running rpmbuild

Put the aMule source file (aMule-2.2.5.tar.bz2) into your ~/rpmbuild/SOURCES directory.

Put the spec file into ~/rpmbuild/SPECS/aMule-2.2.5.spec

Build the packages (binary, sources, debuginfo) with

rpmbuild -ba ~/rpmbuild/SPECS/aMule-2.2.5.spec

If everything goes fine, you have your packages built in the following directory:

Source RPM package in ~/rpmbuild/SRPMS

Binary RPM packages, including debuginfo packages:

Fedora 12 and later in ~/rpmbuild/RPMS/i686

Fedora 11 in ~/rpmbuild/RPMS/i586

Fedora 10 and previous in ~/rpmbuild/RPMS/i386

Suggestions

* 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.

Creating RPMs for RHEL 5 (CentOS 5)

Prerequisites

  1. Working rpmforge repository.
  2. Source packages for wxGTK and compat-wxGTK26 gotten from FC9 repositories.
  3. Installed libcrypto++ (and headers).
  4. Installed and updated version of flex (2.5.35 for example)
  5. amule-2.2.1 SPEC file.
  6. amule-2.2.1 sources.
  7. Working rpmbuild tools (and compilers and all the packages needed and listed in this page).

Steps

Configure rpmforge repository

If you hasn't it, see the how to here: https://rpmrepo.org/RPMforge/Using and install it. I don't use "atrpms" repository, rpmforge packages appears to be more stable than atrpms ones.

Install wxGTK 2.8.x

You can go to FC9 repository ( http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Everything/i386/os/Packages/ ) and download wxGTK binaries and install them.

If you has any wxGTK 2.6 dependences, you'll need compat-wxGTK26 package too.

Install libcrypto++

You can install libcrypto from scratch (no problem) as explained below for FC or you can package it (a bit work).

To package it for CentOS 5, use this SPEC file:

  Name: libcrypto++
  Version: 5.5.2
  Release: 1_ArcosCom
  
  Summary: Crypto++: a C++ Class Library of Cryptographic Primitives
  License: BSD-like
  Group: System/Libraries
  Url: http://www.cryptopp.com
  Packager: Andrey Semenov <mitrofan@altlinux.ru>
  
  Source: crypto-%version.tar.bz2
  
  # Automatically added by buildreq on Sat May 15 2004
  BuildRequires: gcc-c++ libstdc++-devel
  BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  
  %description
  Crypto++: a C++ Class Library of Cryptographic Primitives
  
  %package -n %name-devel
  Summary: Development files for libcrypto
  Group: Development/C
  PreReq: %name = %version-%release
  License: Compilation Copyright (c) 1995-2003 by Wei Dai.  All rights reserved.
  
  %description -n %name-devel
  This package contains development files required for packaging
  libcrypto-based software.
  
  %prep
  %setup -q -n crypto-%version
  
  %build
  make -f GNUmakefile
  
  %install
  %__mkdir_p ${RPM_BUILD_ROOT}%_includedir/cryptopp
  %__cp *.h ${RPM_BUILD_ROOT}%_includedir/cryptopp
  %__mkdir_p ${RPM_BUILD_ROOT}%_libdir
  %__cp libcryptopp.a ${RPM_BUILD_ROOT}%_libdir
  
  %post -n %name -p /sbin/ldconfig
  
  %postun -n %name -p /sbin/ldconfig
  
  %files -n %name
  %doc Readme.txt License.txt
  %_libdir/*.a
  
  %files -n %name-devel
  %_includedir/cryptopp
  
  %changelog
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 5.5.2-1_ArcosCom
  - Updated to 5.5.2
  - Rebuild for CentOS 5.2
  
  * Tue Aug 03 2004 Andrey Semenov <mitrofan@altlinux.ru> 5.2.1-alt1
  - fix realese
  
  * Tue May 11 2004 Andrey Semenov <mitrofan@altlinux.ru> 5.1-alt1
  - First version of RPM package

You'll need a tar.bz2, not a zip file as you download from http://www.cryptopp.com/#download, to make it do:

  # wget http://www.cryptopp.com/cryptopp552.zip
  # mkdir crypto-5.5.2
  # cd crypto-5.5.2
  # unzip ../cryptopp552.zip
  # cd ..
  # tar -cf crypto-5.5.2.tar crypto-5.5.2/
  # bzip2 crypto-5.5.2.tar

Then, with the libcrypto++.spec file in ~/rpmbuild/SPECS and the crypto-5.5.2.tar.bz2 in ~/rpmbuild/SOURCES you can build your binary package (and source package too) with:

  # rpmbuild -ba ~/rpmbuild/SPECS/libcrypto++.spec

And install it (and the devel one) as root:

  # sudo rpm -ihv ~/rpmbuild/RPMS/i386/libcrypto++.i386.rpm
  # sudo rpm -ihv ~/rpmbuild/RPMS/i386/libcrypto++-devel.i386.rpm

Upgrade flex

When I tried to build amule package, I encountered problems with the flex version in CentOS 5.x, amule need a more recent version of flex and I have to create an upgraded package for it.

Be warned: An updated version of flex is only needed for compile/build amule, if you have a binary package YOU DON'T NEED IT.

Go to you ~/rpmbuild/SOURCES and download a recent flex version:

  # wget http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.bz2?download

Download your flex 2.5.4a source package too, to get an initial SPEC file and the patches:

  # cd ~/rpmbuild/SRPMS
  # wget http://mirror.centos.org/centos/5/os/SRPMS/flex-2.5.4a-41.fc6.src.rpm
  # rpm -ihv flex-2.5.4a-41.fc6.src.rpm

Now you will have an initial SPEC file in ~/rpmbuild/SPECS and you can edit it to change into this one:

  Summary: A tool for creating scanners (text pattern recognizers).
  Name: flex
  Version: 2.5.35
  Release: 1_ArcosCom%{?dist}
  License: BSD
  Group: Development/Tools
  URL: http://www.gnu.org/software/flex/
  BuildRoot: %{_tmppath}/%{name}-root
  Source: %{name}-%{version}.tar.bz2
  Patch0: flex-2.5.4a-skel.patch
  Patch1: flex-2.5.4-glibc22.patch
  Patch2: flex-2.5.4a-gcc3.patch
  Patch3: flex-2.5.4a-gcc31.patch
  Patch4: flex-2.5.4a2.patch
  Patch5: flex-pic.patch
  Patch6: flex-2.5.4a2-std.patch
  Patch7: flex-2.5.4a2-warn.patch
  Patch8: flex-2.5.4a2-shapwarn.patch
  Patch9: flex-2.5.4a2-iniscan.patch
  Patch10: flex-2.5.4a-Makefile.in.patch
  #Patch11: flex-2.5.4a-posix.patch
  BuildRequires: autoconf, byacc
  
  %description
  The flex program generates scanners.  Scanners are programs which can
  recognize lexical patterns in text.  Flex takes pairs of regular
  expressions and C code as input and generates a C source file as
  output.  The output file is compiled and linked with a library to
  produce an executable.  The executable searches through its input for
  occurrences of the regular expressions.  When a match is found, it
  executes the corresponding C code.  Flex was designed to work with
  both Yacc and Bison, and is used by many programs as part of their
  build process.
  
  You should install flex if you are going to use your system for
  application development.
  
  %prep
  %setup -q -n %{name}-%{version}
  %patch0 -p1
  #%patch1 -p1 -b .glibc22
  #%patch2 -p1 -b .glib3
  #%patch3 -p1 -b .gcc31
  #%patch4 -p1 -b .yynoinput
  #%patch5 -p1 -b .pic
  #%patch6 -p1 -b .std
  #%patch7 -p1 -b .warn
  #%patch8 -p1 -b .shapwarn
  #%patch9 -p1 -b .iniscan
  #%patch10 -p1
  #%patch11 -p1
  
  %build
  autoconf
  %configure
  make
  
  %install
  rm -rf $RPM_BUILD_ROOT
  
  %makeinstall mandir=$RPM_BUILD_ROOT/%{_mandir}/man1
  
  ( cd ${RPM_BUILD_ROOT}
    ln -sf flex .%{_bindir}/lex
    ln -s flex.1 .%{_mandir}/man1/lex.1
    ln -s flex.1 .%{_mandir}/man1/flex++.1
    ln -s libfl.a .%{_libdir}/libl.a
  )
  
  %check
  echo ============TESTING===============
  #make bigcheck
  echo ============END TESTING===========
  
  %clean
  rm -rf ${RPM_BUILD_ROOT}
  
  %files
  %defattr(-,root,root)
  %doc COPYING NEWS README
  %{_bindir}/*
  %{_mandir}/man1/*
  %{_libdir}/*.a
  %{_includedir}/FlexLexer.h
  %{_datadir}/info/dir
  %{_datadir}/info/flex.info-1.gz
  %{_datadir}/info/flex.info-2.gz
  %{_datadir}/info/flex.info.gz
  %{_datadir}/locale/ca/LC_MESSAGES/flex.mo
  %{_datadir}/locale/da/LC_MESSAGES/flex.mo
  %{_datadir}/locale/de/LC_MESSAGES/flex.mo
  %{_datadir}/locale/es/LC_MESSAGES/flex.mo
  %{_datadir}/locale/fr/LC_MESSAGES/flex.mo
  %{_datadir}/locale/ga/LC_MESSAGES/flex.mo
  %{_datadir}/locale/ko/LC_MESSAGES/flex.mo
  %{_datadir}/locale/nl/LC_MESSAGES/flex.mo
  %{_datadir}/locale/pl/LC_MESSAGES/flex.mo
  %{_datadir}/locale/pt_BR/LC_MESSAGES/flex.mo
  %{_datadir}/locale/ro/LC_MESSAGES/flex.mo
  %{_datadir}/locale/ru/LC_MESSAGES/flex.mo
  %{_datadir}/locale/sv/LC_MESSAGES/flex.mo
  %{_datadir}/locale/tr/LC_MESSAGES/flex.mo
  %{_datadir}/locale/vi/LC_MESSAGES/flex.mo
  %{_datadir}/locale/zh_CN/LC_MESSAGES/flex.mo
  
  %changelog
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 2.5.35-1_ArcosCom
  - Updated to 2.5.35
  
  * Tue Jul 18 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-41
  - Reverting posix patch.  Imposing posix because of warning is too
    much of a restriction.
  
  * Sun Jul 16 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-40
  - using dist tag
  
  * Fri Jul 14 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-39
  - fileno is defined in posix standard, so adding #define _POSIX_SOURCE
    to compile without warnings (#195687)
  - dropping 183098 test, since the original bug was already resolved
  
  * Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-38.1
  - rebuild
  
  * Fri Mar 10 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-38
  - Caught the real cause of #183098.  It failed because the parser
    built with `flex -f' *sometimes* made it into the final package, and
    -f assumes seven-bit tables.  Solution has two steps.  Move `make
    bigcheck' to `%%check' part, where it belongs anyway, so that flexes
    built during `make bigcheck' don't overwrite original build.  And
    change makefile so that `make bigcheck' will *always* execute *all*
    check commands.
  
  * Wed Mar  8 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.4
  - adding test for #183098 into build process
  
  * Fri Mar  2 2006 Petr Machata <pmachata@redhat.com> - 2.5.4a-37.3
  - rebuilt, no changes inside. In hunt for #183098
  
  * Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.2
  - bump again for double-long bug on ppc(64)
  
  * Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.5.4a-37.1
  - rebuilt for new gcc4.1 snapshot and glibc changes
  
  * Wed Feb 02 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-37
  - adding `make bigcheck' into build process.  Refreshing initscan.c to
    make this possible.
  
  * Wed Jan 18 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-36
  - Applying Jonathan S. Shapiro's bugfix-fixing patch. More std:: fixes
    and better way to silent warnings under gcc.
  
  * Fri Jan 13 2006 Petr Machata <pmachata@redhat.com> 2.5.4a-35
  - Adding `std::' prefixes, got rid of `using namespace std'. (#115354)
  - Dummy use of `yy_flex_realloc' to silent warnings. (#30943)
  - Adding URL of flex home page to spec (#142675)
  
  * Sun Dec 18 2005 Jason Vas Dias<jvdias@redhat.com>
  - rebuild with 'flex-pic.patch' to enable -pie links
    on x86_64 (patch from Jesse Keating) .
  
  * Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
  - rebuilt
  
  * Sun Apr 10 2005 Jakub Jelinek <jakub@redhat.com> 2.5.4a-34
  - rebuilt with GCC 4
  - add %%check script
  
  * Tue Aug 24 2004 Warren Togami <wtogami@redhat.com> 2.5.4a-33
  - #116407 BR byacc
  
  * Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
  - rebuilt
  
  * Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
  - rebuilt
  
  * Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
  - rebuilt
  
  * Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
  - rebuilt
  
  * Wed Jan 22 2003 Tim Powers <timp@redhat.com>
  - rebuilt
  
  * Tue Jan  7 2003 Jeff Johnson <jbj@redhat.com> 2.5.4a-28
  - don't include -debuginfo files in package.
  
  * Mon Nov  4 2002 Than Ngo <than@redhat.com> 2.5.4a-27
  - YY_NO_INPUT patch from Jean Marie
  
  * Fri Jun 21 2002 Tim Powers <timp@redhat.com>
  - automated rebuild
  
  * Tue Jun 18 2002 Than Ngo <than@redhat.com> 2.5.4a-25
  - don't forcibly strip binaries
  
  * Thu May 23 2002 Tim Powers <timp@redhat.com>
  - automated rebuild
  
  * Tue Apr  2 2002 Than Ngo <than@redhat.com> 2.5.4a-23
  - More ISO C++ 98 fixes (#59670)
  
  * Tue Feb 26 2002 Than Ngo <than@redhat.com> 2.5.4a-22
  - rebuild in new enviroment
  
  * Wed Feb 20 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.5.4a-21
  - More ISO C++ 98 fixes (#59670)
  
  * Tue Feb 19 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.5.4a-20
  - Fix ISO C++ 98 compliance (#59670)
  
  * Wed Jan 23 2002 Than Ngo <than@redhat.com> 2.5.4a-19
  - fixed #58643
  
  * Wed Jan 09 2002 Tim Powers <timp@redhat.com>
  - automated rebuild
  
  * Tue Nov  6 2001 Than Ngo <than@redhat.com> 2.5.4a-17
  - fixed for working with gcc 3 (bug #55778)
  
  * Sat Oct 13 2001 Than Ngo <than@redhat.com> 2.5.4a-16
  - fix wrong License (bug #54574)
  
  * Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
  - Bump release + rebuild.
  
  * Sat Sep 30 2000 Bernhard Rosenkraenzer <bero@redhat.com>
  - Fix generation of broken code (conflicting isatty() prototype w/ glibc 2.2)
    This broke, among other things, the kdelibs 2.0 build
  - Fix source URL
  
  * Thu Sep  7 2000 Jeff Johnson <jbj@redhat.com>
  - FHS packaging (64bit systems need to use libdir).
  
  * Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
  - automatic rebuild
  
  * Tue Jun  6 2000 Bill Nottingham <notting@redhat.com>
  - rebuild, FHS stuff.
  
  * Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
  - handle compressed man pages
  
  * Fri Jan 28 2000 Bill Nottingham <notting@redhat.com>
  - add a libl.a link to libfl.a
  
  * Wed Aug 25 1999 Jeff Johnson <jbj@redhat.com>
  - avoid uninitialized variable warning (Erez Zadok).
  
  * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
  - auto rebuild in the new build environment (release 6)
  
  * Fri Dec 18 1998 Bill Nottingham <notting@redhat.com>
  - build for 6.0 tree
  
  * Mon Aug 10 1998 Jeff Johnson <jbj@redhat.com>
  - build root
  
  * Mon Apr 27 1998 Prospector System <bugs@redhat.com>
  - translations modified for de, fr, tr
  
  * Thu Oct 23 1997 Donnie Barnes <djb@redhat.com>
  - updated from 2.5.4 to 2.5.4a
  
  * Mon Jun 02 1997 Erik Troan <ewt@redhat.com>
  - built against glibc
  
  * Thu Mar 20 1997 Michael Fulbright <msf@redhat.com>
  - Updated to v. 2.5.4

The changes against the oficial SPEC were:

  1. ) Added comments for the don't needed patches.
  2. ) Comment the test step.
  3. ) Upgrade the version and release.
  4. ) Don't remember more.

Build your flex package:

  # rpmbuild -ba ~/rpmbuild/SPECS/flex.spec

Update/install your flex binary package:

  # rpm -Uhv --force ~/rpmbuild/RPMS/i386/flex-2.5.35.i386.rpm (for update)
  # rpm -ihv --force ~/rpmbuild/RPMS/i386/flex-2.5.35.i386.rpm (for install)

Warning: some files are overwriten installing/updating flex, that is the "--force" parameter presence.

  # rpm -Uhv --force ~/rpmbuild/RPMS/i386/flex-2.5.35-1_ArcosCom.i386.rpm 
  Preparing...                ########################################### [100%]
     1:flex                   warning: /usr/share/info/dir saved as /usr/share/info/dir.rpmsave
  ########################################### [100%]

Upgrade/Install aMule-2.2.1

  1. Download aMule-2.2.1.tar.bz2 into your ~/rpmbuild/SOURCES directory.
  2. Use this SPEC file (create into your ~/rpmbuild/SPECS directory):
  Summary:        aMule - another eMule p2p client
  Name:           amule
  Version:        2.2.1
  Release:        1_ArcosCom
  License:        GPL
  Group:          Applications/Internet
  Packager:       The aMule Team (http://forum.amule.org/)
  Vendor:         The aMule Project
  URL:            http://www.amule.org/
  Source:         aMule-%{version}.tar.bz2
  BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-root
  #BuildRoot: 		/usr/src/redhat/BUILDROOT/%{name}-%{version}-%{release}-root
  BuildRequires:  wxGTK-devel >= 2.8.0
  BuildRequires:  gettext-devel, bison, GeoIP-devel
  BuildRequires:  libcrypto++-devel >= 5.1.0
  BuildRequires:  flex >= 2.5.33
  Requires: libcrypto++ >= 5.1.0
  
  %description
  aMule is a peer to peer file sharing client, based on the well known eMule.
  Starting with 2.0.0 aMule works on Linux, Mac, *BSD and Windows, which makes it
  the first multi-platform edonkey network client.
  
  %prep
  %setup -q -n aMule-2.2.1
  
  %build
  %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
  
  %{__make}
  
  %install
  [ ! "$RPM_BUILD_ROOT" = "/" ] && %{__rm} -rf $RPM_BUILD_ROOT _docs
  %{__make} install DESTDIR=$RPM_BUILD_ROOT
  
  %clean
  [ ! "$RPM_BUILD_ROOT" = "/" ] && %{__rm} -rf "$RPM_BUILD_ROOT"
  
  %files 
  %defattr(-,root,root)
  %doc %{_datadir}/doc/*
  %{_bindir}/*
  %{_libdir}/*
  %{_datadir}/*
  %{_datadir}/applications/*
  %{_datadir}/amule/*
  %{_datadir}/locale/*
  %{_datadir}/pixmaps/*
  %{_mandir}/*
  
  %changelog
  
  * Sat Jul 19 2008 Samuel Díaz García <samueldg@arcoscom.com> 2.2.1-1_ArcosCom
  - Rebuild for CentOS 5.2.
  
  * Tue Jun 13 2008 iz0bbz 1.1.2-1
  - Initial version

Thanks to iz0bbz for the initial version of this SPEC.

  1. Build your binary and source packages:
  # rpmbuild -ba ~/rpmbuild/SPECS/amule-2.2.1_ArcosCom.spec
  1. Install (or update) as root:
  # rpm -ihv /rpmbuild/RPMS/i386/amule-2.2.1_ArcosCom.i386.spec (for install)
  # rpm -Uhv /rpmbuild/RPMS/i386/amule-2.2.1_ArcosCom.i386.spec (for update)
  1. Enjoy!!

Notes

  1. You can download the packages from FC9 repository (or livna ones) and use them instead build the binaries from sources.
  2. rpmforge is for RHEL 5 as livna is for FC8/9.