Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/rtorrent/, net-p2p/rtorrent/files/
Date: Sat, 26 Feb 2022 20:09:08
Message-Id: 1645905696.17ba1a9e252fd2fc081ba4a0cd1d3c1aae726a5f.perfinion@gentoo
1 commit: 17ba1a9e252fd2fc081ba4a0cd1d3c1aae726a5f
2 Author: Jamie Getty <jamiegetty1 <AT> gmail <DOT> com>
3 AuthorDate: Tue Jan 4 06:59:50 2022 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 26 20:01:36 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17ba1a9e
7
8 net-p2p/rtorrent: Remove dependency on screen for daemonising.
9
10 Also update to EAPI8. econf now automatically passes --with-sysroot=
11 which sets the macos-only -syslibroot so needs to be --sysroot on linux.
12
13 Closes: https://github.com/gentoo/gentoo/pull/23645
14 Signed-off-by: Jamie Getty <jamiegetty1 <AT> gmail.com>
15 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
16
17 net-p2p/rtorrent/files/rtorrent-r1.init | 16 ++++++
18 net-p2p/rtorrent/files/rtorrentd_at-r1.service | 17 +++++++
19 net-p2p/rtorrent/rtorrent-0.9.8-r1.ebuild | 70 ++++++++++++++++++++++++++
20 3 files changed, 103 insertions(+)
21
22 diff --git a/net-p2p/rtorrent/files/rtorrent-r1.init b/net-p2p/rtorrent/files/rtorrent-r1.init
23 new file mode 100644
24 index 000000000000..e16f262bfbe3
25 --- /dev/null
26 +++ b/net-p2p/rtorrent/files/rtorrent-r1.init
27 @@ -0,0 +1,16 @@
28 +#!/sbin/openrc-run
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +description="rTorrent BitTorrent client"
32 +
33 +command="/usr/bin/rtorrent"
34 +command_args="-o system.daemon.set=true"
35 +command_background=true
36 +command_user="${USER}"
37 +pidfile="/run/rtorrent.pid"
38 +
39 +depend()
40 +{
41 + use net ypbind nis
42 + after slapd mysqld postgresql
43 +}
44
45 diff --git a/net-p2p/rtorrent/files/rtorrentd_at-r1.service b/net-p2p/rtorrent/files/rtorrentd_at-r1.service
46 new file mode 100644
47 index 000000000000..bc9220353786
48 --- /dev/null
49 +++ b/net-p2p/rtorrent/files/rtorrentd_at-r1.service
50 @@ -0,0 +1,17 @@
51 +# This configuration file is taken from the Arch wiki.
52 +# https://wiki.archlinux.org/title/RTorrent#Systemd_service_as_a_daemon_for_a_user
53 +
54 +[Unit]
55 +Description=rTorrent for %i
56 +After=network.target
57 +
58 +[Service]
59 +Type=simple
60 +User=%i
61 +Group=%i
62 +WorkingDirectory=/home/%i
63 +# Modify the next line to the absolute path for rtorrent.lock, for example
64 +ExecStartPre=-/bin/rm -f /home/%i/.session/rtorrent.lock
65 +ExecStart=/usr/bin/rtorrent -o system.daemon.set=true
66 +Restart=on-failure
67 +RestartSec=3
68
69 diff --git a/net-p2p/rtorrent/rtorrent-0.9.8-r1.ebuild b/net-p2p/rtorrent/rtorrent-0.9.8-r1.ebuild
70 new file mode 100644
71 index 000000000000..d0955a6839c0
72 --- /dev/null
73 +++ b/net-p2p/rtorrent/rtorrent-0.9.8-r1.ebuild
74 @@ -0,0 +1,70 @@
75 +# Copyright 1999-2022 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=8
79 +
80 +inherit autotools linux-info systemd
81 +
82 +DESCRIPTION="BitTorrent Client using libtorrent"
83 +HOMEPAGE="https://rakshasa.github.io/rtorrent/"
84 +SRC_URI="http://rtorrent.net/downloads/${P}.tar.gz"
85 +
86 +LICENSE="GPL-2"
87 +SLOT="0"
88 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris"
89 +IUSE="debug selinux test xmlrpc"
90 +RESTRICT="!test? ( test )"
91 +
92 +COMMON_DEPEND="~net-libs/libtorrent-0.13.${PV##*.}
93 + >=net-misc/curl-7.19.1
94 + sys-libs/ncurses:0=
95 + xmlrpc? ( dev-libs/xmlrpc-c:= )"
96 +RDEPEND="${COMMON_DEPEND}
97 + selinux? ( sec-policy/selinux-rtorrent )
98 +"
99 +DEPEND="${COMMON_DEPEND}
100 + dev-util/cppunit
101 + virtual/pkgconfig"
102 +
103 +DOCS=( doc/rtorrent.rc )
104 +
105 +pkg_setup() {
106 + if ! linux_config_exists || ! linux_chkconfig_present IPV6; then
107 + ewarn "rtorrent will not start without IPv6 support in your kernel"
108 + ewarn "without further configuration. Please set bind=0.0.0.0 or"
109 + ewarn "similar in your rtorrent.rc"
110 + ewarn "Upstream bug: https://github.com/rakshasa/rtorrent/issues/732"
111 + fi
112 +}
113 +
114 +src_prepare() {
115 + default
116 +
117 + # https://github.com/rakshasa/rtorrent/issues/332
118 + cp "${FILESDIR}"/rtorrent.1 "${S}"/doc/ || die
119 +
120 + if [[ ${CHOST} != *-darwin* ]]; then
121 + # syslibroot is only for macos, change to sysroot for others
122 + sed -i 's/Wl,-syslibroot,/Wl,--sysroot,/' "${S}/scripts/common.m4" || die
123 + fi
124 +
125 + eautoreconf
126 +}
127 +
128 +src_configure() {
129 + default
130 +
131 + # configure needs bash or script bombs out on some null shift, bug #291229
132 + CONFIG_SHELL=${BASH} econf \
133 + $(use_enable debug) \
134 + $(use_with xmlrpc xmlrpc-c)
135 +}
136 +
137 +src_install() {
138 + default
139 + doman doc/rtorrent.1
140 +
141 + newinitd "${FILESDIR}/rtorrent-r1.init" rtorrent
142 + newconfd "${FILESDIR}/rtorrentd.conf" rtorrent
143 + systemd_newunit "${FILESDIR}/rtorrentd_at-r1.service" "rtorrentd@.service"
144 +}