summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Korepanov <kaikaikai@yandex.ru>2016-05-23 16:36:09 +0100
committerPatrice Clement <monsieurp@gentoo.org>2016-05-27 13:56:19 +0000
commit053bde6a3fc336ba275a601f594aad9538e6d11e (patch)
tree85ebfcd7dac5bc2dcd765243bc0deea5a8478783 /net-p2p
parentsci-electronics/kicad: Remove obsolete 4.0.0, 4.0.0-r1, 4.0.1, 4.0.2 ebuilds. (diff)
downloadgentoo-053bde6a3fc336ba275a601f594aad9538e6d11e.tar.gz
gentoo-053bde6a3fc336ba275a601f594aad9538e6d11e.tar.bz2
gentoo-053bde6a3fc336ba275a601f594aad9538e6d11e.zip
net-p2p/syncthing-relaysrv: Initial commit.
Closes: https://github.com/gentoo/gentoo/pull/1525 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/syncthing-relaysrv/Manifest1
-rwxr-xr-xnet-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd3
-rwxr-xr-xnet-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd24
-rw-r--r--net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service18
-rw-r--r--net-p2p/syncthing-relaysrv/metadata.xml20
-rw-r--r--net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild48
6 files changed, 114 insertions, 0 deletions
diff --git a/net-p2p/syncthing-relaysrv/Manifest b/net-p2p/syncthing-relaysrv/Manifest
new file mode 100644
index 00000000000..058228a52e2
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/Manifest
@@ -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
index 00000000000..a09a708a0de
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd
@@ -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
index 00000000000..5ee25afd309
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd
@@ -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
index 00000000000..5dc3eee09ba
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service
@@ -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
index 00000000000..e6e03d77dfb
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/metadata.xml
@@ -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
index 00000000000..a0cae01a73a
--- /dev/null
+++ b/net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild
@@ -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
+}