Difference between revisions of "Install-amule-freebsd"

From AMule Project FAQ
Jump to: navigation, search
m (more links stuff)
 
(54 intermediate revisions by 18 users not shown)
Line 1: Line 1:
This page is likely to be updated soon, but it might help you even right now.
+
<center>
 +
[[Install-amule-freebsd|English]] |
 +
[[Install-amule-freebsd-ru|Русский]] |
 +
[[Install-amule-freebsd-es|Espa&ntilde;ol]] |
 +
[[Install-amule-freebsd-it|Italiano]]
 +
</center>
  
 +
== Install aMule 2.2.4 on [http://www.freebsd.org FreeBSD] 6.X, 7.X ==
 +
Check that your /usr/ports is up-to-date, for example using portsnap:
 +
          portsnap fetch update
  
==  Install [[aMule]] 2.0.0rc3 on [http://www.freebsd.org FreeBSD] 5.x  ==
+
(you may need portsnap extract or portsnap fetch extract if not done before, you should be told at the end if this is necessary)
  
 +
Then, as the ports tree has been updated to 2.2.4, you should be able to just
  
Why would you ask... we have ''/usr/ports/net/amule''
+
Install aMule
  
Well, this is the stable version 1.2.6
+
            cd /usr/ports/net/amule2
 +
            make config
 +
            make install clean
  
We wanna stay current or help testing / debugging, why else would you read this?
 
  
==  Install ports we need if you don't allready have (see ''pkg_info'')  ==
+
That should download and make all necessary dependencies etc.
  
 +
But if that doesn't work you can try (should also be useful for a newer version of aMule then 2.2.4 and the cvs):
  
''security/cryptopp''
 
  
and
 
  
''x11-toolkits/wxgtk''
+
Upgrade the FreeBSD 6.X (not needed on FreeBSD 7.X) flex release (2.5.4) with the new one (2.5.35):
  
and (but you will have this already ;-))
+
            cd  /usr/ports/textproc/flex
 +
            make install clean
  
''devel/gettext''
+
This installation didn't override the old /usr/bin/, but put a new release on /usr/local/bin/.
  
and (but you will also have this already ;-))
+
Then we need to rename the old flex release:
  
''devel/gmake''
+
            mv /usr/bin/flex /usr/bin/flex.old
  
