mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-16 14:29:05 -07:00
net-p2p/resilio-sync-bin: new package.
Resilio Sync is a proprietary peer-to-peer multiplatform file synchronization tool It can sync files between devices on a local network, or between remote devices over the Internet via a modified version of the BitTorrent protocol. Base for ebuild from https://github.com/SpiderX/portage-overlay/tree/master/net-p2p/resilio-sync. Closes: https://bugs.gentoo.org/486406 Closes: https://github.com/gentoo/gentoo/pull/6901 Package-Manager: Portage-2.3.6, Repoman-2.3.2
This commit is contained in:
committed by
Patrice Clement
parent
943cc98868
commit
2099c6f6ad
2
net-p2p/resilio-sync/Manifest
Normal file
2
net-p2p/resilio-sync/Manifest
Normal file
@@ -0,0 +1,2 @@
|
||||
DIST resilio-sync_2.5.12-1_amd64.deb 10467196 BLAKE2B e900ac4e8b3862b29674db09d469013a5d12791c090bfd6ecae8f95af6f8ff2f990b8b9cab176b301b7625d6fcee1fcbe33b497f09bca045497a6765ccbb313c SHA512 4056df3d2cbafdb881f1d2929fca13efd258fb7af2cbdc390eae4820af1f5b2b46d410daf2a1ad1233d105edc46c4d5a8e9259e4557c0695b3392884429d95f9
|
||||
DIST resilio-sync_2.5.12-1_i386.deb 10333948 BLAKE2B 7a7a6e2bf8375bf5428c27053c22de98e598de07d8709f870152a8b9e2d7254a954b3ceebad69bebf286ef29b3d44b9955f33c4f396a7831041c34b9bd585dd2 SHA512 c15276bbe8818e30cab254a7b1f1222e3a25912d99a05287441548ea3ee3de8964d23a5aed56fd547ee3369f9943129cf7d3a5bd410ce28a9fbd45e13def56b4
|
||||
12
net-p2p/resilio-sync/files/resilio-sync-user.confd
Normal file
12
net-p2p/resilio-sync/files/resilio-sync-user.confd
Normal file
@@ -0,0 +1,12 @@
|
||||
# Config file for /etc/init.d/resilio-sync
|
||||
|
||||
# Various options.
|
||||
# run `rslsync --help` for valid cmdline options
|
||||
#OPTS="--log /var/log/resilio-sync/resilio-sync.log"
|
||||
|
||||
# User and group daemon runs as
|
||||
#USER="rslsync"
|
||||
#GROUP="rslsync"
|
||||
|
||||
# Resilio Sync config file
|
||||
#CONFIG="/etc/resilio-sync/config.json"
|
||||
27
net-p2p/resilio-sync/files/resilio-sync-user.initd
Normal file
27
net-p2p/resilio-sync/files/resilio-sync-user.initd
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
USER="${RC_SVCNAME##*.}"
|
||||
command="/usr/bin/rslsync"
|
||||
name="Resilio Sync for $USER"
|
||||
description="Resilio Sync"
|
||||
command_user="${USER:-rslsync}:${GROUP:-rslsync}"
|
||||
pidfile="${PIDFILE:-/home/$USER/.config/resilio-sync/resilio-sync.pid}"
|
||||
config=${CONFIG:-/home/$USER/.config/resilio-sync/config.json}
|
||||
command_args="--config $config ${OPTS}"
|
||||
start_stop_daemon_args="-q"
|
||||
retry="10"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "$USER" = "resilio-sync-user" ]; then
|
||||
eerror "You are not supposed to run this script directly."
|
||||
eerror "Create a symlink for this script:"
|
||||
eerror " ln -s $RC_SVCNAME /etc/init.d/$RC_SVCNAME.<user>"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
13
net-p2p/resilio-sync/files/resilio-sync-user.service
Normal file
13
net-p2p/resilio-sync/files/resilio-sync-user.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Resilio Sync service
|
||||
Documentation=http://help.getsync.com/
|
||||
After=network.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Restart=on-failure
|
||||
PIDFile=%h/.config/resilio-sync/resilio-sync.pid
|
||||
ExecStart=/usr/bin/rslsync --config %h/.config/resilio-sync/config.json
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
12
net-p2p/resilio-sync/files/resilio-sync.confd
Normal file
12
net-p2p/resilio-sync/files/resilio-sync.confd
Normal file
@@ -0,0 +1,12 @@
|
||||
# Config file for /etc/init.d/resilio-sync
|
||||
|
||||
# Various options.
|
||||
# run `rslsync --help` for valid cmdline options
|
||||
OPTS="--log /var/log/resilio-sync/resilio-sync.log"
|
||||
|
||||
# User and group daemon runs as
|
||||
USER="rslsync"
|
||||
GROUP="rslsync"
|
||||
|
||||
# Resilio Sync config file
|
||||
#CONFIG="/etc/resilio-sync/config.json"
|
||||
18
net-p2p/resilio-sync/files/resilio-sync.initd
Normal file
18
net-p2p/resilio-sync/files/resilio-sync.initd
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/bin/rslsync"
|
||||
name="Resilio Sync"
|
||||
description="Resilio Sync"
|
||||
command_user="${USER:-rslsync}::${GROUP:-rslsync}"
|
||||
pidfile="/run/resilio-sync/resilio-sync.pid"
|
||||
config=${CONFIG:-/etc/resilio-sync/config.json}
|
||||
command_args="--config $config ${OPTS}"
|
||||
start_stop_daemon_args="-q"
|
||||
retry="10"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
provide resilio-sync
|
||||
}
|
||||
17
net-p2p/resilio-sync/files/resilio-sync.service
Normal file
17
net-p2p/resilio-sync/files/resilio-sync.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Resilio Sync service
|
||||
Documentation=http://help.getsync.com/
|
||||
After=network.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=rslsync
|
||||
Group=rslsync
|
||||
UMask=0002
|
||||
Restart=on-failure
|
||||
PermissionsStartOnly=true
|
||||
PIDFile=/var/run/resilio-sync/resilio-sync.pid
|
||||
ExecStart=/usr/bin/rslsync --config /etc/resilio-sync/config.json
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1
net-p2p/resilio-sync/files/resilio-sync.tmpfile
Normal file
1
net-p2p/resilio-sync/files/resilio-sync.tmpfile
Normal file
@@ -0,0 +1 @@
|
||||
d /run/resilio-sync 0755 rslsync rslsync
|
||||
24
net-p2p/resilio-sync/metadata.xml
Normal file
24
net-p2p/resilio-sync/metadata.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>spiderx@spiderx.dp.ua</email>
|
||||
<name>Vladimir Pavljuchenkov</name>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>proxy-maint@gentoo.org</email>
|
||||
<name>Proxy Maintainers</name>
|
||||
</maintainer>
|
||||
<longdescription lang="en">
|
||||
Resilio Sync is a proprietary peer-to-peer multiplatform file synchronization tool
|
||||
It can sync files between devices on a local network, or between remote devices
|
||||
over the Internet via a modified version of the BitTorrent protocol.
|
||||
</longdescription>
|
||||
<use>
|
||||
<flag name="pax_kernel">Use paxctl to mark binaries</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
<doc>https://help.getsync.com/</doc>
|
||||
<bugs-to>https://help.getsync.com/hc/en-us/requests/new?ticket_form_id=91563</bugs-to>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
78
net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild
Normal file
78
net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild
Normal file
@@ -0,0 +1,78 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
BASE_URI="http://linux-packages.resilio.com/${PN}/deb/pool/non-free/r/${PN}/${PN}_${PV}-1_@arch@.deb"
|
||||
|
||||
inherit pax-utils readme.gentoo-r1 systemd tmpfiles unpacker user
|
||||
|
||||
NAME="rslsync"
|
||||
QA_PREBUILT="usr/bin/${NAME}"
|
||||
|
||||
DESCRIPTION="Resilient, fast and scalable file synchronization tool"
|
||||
HOMEPAGE="https://getsync.com/"
|
||||
SRC_URI="amd64? ( ${BASE_URI/@arch@/amd64} )
|
||||
x86? ( ${BASE_URI/@arch@/i386} )"
|
||||
|
||||
LICENSE="all-rights-reserved"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="pax_kernel"
|
||||
RESTRICT="mirror"
|
||||
|
||||
S="${WORKDIR}"
|
||||
|
||||
DOC_CONTENTS="You may need to review /etc/${PN}/config.json\n
|
||||
Default metadata path is /var/lib/${PN}/.sync\n
|
||||
Default web-gui URL is http://localhost:8888/\n\n"
|
||||
|
||||
pkg_setup() {
|
||||
enewgroup ${NAME}
|
||||
enewuser ${NAME} -1 -1 /var/lib/${PN} ${NAME}
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
unpacker_src_unpack
|
||||
|
||||
unpack usr/share/man/man1/${PN}.1.gz
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin usr/bin/${NAME}
|
||||
use pax_kernel && pax-mark m "${ED%/}"/usr/bin/${NAME}
|
||||
|
||||
doman ${PN}.1
|
||||
|
||||
dodir /var/log/${PN}
|
||||
keepdir /etc/${PN} /var/lib/${PN}/ /var/lib/${PN}/.sync
|
||||
fperms 0700 /etc/${PN} /var/lib/${PN} /var/lib/${PN}/.sync /var/log/${PN}
|
||||
fowners -R ${NAME}:${NAME} /etc/${PN} /var/lib/${PN} /var/log/${PN}
|
||||
|
||||
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
||||
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||||
newinitd "${FILESDIR}"/${PN}-user.initd ${PN}-user
|
||||
newconfd "${FILESDIR}"/${PN}-user.confd ${PN}-user
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
systemd_douserunit "${FILESDIR}"/${PN}-user.service
|
||||
newtmpfiles "${FILESDIR}"/resilio-sync.tmpfile resilio-sync.conf
|
||||
|
||||
readme.gentoo_create_doc
|
||||
|
||||
# Generate sample config
|
||||
"${ED%/}"/usr/bin/${NAME} --dump-sample-config > \
|
||||
"${ED%/}"/etc/${PN}/config.json || die "generate config failed"
|
||||
fowners ${NAME}:${NAME} /etc/${PN}/config.json
|
||||
# Uncomment config directives and change their values
|
||||
sed -i \
|
||||
-e "/storage_path/s|//| |g" \
|
||||
-e "/pid_file/s|//| |g" \
|
||||
-e "/storage_path/s|/home/user/.sync|/var/lib/${PN}/.sync|g" \
|
||||
-e "/pid_file/s|resilio/resilio|${PN}/${PN}|g" \
|
||||
"${ED%/}"/etc/${PN}/config.json || die "sed failed for config.json"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
tmpfiles_process resilio-sync.conf
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
Reference in New Issue
Block a user