HowTo Compile In Gentoo

From AMule Project FAQ
Revision as of 17:04, 24 October 2006 by 85.178.151.234 (Talk)

Jump to: navigation, search
English | Español

English version updated: 24.10.2006 - Newest Gentoo Version is now 2.1.2

Introduction

Gentoo is known for choices. Unfortunately, some choices require more labor than others. As such, aMule comes in a variety of versions and installation methods based on what version of wxGTK you decide to use...

Also, if you plan to build a GUI-less core, you might want to take a look at http://bugs.gentoo.org/show_bug.cgi?id=109515, comment #3 contains a patch for wxGTK ebuild that removes the dependency on X.

Methods of Installation

amule-2.1.2.ebuild

This ebuild matches the most current, stable aMule release available 24.10.06.

Dependencies: >=x11-libs/wxGTK-2.6.0; >=sys-libs/zlib-1.2.2; sys-devel/gettext; >=media-libs/libpng-1.2.8; >=media-libs/gd-2.0.32

amule-cvs

This ebuild is marked as unstable for all architectures.

Not intended for the general public. If you'd like to test out the daily development snapshot, then this is the version for you.

Dependencies: >=x11-libs/wxGTK-2.6.0; >=sys-libs/zlib-1.2.1; >=media-libs/gd-2.0.26; >=media-libs/libpng-1.2.0
Status: In development; not in Portage; requires portage overlay

Installation instructions

amule-2.1.2.ebuild

1. Emerge package:

 emerge --sync
 emerge amule -pv
 emerge amule

amule-cvs

The current ebuilds for aMule CVS can be found here. Download it and continue with this wiki article.

1. Define PORTDIR_OVERLAY. Open up /etc/make.conf with your favourite text editor and define the PORTDIR_OVERLAY variable. The default is:

 PORTDIR_OVERLAY="/usr/local/portage"

2. Create overlay for amule-cvs:

 mkdir -p {PORTDIR_OVERLAY}/net-p2p/amule-cvs/files

3. Add to package.keywords:

 echo "net-p2p/amule-cvs ~x86" >> /etc/portage/package.keywords

4. Copy amule-cvs-3.ebuild from this forum post to {PORTDIR_OVERLAY}/net-p2p/amule-cvs

5. Copy amuled and amuleweb init script from official ebuild files:

 cp {PORTDIR}/net-p2p/amule/files/amuled.* {PORTDIR_OVERLAY}/net-p2p/amule-cvs/files/
 cp {PORTDIR}/net-p2p/amule/files/amuleweb.* {PORTDIR_OVERLAY}/net-p2p/amule-cvs/files/

PORTDIR is the official portage directory (usually /usr/portage/)

6. Change directory:

 cd {PORTDIR_OVERLAY}/net-p2p/amule-cvs/

7. Digest ebuild:

 ebuild amule-cvs-3.ebuild digest

8. Review installation flags:

 emerge amule-cvs -pv

9. Modify /etc/portage/package.use to suit your needs (please note that debug is enabled regardless of USE flag):

 net-p2p/amule-cvs X -amuled -debug gtk2 kad nls -nosystray -optimize -remote -remote-gui -stats unicode

This would install amule without deamon and remote support. To activate deamons and remote options, leave out the '-' like this:

 net-p2p/amule-cvs X amuled -debug gtk2 kad nls -nosystray -optimize remote remote-gui -stats unicode

10. Install aMule CVS:

 emerge amule-cvs

PLEASE PLEASE PLEASE do emerge amule-cvs -pv before installing to determine how you want to compile aMule.

11. Finally, as this is a CVS version, it's to be run with special care, so you need to modify the init.script with the correct option. Currently this is --i-would-marry-my-mule as seen in this output of a trial run (run amuled on command line):

 amuled: OnInit - starting timer
 This binary requires you to use the flag --i-would-marry-my-mule and only if you're very sure of it. Warning: not legal on most countries.

So, edit the init.d script:

 vi /etc/init.d/amuled

and change line 28 to

 -x /usr/bin/amuled -- --i-would-marry-my-mule >${LOG} 2>&1

12. make sure that all lockfiles of previous runs are removed:

 rm /var/run/amule*.pid ~/.aMule/muleLock

13. Finally start the deamon.

 /etc/init.d/amuled start

Use amulecmd or webinterface (start amuleweb) to control.

Note that /var/log/amuled does NOT contain any log entries from amuled itself, as it is forked into the background right of the start and this file only may contain any errors the start-stop-deamon encounters before that.

To view the log, use:

 less ~.aMule/logfile

aMule 2.1.1 Compilation FAQ

When compiling aMule-2.1.1 on a hardened system with gcc-3.4.5(at least), it will fail with something like:

WebServer.h: In member function `T* UpdatableItemsContainer<T, G, I>::GetByID(I) [with T = SharedFile, G = CEC_SharedFile_Tag, I = CMD4Hash]':
WebServer.h:270: internal compiler error: in sweep_string_variable, at protector.c:1158

The possible problem is the -fPIE CFLAG because using `gcc-config` to select i386-pc-linux-gnu-3.4.5-hardenednopiessp fixed the problem, and you can even remove from the ebuild:

if has_hardened; then
    filter-flags -fstack-protector -fstack-protector-all
fi

You can read more on the subject following the link http://bugs.gentoo.org/show_bug.cgi?id=74457