# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Based on the ebuild by 'mascanho' @ forums.gentoo.org inherit eutils flag-o-matic wxwidgets MY_P=${P/m/M} 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="~x86 ~amd64" IUSE="amuled debug gtk2 nls optimize remote remote-gui stats unicode X" RESTRICT="nostrip nomirror" DEPEND=" gtk2? ( >=x11-libs/wxGTK-2.6.0 ) amuled? ( >=x11-libs/wxGTK-2.6.0 ) !gtk2? ( !amuled? ( >=x11-libs/wxGTK-2.6.0 ) ) >=sys-libs/zlib-1.2.1 stats? ( >=media-libs/gd-2.0.26 ) remote? ( >=media-libs/libpng-1.2.0 ) !net-p2p/xmule" pkg_setup() { export WX_GTK_VER="2.6" if ! use gtk2 >& /dev/null ; then need-wxwidgets gtk || die "gtk version of x11-libs/wxGTK not found" elif use unicode >& /dev/null ; then need-wxwidgets unicode || die "You need to emerge unicoded wxGTK with USE='gtk2 unicode'" else need-wxwidgets gtk2 || die "You need to emerge wxGTK with USE='gtk2'" fi if ! use X && use amuleremotegui; then die "You cannot set amuleremotegui while X is not set in your USE flags." fi } src_compile() { if ! use X; then MONOLITH="--disable-monolithic" fi if use amuled >& /dev/null ; then AMULED="--enable-amule-daemon --enable-amule-gui" fi if use optimize >& /dev/null ; then OPTIMIZE="--enable-optimize" fi if ! use debug >& /dev/null ; then DEBUG="--disable-debug" fi econf \ --with-wx-config=${WX_CONFIG} \ --with-wxbase-config=${WX_CONFIG} \ ${DEBUG} \ ${AMULED} \ ${MONOLITH} \ ${OPTIMIZE} \ `use_enable remote-gui amule-gui` \ `use_enable nls` \ `use_enable remote amulecmd` \ `use_enable remote webserver` \ `use_enable stats cas` \ `use_enable stats wxcas` \ `use_enable stats alc` \ `use_enable stats alcc` || die # we filter ssp until bug #74457 is closed to build on hardened if has_hardened; then filter-flags -fstack-protector -fstack-protector-all fi emake -j1 || die } src_install() { make DESTDIR=${D} install || die if use amuled || use remote; then if ! id p2p >/dev/null; then enewgroup p2p enewuser p2p -1 -1 /home/p2p p2p fi fi if use amuled; then insinto /etc/conf.d; newins ${FILESDIR}/amuled.confd amuled exeinto /etc/init.d; newexe ${FILESDIR}/amuled.initd amuled fi if use remote; then insinto /etc/conf.d; newins ${FILESDIR}/amuleweb.confd amuleweb exeinto /etc/init.d; newexe ${FILESDIR}/amuleweb.initd amuleweb fi }