net-p2p/syncthing-relaysrv: Initial commit.
authorAlexey Korepanov <kaikaikai@yandex.ru>
Mon, 23 May 2016 15:36:09 +0000 (16:36 +0100)
committerPatrice Clement <monsieurp@gentoo.org>
Fri, 27 May 2016 13:56:19 +0000 (13:56 +0000)
Closes: https://github.com/gentoo/gentoo/pull/1525
Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
net-p2p/syncthing-relaysrv/Manifest [new file with mode: 0644]
net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd [new file with mode: 0755]
net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd [new file with mode: 0755]
net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service [new file with mode: 0644]
net-p2p/syncthing-relaysrv/metadata.xml [new file with mode: 0644]
net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild [new file with mode: 0644]

diff --git a/net-p2p/syncthing-relaysrv/Manifest b/net-p2p/syncthing-relaysrv/Manifest
new file mode 100644 (file)
index 0000000..058228a
--- /dev/null
@@ -0,0 +1 @@
+DIST syncthing-relaysrv-0.12.18.tar.gz 174413 SHA256 ce21cd29bd091c3dbdc138dc94ede63b6d815b664b615a87a4f1b01ee5f2ce35 SHA512 58f0494bc61e2d62e54535483b8ff7053d433b17a94c85a006a72a9d82d4cd454f97daa9c2648cf63ff4dd55f2fc6c3a85eb5295309cacec3ea2b8fa58d166ff WHIRLPOOL 3f8ffaf1f328244e3a09d817091e06a7f241351845fb8ac62e299681d8d53e43f4370d923cc9cee98064f4e58c195b858295b627e0686c7f9d7171a6610bd87e
diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd
new file mode 100755 (executable)
index 0000000..a09a708
--- /dev/null
@@ -0,0 +1,3 @@
+# Options to pass to syncthing-relaysrv
+# see syncthing-relaysrv --help for more information
+SR_OPTS=
diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd
new file mode 100755 (executable)
index 0000000..5ee25af
--- /dev/null
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+SR_USER=syncthing-relaysrv
+SR_GROUP=syncthing-relaysrv
+SR_HOMEDIR=/var/lib/syncthing-relaysrv
+
+description="Relay service for syncthing"
+command="/usr/bin/syncthing-relaysrv"
+command_args="${SR_OPTS}"
+pidfile="/run/syncthing-relaysrv.pid"
+start_stop_daemon_args="--background
+  --user ${SR_USER}
+  --group ${SR_GROUP}
+  --chdir \"${SR_HOMEDIR}\"
+  --make-pidfile "
+
+depend() {
+  need net
+}
+
+start_pre() {
+  checkpath -q -d -o ${SR_USER}:${SR_GROUP} ${SR_HOMEDIR}
+}
diff --git a/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service
new file mode 100644 (file)
index 0000000..5dc3eee
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Syncthing relay server
+After=network.target
+
+[Service]
+User=syncthing-relaysrv
+Group=syncthing-relaysrv
+ExecStart=/usr/bin/syncthing-relaysrv
+WorkingDirectory=/var/lib/syncthing-relaysrv
+RootDirectory=/var/lib/syncthing-relaysrv
+
+PrivateTmp=true
+ProtectSystem=full
+ProtectHome=true
+NoNewPrivileges=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/syncthing-relaysrv/metadata.xml b/net-p2p/syncthing-relaysrv/metadata.xml
new file mode 100644 (file)
index 0000000..e6e03d7
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>kaikaikai@yandex.ru</email>
+    <name>Alexey Korepanov</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <longdescription lang="en">
+    Relay server for Syncthing helps people behind nats and 
+    firewalls synchronize their data.
+  </longdescription>
+  <upstream>
+    <remote-id type="github">syncthing/relaysrv</remote-id>
+    <bugs-to>https://github.com/syncthing/relaysrv/issues</bugs-to>
+  </upstream>
+</pkgmetadata>
diff --git a/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild b/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild
new file mode 100644 (file)
index 0000000..a0cae01
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+EGO_PN="github.com/syncthing/relaysrv"
+EGIT_COMMIT=v${PV}
+
+inherit golang-vcs-snapshot systemd user versionator
+
+DESCRIPTION="Syncthing relay server"
+HOMEPAGE="https://syncthing.net"
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~arm"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+DOCS="README.md"
+
+USER=syncthing-relaysrv
+BINARY=syncthing-relaysrv
+
+pkg_setup() {
+       enewgroup ${USER}
+       enewuser ${USER} -1 -1 /var/lib/${USER} ${USER}
+}
+
+src_compile() {
+       cd "src/${EGO_PN}" || die "build failed"
+       export GOPATH="$(pwd)/Godeps/_workspace"
+       go build -i -v -ldflags -w -o ${BINARY} || die "build failed"
+}
+
+src_install() {
+       dobin "src/${EGO_PN}/${BINARY}"
+
+       # openrc and systemd daemon routines
+       newconfd "${FILESDIR}/syncthing-relaysrv.confd" syncthing-relaysrv
+       newinitd "${FILESDIR}/syncthing-relaysrv.initd" syncthing-relaysrv
+       systemd_newunit "${FILESDIR}/syncthing-relaysrv.service" \
+               syncthing-relaysrv.service
+}