net-p2p/transmission: Fix m4 error when running aclocal
[gentoo.git] / net-p2p / amule / amule-2.3.1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="2"
6
7 inherit eutils flag-o-matic wxwidgets user
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 ppc ppc64 ~sparc x86"
19 IUSE="daemon debug geoip nls remote stats unicode upnp +X"
20
21 DEPEND=">=dev-libs/crypto++-5
22         >=sys-libs/zlib-1.2.1
23         stats? ( >=media-libs/gd-2.0.26[jpeg] )
24         geoip? ( dev-libs/geoip )
25         upnp? ( >=net-libs/libupnp-1.6.6 )
26         remote? ( >=media-libs/libpng-1.2.0
27         unicode? ( >=media-libs/gd-2.0.26 ) )
28         X? ( >=x11-libs/wxGTK-2.8.12:2.8[X] )
29         !X? ( >=x11-libs/wxGTK-2.8.12:2.8 )
30         !net-p2p/imule"
31 RDEPEND="${DEPEND}"
32
33 pkg_setup() {
34         if use stats && ! use X; then
35                 einfo "Note: You would need both the X and stats USE flags"
36                 einfo "to compile aMule Statistics GUI."
37                 einfo "I will now compile console versions only."
38         fi
39 }
40
41 pkg_preinst() {
42         if use daemon || use remote; then
43                 enewgroup p2p
44                 enewuser p2p -1 -1 /home/p2p p2p
45         fi
46 }
47
48 src_prepare() {
49         epatch "${FILESDIR}"/${PN}-2.2.6-fallocate.diff
50         # Bug 412371
51         epatch "${FILESDIR}"/${PN}-2.3.1-gcc47.patch
52 }
53
54 src_configure() {
55         local myconf
56
57         WX_GTK_VER="2.8"
58
59         if use X; then
60                 einfo "wxGTK with X support will be used"
61                 need-wxwidgets unicode
62         else
63                 einfo "wxGTK without X support will be used"
64                 need-wxwidgets base-unicode
65         fi
66
67         if use X ; then
68                 use stats && myconf="${myconf}
69                         --enable-wxcas
70                         --enable-alc"
71                 use remote && myconf="${myconf}
72                         --enable-amule-gui"
73         else
74                 myconf="
75                         --disable-monolithic
76                         --disable-amule-gui
77                         --disable-wxcas
78                         --disable-alc"
79         fi
80
81         econf \
82                 --with-wx-config=${WX_CONFIG} \
83                 --enable-amulecmd \
84                 $(use_enable debug) \
85                 $(use_enable !debug optimize) \
86                 $(use_enable daemon amule-daemon) \
87                 $(use_enable geoip) \
88                 $(use_enable nls) \
89                 $(use_enable remote webserver) \
90                 $(use_enable stats cas) \
91                 $(use_enable stats alcc) \
92                 $(use_enable upnp) \
93                 ${myconf} || die
94 }
95
96 src_install() {
97         emake DESTDIR="${D}" install || die
98
99         if use daemon; then
100                 newconfd "${FILESDIR}"/amuled.confd amuled
101                 newinitd "${FILESDIR}"/amuled.initd amuled
102         fi
103         if use remote; then
104                 newconfd "${FILESDIR}"/amuleweb.confd amuleweb
105                 newinitd "${FILESDIR}"/amuleweb.initd amuleweb
106         fi
107 }