net-p2p/resilio-sync: live-template ebuild

Now that `-9999` uses live-downloading, it's worth refactoring it as a
live template to base future versions off of; replaces `3.1.1.1075` with
this template.

Signed-off-by: Itai Ferber <itai@itaiferber.net>
Part-of: https://github.com/gentoo/gentoo/pull/44075
Closes: https://github.com/gentoo/gentoo/pull/44075
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Itai Ferber
2025-10-06 16:49:22 -04:00
committed by Sam James
parent 8107c14466
commit 99ee5d2fbd
2 changed files with 61 additions and 22 deletions

View File

@@ -3,21 +3,26 @@
EAPI=8
inherit pax-utils readme.gentoo-r1 systemd tmpfiles
BASE_URI="https://download-cdn.resilio.com/${PV}/linux/@arch@/0/${PN}_@arch@.tar.gz -> ${P}_@arch@.tar.gz"
inherit edo pax-utils readme.gentoo-r1 systemd tmpfiles
DESCRIPTION="Resilient, fast and scalable file synchronization tool"
HOMEPAGE="https://www.resilio.com"
SRC_URI="
amd64? ( ${BASE_URI//@arch@/x64} )
arm64? ( ${BASE_URI//@arch@/arm64} )
"
if [[ ${PV} == 9999 ]]; then
BDEPEND="net-misc/wget"
PROPERTIES="live"
else
BASE_URI="https://download-cdn.resilio.com/${PV}/linux/@arch@/0/${PN}_@arch@.tar.gz -> ${P}_@arch@.tar.gz"
SRC_URI="
amd64? ( ${BASE_URI//@arch@/x64} )
arm64? ( ${BASE_URI//@arch@/arm64} )
"
KEYWORDS="-* ~amd64 ~arm64"
fi
S="${WORKDIR}"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
RESTRICT="bindist mirror"
@@ -33,6 +38,26 @@ DOC_CONTENTS="You may need to review /etc/resilio-sync/config.json\\n
Default metadata path is /var/lib/resilio-sync/.sync\\n
Default web-gui URL is http://localhost:8888/\\n\\n"
src_unpack() {
if [[ ${PV} == 9999 ]]; then
local base_uri="https://download-cdn.resilio.com/stable/linux/@arch@/0/${PN}_@arch@.tar.gz"
local uri
if use amd64; then
uri="${base_uri//@arch@/x64}"
elif use arm64; then
uri="${base_uri//@arch@/arm64}"
else
die "arch not supported"
fi
local dest="${T}/${PN}.tar.gz"
edo wget -O "${dest}" "${uri}"
unpack "${dest}"
else
default
fi
}
src_install() {
dobin rslsync
pax-mark m "${ED}"/usr/bin/rslsync

View File

@@ -8,11 +8,22 @@ inherit edo pax-utils readme.gentoo-r1 systemd tmpfiles
DESCRIPTION="Resilient, fast and scalable file synchronization tool"
HOMEPAGE="https://www.resilio.com"
if [[ ${PV} == 9999 ]]; then
BDEPEND="net-misc/wget"
PROPERTIES="live"
else
BASE_URI="https://download-cdn.resilio.com/${PV}/linux/@arch@/0/${PN}_@arch@.tar.gz -> ${P}_@arch@.tar.gz"
SRC_URI="
amd64? ( ${BASE_URI//@arch@/x64} )
arm64? ( ${BASE_URI//@arch@/arm64} )
"
KEYWORDS="-* ~amd64 ~arm64"
fi
S="${WORKDIR}"
LICENSE="all-rights-reserved"
SLOT="0"
PROPERTIES="live"
RESTRICT="bindist mirror"
RDEPEND="
@@ -20,7 +31,6 @@ RDEPEND="
acct-user/rslsync
virtual/libcrypt:=
"
BDEPEND="net-misc/wget"
QA_PREBUILT="usr/bin/rslsync"
@@ -29,19 +39,23 @@ Default metadata path is /var/lib/resilio-sync/.sync\\n
Default web-gui URL is http://localhost:8888/\\n\\n"
src_unpack() {
local base_uri="https://download-cdn.resilio.com/stable/linux/@arch@/0/${PN}_@arch@.tar.gz"
local uri
if use amd64; then
uri="${base_uri//@arch@/x64}"
elif use arm64; then
uri="${base_uri//@arch@/arm64}"
else
die "arch not supported"
fi
if [[ ${PV} == 9999 ]]; then
local base_uri="https://download-cdn.resilio.com/stable/linux/@arch@/0/${PN}_@arch@.tar.gz"
local uri
if use amd64; then
uri="${base_uri//@arch@/x64}"
elif use arm64; then
uri="${base_uri//@arch@/arm64}"
else
die "arch not supported"
fi
local dest="${T}/${PN}.tar.gz"
edo wget -O "${dest}" "${uri}" || die
unpack "${dest}"
local dest="${T}/${PN}.tar.gz"
edo wget -O "${dest}" "${uri}"
unpack "${dest}"
else
default
fi
}
src_install() {