summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/amule')
-rw-r--r--net-p2p/amule/Manifest1
-rw-r--r--net-p2p/amule/amule-2.3.1.ebuild107
-rw-r--r--net-p2p/amule/files/amule-2.2.6-fallocate.diff23
-rw-r--r--net-p2p/amule/files/amule-2.3.1-gcc47.patch21
-rw-r--r--net-p2p/amule/files/amuled.confd13
-rw-r--r--net-p2p/amule/files/amuled.initd50
-rw-r--r--net-p2p/amule/files/amuleweb.confd28
-rw-r--r--net-p2p/amule/files/amuleweb.initd49
-rw-r--r--net-p2p/amule/metadata.xml13
9 files changed, 305 insertions, 0 deletions
diff --git a/net-p2p/amule/Manifest b/net-p2p/amule/Manifest
new file mode 100644
index 000000000000..5eee9c15ed52
--- /dev/null
+++ b/net-p2p/amule/Manifest
@@ -0,0 +1 @@
+DIST aMule-2.3.1.tar.bz2 4565232 SHA256 d2eda19c34ec574fa123efb95726c7cc241b093c95d074a5161ee7330dece69d
diff --git a/net-p2p/amule/amule-2.3.1.ebuild b/net-p2p/amule/amule-2.3.1.ebuild
new file mode 100644
index 000000000000..929c74d8eecc
--- /dev/null
+++ b/net-p2p/amule/amule-2.3.1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic wxwidgets user
+
+MY_P=${PN/m/M}-${PV}
+S="${WORKDIR}"/${MY_P}
+
+DESCRIPTION="aMule, the all-platform eMule p2p client"
+HOMEPAGE="http://www.amule.org/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc ppc64 ~sparc x86"
+IUSE="daemon debug geoip nls remote stats unicode upnp +X"
+
+DEPEND=">=dev-libs/crypto++-5
+ >=sys-libs/zlib-1.2.1
+ stats? ( >=media-libs/gd-2.0.26[jpeg] )
+ geoip? ( dev-libs/geoip )
+ upnp? ( >=net-libs/libupnp-1.6.6 )
+ remote? ( >=media-libs/libpng-1.2.0
+ unicode? ( >=media-libs/gd-2.0.26 ) )
+ X? ( >=x11-libs/wxGTK-2.8.12:2.8[X] )
+ !X? ( >=x11-libs/wxGTK-2.8.12:2.8 )
+ !net-p2p/imule"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ if use stats && ! use X; then
+ einfo "Note: You would need both the X and stats USE flags"
+ einfo "to compile aMule Statistics GUI."
+ einfo "I will now compile console versions only."
+ fi
+}
+
+pkg_preinst() {
+ if use daemon || use remote; then
+ enewgroup p2p
+ enewuser p2p -1 -1 /home/p2p p2p
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.2.6-fallocate.diff
+ # Bug 412371
+ epatch "${FILESDIR}"/${PN}-2.3.1-gcc47.patch
+}
+
+src_configure() {
+ local myconf
+
+ WX_GTK_VER="2.8"
+
+ if use X; then
+ einfo "wxGTK with X support will be used"
+ need-wxwidgets unicode
+ else
+ einfo "wxGTK without X support will be used"
+ need-wxwidgets base-unicode
+ fi
+
+ if use X ; then
+ use stats && myconf="${myconf}
+ --enable-wxcas
+ --enable-alc"
+ use remote && myconf="${myconf}
+ --enable-amule-gui"
+ else
+ myconf="
+ --disable-monolithic
+ --disable-amule-gui
+ --disable-wxcas
+ --disable-alc"
+ fi
+
+ econf \
+ --with-wx-config=${WX_CONFIG} \
+ --enable-amulecmd \
+ $(use_enable debug) \
+ $(use_enable !debug optimize) \
+ $(use_enable daemon amule-daemon) \
+ $(use_enable geoip) \
+ $(use_enable nls) \
+ $(use_enable remote webserver) \
+ $(use_enable stats cas) \
+ $(use_enable stats alcc) \
+ $(use_enable upnp) \
+ ${myconf} || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ if use daemon; then
+ newconfd "${FILESDIR}"/amuled.confd amuled
+ newinitd "${FILESDIR}"/amuled.initd amuled
+ fi
+ if use remote; then
+ newconfd "${FILESDIR}"/amuleweb.confd amuleweb
+ newinitd "${FILESDIR}"/amuleweb.initd amuleweb
+ fi
+}
diff --git a/net-p2p/amule/files/amule-2.2.6-fallocate.diff b/net-p2p/amule/files/amule-2.2.6-fallocate.diff
new file mode 100644
index 000000000000..8d1485a67786
--- /dev/null
+++ b/net-p2p/amule/files/amule-2.2.6-fallocate.diff
@@ -0,0 +1,23 @@
+Disable fallocate #562992
+
+This is only a workaround to fix FTBFS, the configure check is wrong and needs to be fixed:
+http://www.amule.org/abugs/view.php?id=1572
+
+--- a/src/ThreadTasks.cpp
++++ b/src/ThreadTasks.cpp
+@@ -506,6 +506,15 @@ void CCompletionTask::OnExit()
+ #include <stdlib.h>
+ #include <errno.h>
+
++// #562992
++#if defined(__alpha__) || defined(__hppa__)
++#undef HAVE_FALLOCATE
++#endif
++
++#if defined(__hppa__)
++#undef HAVE_SYS_FALLOCATE
++#endif
++
+ CAllocateFileTask::CAllocateFileTask(CPartFile *file, bool pause)
+ // GetPrintable is used to improve the readability of the log.
+ : CThreadTask(wxT("Allocating"), file->GetFullName().RemoveExt().GetPrintable(), ETP_High),
diff --git a/net-p2p/amule/files/amule-2.3.1-gcc47.patch b/net-p2p/amule/files/amule-2.3.1-gcc47.patch
new file mode 100644
index 000000000000..e776dda3240e
--- /dev/null
+++ b/net-p2p/amule/files/amule-2.3.1-gcc47.patch
@@ -0,0 +1,21 @@
+# http://code.google.com/p/amule/source/detail?r=10772
+diff -ur aMule-2.3.1.orig//src/ObservableQueue.h aMule-2.3.1/src/ObservableQueue.h
+--- aMule-2.3.1.orig//src/ObservableQueue.h 2012-04-22 19:40:05.560084120 +0200
++++ aMule-2.3.1/src/ObservableQueue.h 2012-04-22 19:40:32.479085322 +0200
+@@ -331,14 +331,14 @@
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverAdded( ObserverType* o )
+ {
+- NotifyObservers( EventType( EventType::STARTING ), o );
++ this->NotifyObservers( EventType( EventType::STARTING ), o );
+ }
+
+
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverRemoved( ObserverType* o )
+ {
+- NotifyObservers( EventType( EventType::STOPPING ), o );
++ this->NotifyObservers( EventType( EventType::STOPPING ), o );
+ }
+
+ \ No newline at end of file
diff --git a/net-p2p/amule/files/amuled.confd b/net-p2p/amule/files/amuled.confd
new file mode 100644
index 000000000000..c17b21e611e9
--- /dev/null
+++ b/net-p2p/amule/files/amuled.confd
@@ -0,0 +1,13 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# owner of amuled process (must be existing)
+AMULEUSER="p2p"
+
+# home directory for amuled (must be existing)
+AMULEHOME="/home/p2p"
+
+# log file (/dev/null for nowhere)
+LOG=/var/log/amuled.log
+
diff --git a/net-p2p/amule/files/amuled.initd b/net-p2p/amule/files/amuled.initd
new file mode 100644
index 000000000000..9b83458b380a
--- /dev/null
+++ b/net-p2p/amule/files/amuled.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
+ eerror "You must start and configure amuled before launch it. Sorry."
+ return 1
+ fi
+
+ if pgrep -u ${AMULEUSER} amuled >/dev/null; then
+ eerror "An instance of aMule webserver is already running"
+ return 1
+ fi
+ if [ -e /var/run/amuled.pid ]; then
+ rm /var/run/amuled.pid
+ fi
+
+ ebegin "Starting aMule Daemon"
+ env HOME="${AMULEHOME}" start-stop-daemon --start \
+ --quiet --background \
+ --make-pidfile --pidfile /var/run/amuled.pid \
+ -c ${AMULEUSER} \
+ -x /usr/bin/amuled >${LOG}
+
+ sleep 2
+ if ! pgrep -u ${AMULEUSER} amuled > /dev/null; then
+ eerror "aMule daemon can't be started! Check logfile: ${LOG}"
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping aMule daemon -- please wait"
+ start-stop-daemon --oknodo --stop --pidfile /var/run/amuled.pid &>/dev/null
+ eend $?
+}
+
+restart() {
+ svc_stop
+ while `pgrep -u ${AMULEUSER} amuled >/dev/null`; do
+ sleep 1
+ done
+ svc_start
+}
diff --git a/net-p2p/amule/files/amuleweb.confd b/net-p2p/amule/files/amuleweb.confd
new file mode 100644
index 000000000000..5453a4611bf3
--- /dev/null
+++ b/net-p2p/amule/files/amuleweb.confd
@@ -0,0 +1,28 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# owner of amuleweb process (must be existing)
+AMULEUSER="p2p"
+
+# home directory for amuleweb (from where to read configuration) (must be existing)
+AMULEHOME="/home/p2p"
+
+# log file (/dev/null for nowhere)
+LOG=/var/log/amuleweb.log
+
+# aMule password (note: not your webserver password, but the external
+# connection one)
+AMULEPWD="secret"
+
+# Full (admin) access password for webserver
+WEBPWD="secret2"
+
+# aMule host (this could be a remote host or usually localhost)
+AMULEHOST="localhost"
+
+# aMule external connection port
+AMULEPORT="4712"
+
+# aMuleweb template (default, php-default, chicane)
+TEMPLATE="default"
diff --git a/net-p2p/amule/files/amuleweb.initd b/net-p2p/amule/files/amuleweb.initd
new file mode 100644
index 000000000000..0484780093a2
--- /dev/null
+++ b/net-p2p/amule/files/amuleweb.initd
@@ -0,0 +1,49 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use amuled
+}
+
+start() {
+ if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
+ eerror "You must start and configure amuleweb before launch it. Sorry."
+ return 1
+ fi
+
+ if pgrep -u ${AMULEUSER} amuleweb >/dev/null; then
+ eerror "An instance of aMule webserver is already running"
+ return 1
+ fi
+
+ if [ -e /var/run/amuleweb.pid ]; then
+ rm /var/run/amuleweb.pid
+ fi
+
+ OPTIONS="-h ${AMULEHOST} -p ${AMULEPORT} -P ${AMULEPWD} -A ${WEBPWD} -t ${TEMPLATE} -q"
+
+ ebegin "Starting aMule WebServer"
+ env HOME="${AMULEHOME}" start-stop-daemon --start \
+ --quiet -b \
+ --make-pidfile --pidfile /var/run/amuleweb.pid \
+ -c ${AMULEUSER} \
+ -x /usr/bin/amuleweb -- ${OPTIONS} &>${LOG}
+
+ sleep 1
+ if ! pgrep -u ${AMULEUSER} amuleweb > /dev/null; then
+ eerror "aMule daemon can't be started! Check logfile: ${LOG}"
+ eend 1
+ return 1
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping aMule WebServer"
+ start-stop-daemon --oknodo --stop --pidfile /var/run/amuleweb.pid &>/dev/null
+ eend $?
+}
+
diff --git a/net-p2p/amule/metadata.xml b/net-p2p/amule/metadata.xml
new file mode 100644
index 000000000000..ffff80acce27
--- /dev/null
+++ b/net-p2p/amule/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name="daemon">Enable amule daemon</flag>
+ <flag name="remote">Enable remote controlling of the client</flag>
+ <flag name="stats">Enable statistic reporting</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">amule</remote-id>
+ </upstream>
+</pkgmetadata>