Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple ebuild question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
trex_dk
n00b
n00b


Joined: 29 Sep 2005
Posts: 29

PostPosted: Fri Nov 09, 2007 8:52 pm    Post subject: Simple ebuild question Reply with quote

Hi.

I've just stumpled upon rtorrent and has decided to use it instead of TorrentFlux.
Since rtorrent runs on my server without x, I need some kind of remote management.

Therefore I need to compile it with the option --with-xmlrpc-c to get the java interface n2hell working.

Is it possible to do this with an ebuild instead of ./configure --with-xmlrpc-c ?


Thx
Back to top
View user's profile Send private message
didumos
Guru
Guru


Joined: 19 Jan 2006
Posts: 322
Location: uk

PostPosted: Fri Nov 09, 2007 8:59 pm    Post subject: Reply with quote

The ebuild in Bug #182816 has been working fine for me, even when renaming it for rtorrent-0.7.9.

I've been using it with wTorrent, very cool 8)
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Fri Nov 09, 2007 9:03 pm    Post subject: Re: Simple ebuild question Reply with quote

trex_dk wrote:
Hi.

I've just stumpled upon rtorrent and has decided to use it instead of TorrentFlux.
Since rtorrent runs on my server without x, I need some kind of remote management.

Therefore I need to compile it with the option --with-xmlrpc-c to get the java interface n2hell working.

Is it possible to do this with an ebuild instead of ./configure --with-xmlrpc-c ?


Thx


Just copy the ebuild to an overlay and modify it to add the new use flag, something like this should do (modified from rtorrent-0.7.2.ebuild, not tested):

Code:

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/rtorrent/rtorrent-0.7.2.ebuild,v 1.7 2007/04/05 15:44:00 drizzt E$

inherit eutils toolchain-funcs flag-o-matic

DESCRIPTION="BitTorrent Client using libtorrent"
HOMEPAGE="http://libtorrent.rakshasa.no/"
SRC_URI="http://libtorrent.rakshasa.no/downloads/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 ~sparc x86 ~x86-fbsd"
IUSE="debug xmlrpc"

RDEPEND=">=net-libs/libtorrent-0.11.2
        >=dev-libs/libsigc++-2.0
        >=net-misc/curl-7.15
        sys-libs/ncurses"
DEPEND="${RDEPEND}"

src_compile() {
        replace-flags -Os -O2

        if [[ $(tc-arch) = "x86" ]]; then
                filter-flags -fomit-frame-pointer -fforce-addr
               
                # See bug #151221. It seems only to hit on GCC 4.1 and x86 architecture
                # it could be safer to fallback to -O1, but with the high use of STL in
                # rtorrent, that could make it too slow.
                [[ $(gcc-major-version)$(gcc-minor-version) == "41" ]] && replace-flags -O2 -O3
        fi
       
        econf \
                $(use_with xmlrpc xmlrpc-c) \
                $(use_enable debug) \
                --disable-dependency-tracking \
                || die "econf failed"

        emake || die "emake failed"
}

pkg_postinst() {
        elog "rtorrent now supports a configuration file."
        elog "A sample configuration file for rtorrent is can be found"
        elog "in ${ROOT}usr/share/doc/${PF}/rtorrent.rc.gz."
}

src_install() {
        emake DESTDIR="${D}" install || die "make install failed"
        dodoc AUTHORS README TODO doc/rtorrent.rc
}


It should work assuming that the --with-xmlrpc-c parameter given above is correct. You will then need to enable the use flag "xmlrcp" to activate the feature, check the output of emerge -pv to make sure and then the configure output while emerging to know if the flag is being recognised by the script.

Note that I did not add any dependency for that new use flag (and that will be necesary for sure). But if you know the deps, to add them on the RDEPEND or DEPEND variables will be trivial.
Back to top
View user's profile Send private message
trex_dk
n00b
n00b


Joined: 29 Sep 2005
Posts: 29

PostPosted: Fri Nov 09, 2007 9:12 pm    Post subject: Reply with quote

Thx for your quick reply!

Well, I have been thinking of trying wTorrent out, but I find it much like TorrentFlux (in the screenshots).
Is it possible to choose which files from the torrent you want to download? And can you change the ul/dl speed?

It looks like the ebuild for rtorrent with xmlrpc support is outdated. Can this be fixed in some way?

Best regards
Stefan.
Back to top
View user's profile Send private message
trex_dk
n00b
n00b


Joined: 29 Sep 2005
Posts: 29

PostPosted: Fri Nov 09, 2007 9:21 pm    Post subject: Reply with quote

i92guboj: Thx a lot for your suggestions. I'll take a look at it ASAP :)
Back to top
View user's profile Send private message
didumos
Guru
Guru


Joined: 19 Jan 2006
Posts: 322
Location: uk

PostPosted: Fri Nov 09, 2007 9:48 pm    Post subject: Reply with quote

trex_dk wrote:
Is it possible to choose which files from the torrent you want to download?

Yes, although I haven't tried this personally. You can see it in this screenshot: http://canbruixa.homelinux.net/wt/screens/list_files.jpg
trex_dk wrote:
And can you change the ul/dl speed?

Yes, but as far as I know you can only change the global ul/dl speed (I'm not sure if rtorrent supports per-torrent limits anyway?).
trex_dk wrote:
It looks like the ebuild for rtorrent with xmlrpc support is outdated. Can this be fixed in some way?

Yes, the actual ebuild doesn't need to be updated though, you just need to rename it and it should still work with the latest versions. So, for example, in my local portage overlay I have rtorrent-0.7.9-r1.ebuild which is just the ebuild attached to the bug report renamed.
Back to top
View user's profile Send private message
trex_dk
n00b
n00b


Joined: 29 Sep 2005
Posts: 29

PostPosted: Sun Nov 11, 2007 2:59 pm    Post subject: Reply with quote

Thx. That helped me alot :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum