1 |
commit: 2099c6f6ad76beffe20bb54a552d57ca528e3eca |
2 |
Author: Vladimir Pavljuchenkov (SpiderX) <spiderx <AT> spiderx <DOT> dp <DOT> ua> |
3 |
AuthorDate: Wed Jul 19 18:35:22 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 25 22:46:40 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2099c6f6 |
7 |
|
8 |
net-p2p/resilio-sync-bin: new package. |
9 |
|
10 |
Resilio Sync is a proprietary peer-to-peer multiplatform file synchronization |
11 |
tool It can sync files between devices on a local network, or between remote |
12 |
devices over the Internet via a modified version of the BitTorrent protocol. |
13 |
|
14 |
Base for ebuild from https://github.com/SpiderX/portage-overlay/tree/master/net-p2p/resilio-sync. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/486406 |
17 |
Closes: https://github.com/gentoo/gentoo/pull/6901 |
18 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
19 |
|
20 |
net-p2p/resilio-sync/Manifest | 2 + |
21 |
net-p2p/resilio-sync/files/resilio-sync-user.confd | 12 ++++ |
22 |
net-p2p/resilio-sync/files/resilio-sync-user.initd | 27 ++++++++ |
23 |
.../resilio-sync/files/resilio-sync-user.service | 13 ++++ |
24 |
net-p2p/resilio-sync/files/resilio-sync.confd | 12 ++++ |
25 |
net-p2p/resilio-sync/files/resilio-sync.initd | 18 +++++ |
26 |
net-p2p/resilio-sync/files/resilio-sync.service | 17 +++++ |
27 |
net-p2p/resilio-sync/files/resilio-sync.tmpfile | 1 + |
28 |
net-p2p/resilio-sync/metadata.xml | 24 +++++++ |
29 |
net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild | 78 ++++++++++++++++++++++ |
30 |
10 files changed, 204 insertions(+) |
31 |
|
32 |
diff --git a/net-p2p/resilio-sync/Manifest b/net-p2p/resilio-sync/Manifest |
33 |
new file mode 100644 |
34 |
index 00000000000..6e35938ad7c |
35 |
--- /dev/null |
36 |
+++ b/net-p2p/resilio-sync/Manifest |
37 |
@@ -0,0 +1,2 @@ |
38 |
+DIST resilio-sync_2.5.12-1_amd64.deb 10467196 BLAKE2B e900ac4e8b3862b29674db09d469013a5d12791c090bfd6ecae8f95af6f8ff2f990b8b9cab176b301b7625d6fcee1fcbe33b497f09bca045497a6765ccbb313c SHA512 4056df3d2cbafdb881f1d2929fca13efd258fb7af2cbdc390eae4820af1f5b2b46d410daf2a1ad1233d105edc46c4d5a8e9259e4557c0695b3392884429d95f9 |
39 |
+DIST resilio-sync_2.5.12-1_i386.deb 10333948 BLAKE2B 7a7a6e2bf8375bf5428c27053c22de98e598de07d8709f870152a8b9e2d7254a954b3ceebad69bebf286ef29b3d44b9955f33c4f396a7831041c34b9bd585dd2 SHA512 c15276bbe8818e30cab254a7b1f1222e3a25912d99a05287441548ea3ee3de8964d23a5aed56fd547ee3369f9943129cf7d3a5bd410ce28a9fbd45e13def56b4 |
40 |
|
41 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync-user.confd b/net-p2p/resilio-sync/files/resilio-sync-user.confd |
42 |
new file mode 100644 |
43 |
index 00000000000..040da8bdf84 |
44 |
--- /dev/null |
45 |
+++ b/net-p2p/resilio-sync/files/resilio-sync-user.confd |
46 |
@@ -0,0 +1,12 @@ |
47 |
+# Config file for /etc/init.d/resilio-sync |
48 |
+ |
49 |
+# Various options. |
50 |
+# run `rslsync --help` for valid cmdline options |
51 |
+#OPTS="--log /var/log/resilio-sync/resilio-sync.log" |
52 |
+ |
53 |
+# User and group daemon runs as |
54 |
+#USER="rslsync" |
55 |
+#GROUP="rslsync" |
56 |
+ |
57 |
+# Resilio Sync config file |
58 |
+#CONFIG="/etc/resilio-sync/config.json" |
59 |
|
60 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync-user.initd b/net-p2p/resilio-sync/files/resilio-sync-user.initd |
61 |
new file mode 100644 |
62 |
index 00000000000..efcaa2d7778 |
63 |
--- /dev/null |
64 |
+++ b/net-p2p/resilio-sync/files/resilio-sync-user.initd |
65 |
@@ -0,0 +1,27 @@ |
66 |
+#!/sbin/openrc-run |
67 |
+# Copyright 1999-2018 Gentoo Foundation |
68 |
+# Distributed under the terms of the GNU General Public License v2 |
69 |
+ |
70 |
+USER="${RC_SVCNAME##*.}" |
71 |
+command="/usr/bin/rslsync" |
72 |
+name="Resilio Sync for $USER" |
73 |
+description="Resilio Sync" |
74 |
+command_user="${USER:-rslsync}:${GROUP:-rslsync}" |
75 |
+pidfile="${PIDFILE:-/home/$USER/.config/resilio-sync/resilio-sync.pid}" |
76 |
+config=${CONFIG:-/home/$USER/.config/resilio-sync/config.json} |
77 |
+command_args="--config $config ${OPTS}" |
78 |
+start_stop_daemon_args="-q" |
79 |
+retry="10" |
80 |
+ |
81 |
+depend() { |
82 |
+ need net |
83 |
+} |
84 |
+ |
85 |
+start_pre() { |
86 |
+ if [ "$USER" = "resilio-sync-user" ]; then |
87 |
+ eerror "You are not supposed to run this script directly." |
88 |
+ eerror "Create a symlink for this script:" |
89 |
+ eerror " ln -s $RC_SVCNAME /etc/init.d/$RC_SVCNAME.<user>" |
90 |
+ return 1 |
91 |
+ fi |
92 |
+} |
93 |
|
94 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync-user.service b/net-p2p/resilio-sync/files/resilio-sync-user.service |
95 |
new file mode 100644 |
96 |
index 00000000000..6c82440ac67 |
97 |
--- /dev/null |
98 |
+++ b/net-p2p/resilio-sync/files/resilio-sync-user.service |
99 |
@@ -0,0 +1,13 @@ |
100 |
+[Unit] |
101 |
+Description=Resilio Sync service |
102 |
+Documentation=http://help.getsync.com/ |
103 |
+After=network.target network-online.target |
104 |
+ |
105 |
+[Service] |
106 |
+Type=forking |
107 |
+Restart=on-failure |
108 |
+PIDFile=%h/.config/resilio-sync/resilio-sync.pid |
109 |
+ExecStart=/usr/bin/rslsync --config %h/.config/resilio-sync/config.json |
110 |
+ |
111 |
+[Install] |
112 |
+WantedBy=multi-user.target |
113 |
|
114 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync.confd b/net-p2p/resilio-sync/files/resilio-sync.confd |
115 |
new file mode 100644 |
116 |
index 00000000000..08c4255fe29 |
117 |
--- /dev/null |
118 |
+++ b/net-p2p/resilio-sync/files/resilio-sync.confd |
119 |
@@ -0,0 +1,12 @@ |
120 |
+# Config file for /etc/init.d/resilio-sync |
121 |
+ |
122 |
+# Various options. |
123 |
+# run `rslsync --help` for valid cmdline options |
124 |
+OPTS="--log /var/log/resilio-sync/resilio-sync.log" |
125 |
+ |
126 |
+# User and group daemon runs as |
127 |
+USER="rslsync" |
128 |
+GROUP="rslsync" |
129 |
+ |
130 |
+# Resilio Sync config file |
131 |
+#CONFIG="/etc/resilio-sync/config.json" |
132 |
|
133 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync.initd b/net-p2p/resilio-sync/files/resilio-sync.initd |
134 |
new file mode 100644 |
135 |
index 00000000000..b9f0380a773 |
136 |
--- /dev/null |
137 |
+++ b/net-p2p/resilio-sync/files/resilio-sync.initd |
138 |
@@ -0,0 +1,18 @@ |
139 |
+#!/sbin/openrc-run |
140 |
+# Copyright 1999-2018 Gentoo Foundation |
141 |
+# Distributed under the terms of the GNU General Public License v2 |
142 |
+ |
143 |
+command="/usr/bin/rslsync" |
144 |
+name="Resilio Sync" |
145 |
+description="Resilio Sync" |
146 |
+command_user="${USER:-rslsync}::${GROUP:-rslsync}" |
147 |
+pidfile="/run/resilio-sync/resilio-sync.pid" |
148 |
+config=${CONFIG:-/etc/resilio-sync/config.json} |
149 |
+command_args="--config $config ${OPTS}" |
150 |
+start_stop_daemon_args="-q" |
151 |
+retry="10" |
152 |
+ |
153 |
+depend() { |
154 |
+ need net |
155 |
+ provide resilio-sync |
156 |
+} |
157 |
|
158 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync.service b/net-p2p/resilio-sync/files/resilio-sync.service |
159 |
new file mode 100644 |
160 |
index 00000000000..32f24a95aa8 |
161 |
--- /dev/null |
162 |
+++ b/net-p2p/resilio-sync/files/resilio-sync.service |
163 |
@@ -0,0 +1,17 @@ |
164 |
+[Unit] |
165 |
+Description=Resilio Sync service |
166 |
+Documentation=http://help.getsync.com/ |
167 |
+After=network.target network-online.target |
168 |
+ |
169 |
+[Service] |
170 |
+Type=forking |
171 |
+User=rslsync |
172 |
+Group=rslsync |
173 |
+UMask=0002 |
174 |
+Restart=on-failure |
175 |
+PermissionsStartOnly=true |
176 |
+PIDFile=/var/run/resilio-sync/resilio-sync.pid |
177 |
+ExecStart=/usr/bin/rslsync --config /etc/resilio-sync/config.json |
178 |
+ |
179 |
+[Install] |
180 |
+WantedBy=multi-user.target |
181 |
|
182 |
diff --git a/net-p2p/resilio-sync/files/resilio-sync.tmpfile b/net-p2p/resilio-sync/files/resilio-sync.tmpfile |
183 |
new file mode 100644 |
184 |
index 00000000000..d0f6e0adc42 |
185 |
--- /dev/null |
186 |
+++ b/net-p2p/resilio-sync/files/resilio-sync.tmpfile |
187 |
@@ -0,0 +1 @@ |
188 |
+d /run/resilio-sync 0755 rslsync rslsync |
189 |
|
190 |
diff --git a/net-p2p/resilio-sync/metadata.xml b/net-p2p/resilio-sync/metadata.xml |
191 |
new file mode 100644 |
192 |
index 00000000000..35827ed4235 |
193 |
--- /dev/null |
194 |
+++ b/net-p2p/resilio-sync/metadata.xml |
195 |
@@ -0,0 +1,24 @@ |
196 |
+<?xml version="1.0" encoding="UTF-8"?> |
197 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
198 |
+<pkgmetadata> |
199 |
+ <maintainer type="person"> |
200 |
+ <email>spiderx@××××××××××.ua</email> |
201 |
+ <name>Vladimir Pavljuchenkov</name> |
202 |
+ </maintainer> |
203 |
+ <maintainer type="project"> |
204 |
+ <email>proxy-maint@g.o</email> |
205 |
+ <name>Proxy Maintainers</name> |
206 |
+ </maintainer> |
207 |
+ <longdescription lang="en"> |
208 |
+ Resilio Sync is a proprietary peer-to-peer multiplatform file synchronization tool |
209 |
+ It can sync files between devices on a local network, or between remote devices |
210 |
+ over the Internet via a modified version of the BitTorrent protocol. |
211 |
+ </longdescription> |
212 |
+ <use> |
213 |
+ <flag name="pax_kernel">Use paxctl to mark binaries</flag> |
214 |
+ </use> |
215 |
+ <upstream> |
216 |
+ <doc>https://help.getsync.com/</doc> |
217 |
+ <bugs-to>https://help.getsync.com/hc/en-us/requests/new?ticket_form_id=91563</bugs-to> |
218 |
+ </upstream> |
219 |
+</pkgmetadata> |
220 |
|
221 |
diff --git a/net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild b/net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild |
222 |
new file mode 100644 |
223 |
index 00000000000..908b87b2209 |
224 |
--- /dev/null |
225 |
+++ b/net-p2p/resilio-sync/resilio-sync-2.5.12.ebuild |
226 |
@@ -0,0 +1,78 @@ |
227 |
+# Copyright 1999-2018 Gentoo Foundation |
228 |
+# Distributed under the terms of the GNU General Public License v2 |
229 |
+ |
230 |
+EAPI=6 |
231 |
+ |
232 |
+BASE_URI="http://linux-packages.resilio.com/${PN}/deb/pool/non-free/r/${PN}/${PN}_${PV}-1_@arch@.deb" |
233 |
+ |
234 |
+inherit pax-utils readme.gentoo-r1 systemd tmpfiles unpacker user |
235 |
+ |
236 |
+NAME="rslsync" |
237 |
+QA_PREBUILT="usr/bin/${NAME}" |
238 |
+ |
239 |
+DESCRIPTION="Resilient, fast and scalable file synchronization tool" |
240 |
+HOMEPAGE="https://getsync.com/" |
241 |
+SRC_URI="amd64? ( ${BASE_URI/@arch@/amd64} ) |
242 |
+ x86? ( ${BASE_URI/@arch@/i386} )" |
243 |
+ |
244 |
+LICENSE="all-rights-reserved" |
245 |
+SLOT="0" |
246 |
+KEYWORDS="~amd64 ~x86" |
247 |
+IUSE="pax_kernel" |
248 |
+RESTRICT="mirror" |
249 |
+ |
250 |
+S="${WORKDIR}" |
251 |
+ |
252 |
+DOC_CONTENTS="You may need to review /etc/${PN}/config.json\n |
253 |
+Default metadata path is /var/lib/${PN}/.sync\n |
254 |
+Default web-gui URL is http://localhost:8888/\n\n" |
255 |
+ |
256 |
+pkg_setup() { |
257 |
+ enewgroup ${NAME} |
258 |
+ enewuser ${NAME} -1 -1 /var/lib/${PN} ${NAME} |
259 |
+} |
260 |
+ |
261 |
+src_unpack() { |
262 |
+ unpacker_src_unpack |
263 |
+ |
264 |
+ unpack usr/share/man/man1/${PN}.1.gz |
265 |
+} |
266 |
+ |
267 |
+src_install() { |
268 |
+ dobin usr/bin/${NAME} |
269 |
+ use pax_kernel && pax-mark m "${ED%/}"/usr/bin/${NAME} |
270 |
+ |
271 |
+ doman ${PN}.1 |
272 |
+ |
273 |
+ dodir /var/log/${PN} |
274 |
+ keepdir /etc/${PN} /var/lib/${PN}/ /var/lib/${PN}/.sync |
275 |
+ fperms 0700 /etc/${PN} /var/lib/${PN} /var/lib/${PN}/.sync /var/log/${PN} |
276 |
+ fowners -R ${NAME}:${NAME} /etc/${PN} /var/lib/${PN} /var/log/${PN} |
277 |
+ |
278 |
+ newinitd "${FILESDIR}"/${PN}.initd ${PN} |
279 |
+ newconfd "${FILESDIR}"/${PN}.confd ${PN} |
280 |
+ newinitd "${FILESDIR}"/${PN}-user.initd ${PN}-user |
281 |
+ newconfd "${FILESDIR}"/${PN}-user.confd ${PN}-user |
282 |
+ systemd_dounit "${FILESDIR}"/${PN}.service |
283 |
+ systemd_douserunit "${FILESDIR}"/${PN}-user.service |
284 |
+ newtmpfiles "${FILESDIR}"/resilio-sync.tmpfile resilio-sync.conf |
285 |
+ |
286 |
+ readme.gentoo_create_doc |
287 |
+ |
288 |
+ # Generate sample config |
289 |
+ "${ED%/}"/usr/bin/${NAME} --dump-sample-config > \ |
290 |
+ "${ED%/}"/etc/${PN}/config.json || die "generate config failed" |
291 |
+ fowners ${NAME}:${NAME} /etc/${PN}/config.json |
292 |
+ # Uncomment config directives and change their values |
293 |
+ sed -i \ |
294 |
+ -e "/storage_path/s|//| |g" \ |
295 |
+ -e "/pid_file/s|//| |g" \ |
296 |
+ -e "/storage_path/s|/home/user/.sync|/var/lib/${PN}/.sync|g" \ |
297 |
+ -e "/pid_file/s|resilio/resilio|${PN}/${PN}|g" \ |
298 |
+ "${ED%/}"/etc/${PN}/config.json || die "sed failed for config.json" |
299 |
+} |
300 |
+ |
301 |
+pkg_postinst() { |
302 |
+ tmpfiles_process resilio-sync.conf |
303 |
+ readme.gentoo_print_elog |
304 |
+} |