# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-p2p/amule/amule-2.0.0_rc7.ebuild,v 1.1 2004/10/20 03:06:13 squinky86 Exp $ inherit eutils wxwidgets MY_P=${P/m/M} MY_P=${MY_P/_/} S=${WORKDIR}/${MY_P} DESCRIPTION="aMule, the all-platform eMule p2p client" HOMEPAGE="http://www.amule.org/" SRC_URI="http://download.berlios.de/${PN}/${MY_P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug gtk gtk2 nls remote stats unicode gd daemon xchat" RDEPEND="=x11-libs/wxGTK-2.5* >=net-misc/curl-7.11.0 >=sys-libs/zlib-1.2.1 stats? ( >=media-libs/gd-2.0.26 ) gd? ( >=media-libs/gd-2.0.26 ) !net-p2p/xmule xchat? ( net-irc/xchat )" DEPEND="${RDEPEND} sys-devel/autoconf =sys-devel/automake-1.7*" pkg_setup() { WX_GTK_VER="2.5" if use gtk && ! use gtk2; then if use unicode; then die "You can't use unicode with GTK1" fi need-wxwidgets gtk || die "You need to install wxGTK with gtk support." elif use gtk && use gtk2; then if use unicode; then need-wxwidgets unicode || die "You need to install wxGTK with gtk2 and unicode support." else need-wxwidgets gtk2 || die "You need to install exGTK with gtk2 support." fi elif use gtk2 && ! use gtk; then die "gtk2 flag can be used only to use gtk2 if gtk support is already set." else if use unicode; then need-wxwidgets base-unicode || die "You need to install wxGTK with unicode support" else need-wxwidgets base || die "You need to install wxGTK" fi fi } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/amule-webserver-notty.patch ./autogen.sh } src_compile() { # Enable guis only if building with gtk or gtk2 support if use gtk || use gtk2; then myconf="${myconf} $(use_enable remote webservergui) $(use_enable remote amulecmdgui) $(use_enable stats wxcas) $(use_enable stats alc)" else myconf="${myconf} --disable-webservergui --disable-amulecmdgui --disable-wxcas --disable-alc --disable-monolithic" fi econf \ --enable-optimise \ --with-wx-config=${WX_CONFIG} \ --with-wxbase-config=${WX_CONFIG} \ $(use_enable daemon amule-daemon) \ $(use_enable nls) \ $(use_enable remote amulecmd) $(use_enable remote webserver) \ $(use_enable stats cas) $(use_enable stats alcc) \ $(use_enable debug) \ ${myconf} || die emake -j1 || die } pkg_preinst() { enewuser p2p -1 /bin/bash /home/p2p users } src_install() { make DESTDIR=${D} install || die if use remote; then newinitd ${FILESDIR}/amuleweb.initd amuleweb newconfd ${FILESDIR}/amuleweb.confd amuleweb fi if use daemon; then newinitd ${FILESDIR}/amuled.initd amuled newconfd ${FILESDIR}/amuled.confd amuled fi # Remove things which are installed also if not requested # or even disabled. if ! use xchat; then rm -rf ${D}/usr/lib/xchat fi if ! use gtk; then rm -rf ${D}/usr/share/pixmaps rm -rf ${D}/usr/share/applications fi } pkg_postinst() { einfo "To run amuled and amuleweb as system services, if you have built" einfo "them, you can use /etc/init.d/amuled and amuleweb. To configure" einfo "their parameters, such as the user as which they run on and the" einfo "home directory they use. Please note that for now you must create" einfo "and configure the parameters of both daemon and webserver manually" einfo "You'll find aMule.tmpl and webserver data in the directory:" einfo "/usr/share/amuleweb/, use them as aMule doc say." }