Skip to content

Commit

Permalink
net-p2p/resilio-sync: version bump to 2.6.1, improve init
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Pavljuchenkov <[email protected]>
Package-Manager: Portage-2.3.49, Repoman-2.3.11
Closes: gentoo#10092
Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
SpiderX authored and mgorny committed Oct 14, 2018
1 parent f5e8572 commit 5ff7b4d
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 14 deletions.
2 changes: 2 additions & 0 deletions net-p2p/resilio-sync/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
DIST resilio-sync_2.5.12-1_amd64.deb 10466894 BLAKE2B d9125bfe49738db3a2cab0d66cad9fed2ae712ee613ccd104bc1d8764bd072b082f71fc0102b15d52f791b592d88ffa4f03892e7e4088e3bf4a847b6c15b4296 SHA512 bafc8dbce182253d585185e5d0a27f0a8ca18f768bba65c348752cc089e0e690c8c1848a71cb1b125c67d2c265cbbf13e98d7c99289b0bb0268d43d3e38454d3
DIST resilio-sync_2.5.12-1_i386.deb 10334238 BLAKE2B 447baf18db1f6c47a6a2518f9ba6a27b0d9a7092cc41d63958a66be6492cab3868a0ecae9faadfa91cfc5f777e1289cb62017519a0994b93ae448042de9b32d3 SHA512 bb46498070f6aa0e3debee839f50a9292116bd5f9105fe75c65d11f9f3199e6e5b8f828b34b364e7f3cb896bf88fd37a255289c68158df7414acf809e4701b32
DIST resilio-sync_2.6.1-1_amd64.deb 11576892 BLAKE2B 710bd96b91be84bc7210d8efe0d8954a33be878fc948694e7a1c62e7b53b5ac94133a16b89c4872e18798bc03f3508c7c130d4d56a3480c35d30edff5589ef3a SHA512 a37d73a621a740f57b4f2824cc2a3178f365ccc8180a0e814480dde8d1b74b9d54da4e07bd18c89cc6a93c12b526f8a43e08165d3c2f0fdc913e1f38e46eb183
DIST resilio-sync_2.6.1-1_i386.deb 11465194 BLAKE2B b56e01f79c5beec6a5ebd09724bebd1ce8c6d44eac694cd7fb89dc44823ccba22531b14e241fdd985ae63e6e0f177021becb593923eac8ac0183629e533ac72d SHA512 84676c3fe5fcee484bcd58c6496aba0d2e3c86c339adb90b8b3cef28ae46d7b6f28c5fd0371a2cfe612ab8b3658eca2b9b2f6cfc9caa70aaff95946942a5c749
4 changes: 2 additions & 2 deletions net-p2p/resilio-sync/files/resilio-sync-user.initd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

USER="${RC_SVCNAME##*.}"
Expand All @@ -8,7 +8,7 @@ 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}
config="${CONFIG:-/home/$USER/.config/resilio-sync/config.json}"
command_args="--config $config ${OPTS}"
start_stop_daemon_args="-q"
retry="10"
Expand Down
2 changes: 1 addition & 1 deletion net-p2p/resilio-sync/files/resilio-sync-user.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Resilio Sync service
Documentation=http://help.getsync.com/
Documentation=https://help.resilio.com
After=network.target network-online.target

[Service]
Expand Down
4 changes: 2 additions & 2 deletions net-p2p/resilio-sync/files/resilio-sync.confd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
OPTS="--log /var/log/resilio-sync/resilio-sync.log"

# User and group daemon runs as
USER="rslsync"
GROUP="rslsync"
RSLSYNC_USER="rslsync"
RSLSYNC_GROUP="rslsync"

# Resilio Sync config file
#CONFIG="/etc/resilio-sync/config.json"
7 changes: 3 additions & 4 deletions net-p2p/resilio-sync/files/resilio-sync.initd
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2018 Gentoo Authors
# 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}"
command_user="${RSLSYNC_USER:-rslsync}:${RSLSYNC_GROUP:-rslsync}"
pidfile="/run/resilio-sync/resilio-sync.pid"
config=${CONFIG:-/etc/resilio-sync/config.json}
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
}
8 changes: 5 additions & 3 deletions net-p2p/resilio-sync/files/resilio-sync.service
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[Unit]
Description=Resilio Sync service
Documentation=http://help.getsync.com/
Documentation=https://help.resilio.com
After=network.target network-online.target

[Service]
Type=forking
User=rslsync
Group=rslsync
UMask=0002
Restart=on-failure
PermissionsStartOnly=true

User=rslsync
Group=rslsync

PIDFile=/var/run/resilio-sync/resilio-sync.pid
ExecStart=/usr/bin/rslsync --config /etc/resilio-sync/config.json

Expand Down
4 changes: 2 additions & 2 deletions net-p2p/resilio-sync/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<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>
<doc>https://help.resilio.com/</doc>
<bugs-to>https://help.resilio.com/hc/en-us/requests/new?ticket_form_id=91563</bugs-to>
</upstream>
</pkgmetadata>
74 changes: 74 additions & 0 deletions net-p2p/resilio-sync/resilio-sync-2.6.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit pax-utils readme.gentoo-r1 systemd tmpfiles unpacker user

QA_PREBUILT="usr/bin/rslsync"
BASE_URI="http://linux-packages.resilio.com/${PN}/deb/pool/non-free/r/${PN}/${PN}_${PV}-1_@[email protected]"

DESCRIPTION="Resilient, fast and scalable file synchronization tool"
HOMEPAGE="https://resilio.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="bindist mirror"

S="${WORKDIR}"

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"

pkg_setup() {
enewgroup rslsync
enewuser rslsync -1 -1 /var/lib/resilio-sync rslsync
}

src_unpack() {
unpacker_src_unpack

unpack usr/share/man/man1/resilio-sync.1.gz
}

src_install() {
dobin usr/bin/rslsync
use pax_kernel && pax-mark m "${ED%/}"/usr/bin/rslsync

doman resilio-sync.1

newinitd "${FILESDIR}"/resilio-sync.initd resilio-sync
newconfd "${FILESDIR}"/resilio-sync.confd resilio-sync
newinitd "${FILESDIR}"/resilio-sync-user.initd resilio-sync-user
newconfd "${FILESDIR}"/resilio-sync-user.confd resilio-sync-user
systemd_dounit "${FILESDIR}"/resilio-sync.service
systemd_douserunit "${FILESDIR}"/resilio-sync-user.service
newtmpfiles "${FILESDIR}"/resilio-sync.tmpfile resilio-sync.conf

readme.gentoo_create_doc

# Generate sample config, uncomment config directives and change values
insopts -orslsync -grslsync -m0644
insinto /etc/resilio-sync
newins - config.json < <("${ED%/}"/usr/bin/rslsync --dump-sample-config | \
sed \
-e "/storage_path/s|//| |g" \
-e "/pid_file/s|//| |g" \
-e "/storage_path/s|/home/user/.sync|/var/lib/resilio-sync/.sync|g" \
-e "/pid_file/s|resilio/resilio|resilio-sync/resilio-sync|g" \
|| die "sed failed for config.json" )

diropts -orslsync -grslsync -m0700
keepdir /etc/resilio-sync /var/lib/resilio-sync/ \
/var/lib/resilio-sync/.sync /var/log/resilio-sync
}

pkg_postinst() {
tmpfiles_process resilio-sync.conf
readme.gentoo_print_elog
}

0 comments on commit 5ff7b4d

Please sign in to comment.