You know how to install ports as a [http://www.bsd.org BSD] user, so I don't have to tell you, I hope. It's just too easy you know. In case you're very new to [http://www.freebsd.org FreeBSD], consult the great [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook handbook] at [http://www.freebsd.org http://www.freebsd.org].
+
And check your version with this command:
  
'''NOTE:''' If you think you have [[wxWidgets|wxGTK]] installed because you see [[wxWidgets|wxGTK2]], you should know, [[wxWidgets|wxGTK]] is linked against [http://www.gtk.org GTK1] and [[wxWidgets|wxGTK2]] is linked against [http://www.gtk.org GTK2]. Using [[wxWidgets|wxGTK2]] with [[aMule]] will become [[aMule]] unstable! You have to use [[wxWidgets|wxGTK]], not [[wxWidgets|wxGTK2]].
+
            flex --version
  
==  Configure  ==
+
You should obtain: 2.5.35 (or newer)
  
 +
Install wxgtk28:
  
The ''./configure'' does not work 100% automagically, we must help it out a bit.
+
            cd /usr/ports/x11-toolkits/wxgtk28-unicode/
 +
            make install clean
  
I used the following line of ''configure'', which may differ for you a bit due to different OS or library versions you have installed.
+
Install cryptopp:
  
Right now this line works for [http://www.freebsd.org FreeBSD] 5.2-CURRENT 03-May-2004 for example but version numbers may be different for [http://www.freebsd.org FreeBSD] 5.2.1 or the upcomming 5.3.
+
            cd /usr/ports/security/cryptopp
 +
            make install clean
  
Edit the '''<your home>''' tag, of course, or install it elsewhere.
+
Install GD:
  
''./configure --prefix=/home/'''<your home>'''/amule --with-wx-config=/usr/X11R6/bin/wxgtk-2.4-config --with-wxbase-config=/usr/X11R6/bin/wxgtk-2.4-config''
+
            cd /usr/ports/graphics/gd
 +
            make install clean
  
'''NOTE:''' This is one single line, not 3 lines or whatever [http://wiki.org/wiki.cgi?WhatIsWiki wiki]/HTML/your browser wraps this line into.
+
Install GeoIP:
  
You will see configure doesn't find ''gdlib-config'', even if you installed ''gdlib''. Don't care, it's just not there and it's no "must have". Just skip it.
+
            cd /usr/ports/net/GeoIP/
 +
            make install clean
  
'''NOTE:''' If you get the following warning:
+
Download the aMule 2.2.4 source code
 +
[http://www.amule.org/files/files.php?cat=42 here].
  
''WARNING!! Your wxWidgets copy has been linked against GTK2 and this will make aMule be unstable, use so much cpu and ram. You have been advised, don't report bugs so.''
+
            tar -zxvf aMule-2.2.4.tar.bz2
 +
            cd aMule-2.2.2/
  
at the end of ''configure'' you are probably linking against [[wxWidgets|wxGTK2]] instead of [[wxWidgets|wxGTK]]. [[aMule]] will memleak and eat your CPU. It will probably crash as well. Use [[wxWidgets|wxGTK]] as mentioned above!
+
You need to edit the file src/Scanner.l and after the line:
 +
            #include <wx/string.h>
 +
Add the line:
 +
            #include "Scanner.h.in"
  
== Patch 1  ==
+
Configure some environement variable, for bash user:
 +
            export CPPFLAGS="-I/usr/local/include"
 +
            export LDFLAGS="-L/usr/local/lib"
 +
Or for csh user (default under FreeBSD):
 +
            setenv CPPFLAGS "-I/usr/local/include"
 +
            setenv LDFLAGS "-L/usr/local/lib"
 +
Then start the compilation:
 +
           
 +
            ./configure --prefix=/home/'''user'''/aMule-2.2.4/ \
 +
            --with-wx-config=/usr/local/bin/wxgtk2u-2.8-config --with-crypto-prefix=/usr/local/ \
 +
            --disable-debug --with-curl-config=/usr/local/bin/curl-config --enable-webserver  \
 +
            --enable-optimize --with-included-gettext --enable-amule-daemon --enable-amulecmd \
 +
            --enable-cas --enable-alcc --enable-geoip
  
The problem would be:
+
'''NOTE:''' Check [[configure]]. Also, change '''user''' for your user name.
  
''<pre>[...]
+
            gmake
/usr/bin/ld: cannot find -lcryptopp
+
            gmake install
gmake[2]: *** [cas] Error 1
+
gmake[2]: Leaving directory `/home/eugene/aMule-2.0.0rc3/src'
+
gmake[1]: *** [all-recursive] Error 1
+
gmake[1]: Leaving directory `/home/eugene/aMule-2.0.0rc3'
+
gmake: *** [all] Error 2</pre>''
+
  
So we patch it now:
+
And start it:
 +
          ./amule-2.2.4/bin/amule &
  
''edit src/Makefile''
 
  
Search for the line containing
+
== Configuration info ==
  
''cryptopp''
+
After successfully installing:
  
This line will read as:
+
The program directory can be found: (~./aMule/). Means as root:
  
''LIBS =  -lcryptopp''
+
/root/.aMule/
  
Add ''-L/usr/local/lib'' to that line
+
any other user:
  
Now the line will read as:
+
/usr/home/<username>/.aMule/
  
''LIBS =  -L/usr/local/lib -lcryptopp''
+
amule.conf can be found directly in the program folder. The webserver config file has to be made:
  
==  Patch 2  ==
+
# amuleweb -w.
  
 
+
and is called remote.conf
The problem would be:
+
 
+
''<pre>[...]
+
amule.cpp:39:30: execinfo.h: No such file or directory
+
amule.cpp:40:28: mntent.h: No such file or directory
+
In file included from /usr/local/include/cryptopp/pkcspad.h:4,
+
from /usr/local/include/cryptopp/rsa.h:9,
+
from ClientCredits.h:32,
+
from amule.cpp:86:
+
/usr/local/include/cryptopp/cryptlib.h:1358:9: warning: "/*" within comment
+
amule.cpp: In member function `virtual bool CamuleApp: nInit()':
+
amule.cpp:423: error: `setmntent' undeclared (first use this function)
+
amule.cpp:423: error: (Each undeclared identifier is reported only once for
+
each function it appears in.)
+
amule.cpp:429: error: `getmntent' undeclared (first use this function)
+
amule.cpp:431: error: invalid use of undefined type `struct mntent'
+
amule.cpp:427: error: forward declaration of `struct mntent'
+
amule.cpp:432: error: invalid use of undefined type `struct mntent'
+
amule.cpp:427: error: forward declaration of `struct mntent'
+
amule.cpp:437: error: invalid use of undefined type `struct mntent'
+
amule.cpp:427: error: forward declaration of `struct mntent'
+
amule.cpp: In member function `virtual void CamuleApp: nFatalException()':
+
amule.cpp:982: error: `backtrace' undeclared (first use this function)
+
amule.cpp:987: error: `backtrace_symbols' undeclared (first use this function)
+
gmake[2]: *** [amule-amule.o] Error 1
+
gmake[2]: Leaving directory `/home/eugene/aMule-2.0.0rc3/src'
+
gmake[1]: *** [all-recursive] Error 1
+
gmake[1]: Leaving directory `/home/eugene/aMule-2.0.0rc3'
+
gmake: *** [all] Error 2</pre>''
+
 
+
So we patch it now:
+
 
+
As there is no official [http://www.freebsd.org FreeBSD] support in [[aMule]] yet we will patch it to work... Well there is [http://www.openbsd.org OpenBSD] support and this support will work for us too :-)
+
 
+
Edit ''src/amule.cpp''
+
 
+
and insert
+
 
+
''#define __OPENBSD__''
+
 
+
at the top of this file. I placed it right before the first ''#include'' line...
+
 
+
"What a workaround!" you may scream. Hey, we don't fiddle too much around with the code, just hack it to work and get ready to share ;-)
+
 
+
==  Make  ==
+
 
+
 
+
''make'' will fail, use ''gmake''
+
 
+
''make'' is [http://www.bsd.org BSD] [http://www.gnu.org/software/make make], ''gmake'' is [http://www.gnu.org GNU] [http://www.gnu.org/software/make make]. They are '''not''' compatible.
+
 
+
Now do:
+
 
+
''gmake''
+
 
+
Get yourself a hot green tea (I prefer some sort of sencha) while it is compiling.
+
 
+
Then do:
+
 
+
''gmake install''
+
 
+
==  Use it  ==
+
 
+
 
+
Just start it with ''/home/<your home>/amule/bin/amule''
+
or wherever you installed it to...
+
 
+
Have phun
+
 
+
Eugene
+
 
+
==  Update - Using the port  ==
+
 
+
I've just released the 2.0.0rc3 port.
+
See http://www.amule.org/amule/download.php (and http://contribs.martymac.com) to download it.
+
 
+
Since the port is not (yet) officially available, you'll have to uncompress it (''tar xvzf file.tgz'') into the ''/usr/ports/net'' directory and then do a standard ''make install''.
+
 
+
Any feedback welcome, many thanks to Eugene for this great wiki :)
+
 
+
Ganael Laplanche.
+
 
+
==  2.0.0rc4a ports  ==
+
 
+
Hi all, new update to this wiki: 2.0.0rc4a ports are available. No, you ain't dreaming, you've just seen an 's' appended, because there are two ports.
+
 
+
Unfortunately, [http://www.freebsd.org FreeBSD] 4.x (and [http://gcc.gnu.org GCC] 2.95) doesn't provide some required libs (see the patches inside the archive) to build this brand-new [[aMule]] version, so I released two ports :
+
 
+
*One for the 4.x branch, wich won't compile under 5.x:
+
Includes many patches, sometimes tricky, to make it work. This could lead to unstability and require further testing. Any feedback welcome :)
+
 
+
*Another one for the 5.x branch, wich won't compile under 4.x:
+
This one doesn't include any patch.
+
 
+
To download the ports: http://www.amule.org/amule/download.php or http://contribs.martymac.com
+
 
+
Enjoy!
+
 
+
Ganael LAPLANCHE
+
 
+
http://contribs.martymac.com
+
 
+
[mailto://ganael.laplanche@martymac.com ganael.laplanche@martymac.com]
+

Latest revision as of 17:13, 8 February 2010

English | Русский | Español | Italiano

Install aMule 2.2.4 on FreeBSD 6.X, 7.X

Check that your /usr/ports is up-to-date, for example using portsnap:

          portsnap fetch update

(you may need portsnap extract or portsnap fetch extract if not done before, you should be told at the end if this is necessary)

Then, as the ports tree has been updated to 2.2.4, you should be able to just

Install aMule

           cd /usr/ports/net/amule2
           make config
           make install clean


That should download and make all necessary dependencies etc.

But if that doesn't work you can try (should also be useful for a newer version of aMule then 2.2.4 and the cvs):


Upgrade the FreeBSD 6.X (not needed on FreeBSD 7.X) flex release (2.5.4) with the new one (2.5.35):

           cd  /usr/ports/textproc/flex
           make install clean

This installation didn't override the old /usr/bin/, but put a new release on /usr/local/bin/.

Then we need to rename the old flex release:

           mv /usr/bin/flex /usr/bin/flex.old

And check your version with this command:

           flex --version

You should obtain: 2.5.35 (or newer)

Install wxgtk28:

           cd /usr/ports/x11-toolkits/wxgtk28-unicode/
           make install clean

Install cryptopp:

           cd /usr/ports/security/cryptopp
           make install clean

Install GD:

           cd /usr/ports/graphics/gd
           make install clean

Install GeoIP:

           cd /usr/ports/net/GeoIP/
           make install clean

Download the aMule 2.2.4 source code here.

           tar -zxvf aMule-2.2.4.tar.bz2
           cd aMule-2.2.2/

You need to edit the file src/Scanner.l and after the line:

           #include <wx/string.h>

Add the line:

           #include "Scanner.h.in"

Configure some environement variable, for bash user:

           export CPPFLAGS="-I/usr/local/include"
           export LDFLAGS="-L/usr/local/lib"

Or for csh user (default under FreeBSD):

           setenv CPPFLAGS "-I/usr/local/include"
           setenv LDFLAGS "-L/usr/local/lib"

Then start the compilation:

           ./configure --prefix=/home/user/aMule-2.2.4/ \
           --with-wx-config=/usr/local/bin/wxgtk2u-2.8-config --with-crypto-prefix=/usr/local/ \
           --disable-debug --with-curl-config=/usr/local/bin/curl-config --enable-webserver  \
           --enable-optimize --with-included-gettext --enable-amule-daemon --enable-amulecmd \
           --enable-cas --enable-alcc --enable-geoip

NOTE: Check configure. Also, change user for your user name.

           gmake
           gmake install

And start it:

          ./amule-2.2.4/bin/amule &


Configuration info

After successfully installing:

The program directory can be found: (~./aMule/). Means as root:

/root/.aMule/

any other user:

/usr/home/<username>/.aMule/

amule.conf can be found directly in the program folder. The webserver config file has to be made:

  1. amuleweb -w.

and is called remote.conf