Add patch to remove aMule’s download limits.
[overlay.git] / net-p2p / amule / amule-2.2.6.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-p2p/amule/amule-2.2.6.ebuild,v 1.1 2009/09/18 14:59:45 patrick Exp $
4
5 EAPI="2"
6
7 inherit eutils flag-o-matic wxwidgets
8
9 MY_P=${PN/m/M}-${PV}
10 S="${WORKDIR}"/${MY_P}
11
12 DESCRIPTION="aMule, the all-platform eMule p2p client"
13 HOMEPAGE="http://www.amule.org/"
14 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
19 IUSE="daemon debug geoip gtk nls remote stats unicode upnp"
20
21 DEPEND="=x11-libs/wxGTK-2.8*
22         =dev-libs/crypto++-5.5*
23         >=sys-libs/zlib-1.2.1
24         stats? ( >=media-libs/gd-2.0.26[jpeg] )
25         geoip? ( dev-libs/geoip )
26         upnp? ( >=net-libs/libupnp-1.6.6 )
27         remote? ( >=media-libs/libpng-1.2.0
28         unicode? ( >=media-libs/gd-2.0.26 ) )"
29
30 PATCHES=(
31         "${FILESDIR}/${PN}-2.2.6-remove-download-limit.patch"   
32         )
33
34 pkg_setup() {
35         if ! use gtk && ! use remote && ! use daemon; then
36                 eerror ""
37                 eerror "You have to specify at least one of gtk, remote or daemon"
38                 eerror "USE flag to build amule."
39                 eerror ""
40                 die "Invalid USE flag set"
41         fi
42
43         if use stats && ! use gtk; then
44                 einfo "Note: You would need both the gtk and stats USE flags"
45                 einfo "to compile aMule Statistics GUI."
46                 einfo "I will now compile console versions only."
47         fi
48 }
49
50 pkg_preinst() {
51         if use daemon || use remote; then
52                 enewgroup p2p
53                 enewuser p2p -1 -1 /home/p2p p2p
54         fi
55 }
56
57 src_configure() {
58         local myconf
59
60         WX_GTK_VER="2.8"
61
62         if use gtk; then
63                 einfo "wxGTK with gtk support will be used"
64                 need-wxwidgets unicode
65         else
66                 einfo "wxGTK without X support will be used"
67                 need-wxwidgets base
68         fi
69
70         if use gtk ; then
71                 use stats && myconf="${myconf}
72                         --enable-wxcas
73                         --enable-alc"
74                 use remote && myconf="${myconf}
75                         --enable-amule-gui"
76         else
77                 myconf="
78                         --disable-monolithic
79                         --disable-amule-gui
80                         --disable-wxcas
81                         --disable-alc"
82         fi
83
84         econf \
85                 --with-wx-config=${WX_CONFIG} \
86                 --with-wxbase-config=${WX_CONFIG} \
87                 --enable-amulecmd \
88                 $(use_enable debug) \
89                 $(use_enable !debug optimize) \
90                 $(use_enable daemon amule-daemon) \
91                 $(use_enable geoip) \
92                 $(use_enable nls) \
93                 $(use_enable remote webserver) \
94                 $(use_enable stats cas) \
95                 $(use_enable stats alcc) \
96                 ${myconf} || die
97 }
98
99 src_install() {
100         emake DESTDIR="${D}" install || die
101
102         if use daemon; then
103                 newconfd "${FILESDIR}"/amuled.confd amuled
104                 newinitd "${FILESDIR}"/amuled.initd amuled
105         fi
106         if use remote; then
107                 newconfd "${FILESDIR}"/amuleweb.confd amuleweb
108                 newinitd "${FILESDIR}"/amuleweb.initd amuleweb
109         fi
110 }