blob: 10d9117b3b0c40449df7d668c84e3411e51f1b63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# require 64-bit integer
LUA_COMPAT=( lua5-{1,3,4} luajit )
inherit autotools lua-single systemd toolchain-funcs
DESCRIPTION="BitTorrent Client using libtorrent"
HOMEPAGE="https://rtorrent.net"
if [[ ${PV} == *9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/rakshasa/${PN}.git"
else
SRC_URI="https://github.com/rakshasa/rtorrent/releases/download/v${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x64-solaris"
fi
LICENSE="GPL-2"
SLOT="0"
IUSE="debug lua selinux systemd test tinyxml2 xmlrpc"
RESTRICT="!test? ( test )"
REQUIRED_USE="
lua? ( ${LUA_REQUIRED_USE} )
tinyxml2? ( !xmlrpc )
"
COMMON_DEPEND="
~net-libs/libtorrent-${PV}
sys-libs/ncurses:0=
lua? ( ${LUA_DEPS} )
systemd? ( sys-apps/systemd:= )
xmlrpc? ( dev-libs/xmlrpc-c:=[libxml2] )
"
DEPEND="${COMMON_DEPEND}
dev-cpp/nlohmann_json
"
RDEPEND="${COMMON_DEPEND}
selinux? ( sec-policy/selinux-rtorrent )
"
BDEPEND="
virtual/pkgconfig
test? ( dev-util/cppunit )
"
PATCHES=(
"${FILESDIR}"/${PN}-0.16.9-cross_checks.patch
)
DOCS=( doc/rtorrent.rc )
pkg_setup() {
use lua && lua-single_pkg_setup
}
src_prepare() {
default
# use system-json
rm -r src/rpc/nlohmann || die
sed -e 's@"rpc/nlohmann/json.h"@<nlohmann/json.hpp>@' \
-i src/rpc/jsonrpc.cc || die
# https://github.com/rakshasa/rtorrent/issues/332
cp "${FILESDIR}"/rtorrent.1 "${S}"/doc/ || die
if [[ ${CHOST} != *-darwin* ]]; then
# syslibroot is only for macos, change to sysroot for others
sed -i 's/Wl,-syslibroot,/Wl,--sysroot,/' "${S}/scripts/common.m4" || die
fi
eautoreconf
}
src_configure() {
local myeconfargs=(
$(use_enable debug)
$(use_with lua)
$(use_with systemd)
$(usev xmlrpc --with-xmlrpc-c=$(tc-getPKG_CONFIG))
$(usev tinyxml2 --with-xmlrpc-tinyxml2)
)
use lua && myeconfargs+=(
LUA_INCLUDE="$(lua_get_CFLAGS)"
LUA_LIB="$(lua_get_LIBS)"
LUA_VERSION="${ELUA/lua/}"
)
econf "${myeconfargs[@]}"
}
src_install() {
default
doman doc/rtorrent.1
# lua file is installed then in the proper directory
rm "${ED}"/usr/share/rtorrent/lua/rtorrent.lua || die
if use lua; then
insinto $(lua_get_lmod_dir)
doins lua/${PN}.lua
fi
newinitd "${FILESDIR}/rtorrent-r1.init" rtorrent
newconfd "${FILESDIR}/rtorrentd.conf" rtorrent
systemd_newunit "${FILESDIR}/rtorrentd_at-r1.service" "rtorrentd@.service"
}
pkg_postinst() {
einfo "This release could introduce new commands to configure RTorrent."
einfo "Please read the release notes before restarting:"
einfo "https://github.com/rakshasa/rtorrent/releases"
einfo ""
einfo "For configuration assistance, see:"
einfo "https://github.com/rakshasa/rtorrent/wiki"
}
|