--- /usr/portage/net-p2p/rtorrent/rtorrent-0.8.4-r1.ebuild 2009-02-15 18:36:24.000000000 +0300 +++ rtorrent-0.8.4-r2.ebuild 2009-02-23 01:24:43.000000000 +0300 @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/rtorrent/rtorrent-0.8.4-r1.ebuild,v 1.4 2009/02/15 15:08:02 ranger Exp $ +# $Header: $ inherit base eutils toolchain-funcs flag-o-matic @@ -11,7 +11,7 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 ~hppa ~ia64 ppc ppc64 ~sparc x86 ~x86-fbsd" -IUSE="daemon debug ipv6 xmlrpc" +IUSE="screen dtach debug ipv6 xmlrpc" COMMON_DEPEND=">=net-libs/libtorrent-0.12.${PV##*.} >=dev-libs/libsigc++-2.2.2 @@ -19,12 +19,21 @@ sys-libs/ncurses xmlrpc? ( dev-libs/xmlrpc-c )" RDEPEND="${COMMON_DEPEND} - daemon? ( app-misc/screen )" + screen? ( app-misc/screen ) + dtach? ( !screen? ( app-misc/dtach ) )" DEPEND="${COMMON_DEPEND} dev-util/pkgconfig" PATCHES=( "${FILESDIR}/${PN}-0.8.2-gcc34.patch" ) +pkg_setup() { + if use screen && use dtach; then + ewarn "You can't use app-misc/screen and app-misc/dtach" + ewarn "with rtorrent at the same time!" + ewarn "app-misc/screen will be used by default" + fi +} + src_compile() { replace-flags -Os -O2 append-flags -fno-strict-aliasing @@ -46,9 +55,14 @@ emake DESTDIR="${D}" install || die "make install failed" dodoc AUTHORS README TODO doc/rtorrent.rc - if use daemon; then - newinitd "${FILESDIR}/rtorrentd.init" rtorrentd || die "newinitd failed" - newconfd "${FILESDIR}/rtorrentd.conf" rtorrentd || die "newconfd failed" + if use screen; then + newinitd "${FILESDIR}/rtorrentd.init.screen" rtorrentd || die "newinitd failed" + newconfd "${FILESDIR}/rtorrentd.conf.screen" rtorrentd || die "newconfd failed" + elif use dtach; then + newinitd "${FILESDIR}/rtorrentd.init.dtach" rtorrentd || die "newinitd failed" + newconfd "${FILESDIR}/rtorrentd.conf.dtach" rtorrentd || die "newconfd failed" + exeinto /usr/bin + doexe "${FILESDIR}/rtorrent-attach" || die "doexe failed" fi } @@ -61,4 +75,18 @@ ewarn "session directory or run the fixSession080-c.py script from this address:" ewarn "http://rssdler.googlecode.com/files/fixSession080-c.py" ewarn "See http://libtorrent.rakshasa.no/wiki/LibTorrentKnownIssues for more info." + + if use screen || use dtach; then + enewgroup p2p + enewuser p2p -1 -1 /home/p2p p2p + + elog "" + elog "Now you must create .rtorrent.rc in /home/p2p" + elog "It is good idea to add session setting into them" + fi + if use dtach && ! use screen; then + elog "" + ewarn "Remember, to access daemonized rtorrent via rtorrent-attach you must be in p2p group" + fi + }