Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/syncthing-relaysrv/, net-p2p/syncthing-relaysrv/files/
Date: Fri, 27 May 2016 14:25:18
Message-Id: 1464357379.053bde6a3fc336ba275a601f594aad9538e6d11e.monsieurp@gentoo
1 commit: 053bde6a3fc336ba275a601f594aad9538e6d11e
2 Author: Alexey Korepanov <kaikaikai <AT> yandex <DOT> ru>
3 AuthorDate: Mon May 23 15:36:09 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Fri May 27 13:56:19 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=053bde6a
7
8 net-p2p/syncthing-relaysrv: Initial commit.
9
10 Closes: https://github.com/gentoo/gentoo/pull/1525
11 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
12
13 net-p2p/syncthing-relaysrv/Manifest | 1 +
14 .../files/syncthing-relaysrv.confd | 3 ++
15 .../files/syncthing-relaysrv.initd | 24 +++++++++++
16 .../files/syncthing-relaysrv.service | 18 ++++++++
17 net-p2p/syncthing-relaysrv/metadata.xml | 20 +++++++++
18 .../syncthing-relaysrv-0.12.18.ebuild | 48 ++++++++++++++++++++++
19 6 files changed, 114 insertions(+)
20
21 diff --git a/net-p2p/syncthing-relaysrv/Manifest b/net-p2p/syncthing-relaysrv/Manifest
22 new file mode 100644
23 index 0000000..058228a
24 --- /dev/null
25 +++ b/net-p2p/syncthing-relaysrv/Manifest
26 @@ -0,0 +1 @@
27 +DIST syncthing-relaysrv-0.12.18.tar.gz 174413 SHA256 ce21cd29bd091c3dbdc138dc94ede63b6d815b664b615a87a4f1b01ee5f2ce35 SHA512 58f0494bc61e2d62e54535483b8ff7053d433b17a94c85a006a72a9d82d4cd454f97daa9c2648cf63ff4dd55f2fc6c3a85eb5295309cacec3ea2b8fa58d166ff WHIRLPOOL 3f8ffaf1f328244e3a09d817091e06a7f241351845fb8ac62e299681d8d53e43f4370d923cc9cee98064f4e58c195b858295b627e0686c7f9d7171a6610bd87e
28
29 diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd
30 new file mode 100755
31 index 0000000..a09a708
32 --- /dev/null
33 +++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd
34 @@ -0,0 +1,3 @@
35 +# Options to pass to syncthing-relaysrv
36 +# see syncthing-relaysrv --help for more information
37 +SR_OPTS=
38
39 diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd
40 new file mode 100755
41 index 0000000..5ee25af
42 --- /dev/null
43 +++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd
44 @@ -0,0 +1,24 @@
45 +#!/sbin/openrc-run
46 +# Copyright 1999-2016 Gentoo Foundation
47 +# Distributed under the terms of the GNU General Public License v2
48 +SR_USER=syncthing-relaysrv
49 +SR_GROUP=syncthing-relaysrv
50 +SR_HOMEDIR=/var/lib/syncthing-relaysrv
51 +
52 +description="Relay service for syncthing"
53 +command="/usr/bin/syncthing-relaysrv"
54 +command_args="${SR_OPTS}"
55 +pidfile="/run/syncthing-relaysrv.pid"
56 +start_stop_daemon_args="--background
57 + --user ${SR_USER}
58 + --group ${SR_GROUP}
59 + --chdir \"${SR_HOMEDIR}\"
60 + --make-pidfile "
61 +
62 +depend() {
63 + need net
64 +}
65 +
66 +start_pre() {
67 + checkpath -q -d -o ${SR_USER}:${SR_GROUP} ${SR_HOMEDIR}
68 +}
69
70 diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service
71 new file mode 100644
72 index 0000000..5dc3eee
73 --- /dev/null
74 +++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service
75 @@ -0,0 +1,18 @@
76 +[Unit]
77 +Description=Syncthing relay server
78 +After=network.target
79 +
80 +[Service]
81 +User=syncthing-relaysrv
82 +Group=syncthing-relaysrv
83 +ExecStart=/usr/bin/syncthing-relaysrv
84 +WorkingDirectory=/var/lib/syncthing-relaysrv
85 +RootDirectory=/var/lib/syncthing-relaysrv
86 +
87 +PrivateTmp=true
88 +ProtectSystem=full
89 +ProtectHome=true
90 +NoNewPrivileges=true
91 +
92 +[Install]
93 +WantedBy=multi-user.target
94
95 diff --git a/net-p2p/syncthing-relaysrv/metadata.xml b/net-p2p/syncthing-relaysrv/metadata.xml
96 new file mode 100644
97 index 0000000..e6e03d7
98 --- /dev/null
99 +++ b/net-p2p/syncthing-relaysrv/metadata.xml
100 @@ -0,0 +1,20 @@
101 +<?xml version="1.0" encoding="UTF-8"?>
102 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
103 +<pkgmetadata>
104 + <maintainer type="person">
105 + <email>kaikaikai@××××××.ru</email>
106 + <name>Alexey Korepanov</name>
107 + </maintainer>
108 + <maintainer type="project">
109 + <email>proxy-maint@g.o</email>
110 + <name>Proxy Maintainers</name>
111 + </maintainer>
112 + <longdescription lang="en">
113 + Relay server for Syncthing helps people behind nats and
114 + firewalls synchronize their data.
115 + </longdescription>
116 + <upstream>
117 + <remote-id type="github">syncthing/relaysrv</remote-id>
118 + <bugs-to>https://github.com/syncthing/relaysrv/issues</bugs-to>
119 + </upstream>
120 +</pkgmetadata>
121
122 diff --git a/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild b/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild
123 new file mode 100644
124 index 0000000..a0cae01
125 --- /dev/null
126 +++ b/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild
127 @@ -0,0 +1,48 @@
128 +# Copyright 1999-2016 Gentoo Foundation
129 +# Distributed under the terms of the GNU General Public License v2
130 +# $Id$
131 +
132 +EAPI=6
133 +
134 +EGO_PN="github.com/syncthing/relaysrv"
135 +EGIT_COMMIT=v${PV}
136 +
137 +inherit golang-vcs-snapshot systemd user versionator
138 +
139 +DESCRIPTION="Syncthing relay server"
140 +HOMEPAGE="https://syncthing.net"
141 +SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
142 +
143 +LICENSE="MIT"
144 +SLOT="0"
145 +KEYWORDS="~amd64 ~x86 ~arm"
146 +IUSE=""
147 +
148 +DEPEND=""
149 +RDEPEND=""
150 +
151 +DOCS="README.md"
152 +
153 +USER=syncthing-relaysrv
154 +BINARY=syncthing-relaysrv
155 +
156 +pkg_setup() {
157 + enewgroup ${USER}
158 + enewuser ${USER} -1 -1 /var/lib/${USER} ${USER}
159 +}
160 +
161 +src_compile() {
162 + cd "src/${EGO_PN}" || die "build failed"
163 + export GOPATH="$(pwd)/Godeps/_workspace"
164 + go build -i -v -ldflags -w -o ${BINARY} || die "build failed"
165 +}
166 +
167 +src_install() {
168 + dobin "src/${EGO_PN}/${BINARY}"
169 +
170 + # openrc and systemd daemon routines
171 + newconfd "${FILESDIR}/syncthing-relaysrv.confd" syncthing-relaysrv
172 + newinitd "${FILESDIR}/syncthing-relaysrv.initd" syncthing-relaysrv
173 + systemd_newunit "${FILESDIR}/syncthing-relaysrv.service" \
174 + syncthing-relaysrv.service
175 +}