From 053bde6a3fc336ba275a601f594aad9538e6d11e Mon Sep 17 00:00:00 2001 From: Alexey Korepanov Date: Mon, 23 May 2016 16:36:09 +0100 Subject: net-p2p/syncthing-relaysrv: Initial commit. Closes: https://github.com/gentoo/gentoo/pull/1525 Signed-off-by: Patrice Clement --- net-p2p/syncthing-relaysrv/Manifest | 1 + .../files/syncthing-relaysrv.confd | 3 ++ .../files/syncthing-relaysrv.initd | 24 +++++++++++ .../files/syncthing-relaysrv.service | 18 ++++++++ net-p2p/syncthing-relaysrv/metadata.xml | 20 +++++++++ .../syncthing-relaysrv-0.12.18.ebuild | 48 ++++++++++++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 net-p2p/syncthing-relaysrv/Manifest create mode 100755 net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.confd create mode 100755 net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.initd create mode 100644 net-p2p/syncthing-relaysrv/files/syncthing-relaysrv.service create mode 100644 net-p2p/syncthing-relaysrv/metadata.xml create mode 100644 net-p2p/syncthing-relaysrv/syncthing-relaysrv-0.12.18.ebuild (limited to 'net-p2p/syncthing-relaysrv') diff --git a/net-p2p/syncthing-relaysrv/Manifest b/net-p2p/syncthing-relaysrv/Manifest new file mode 100644 index 000000000000..058228a52e2f --- /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 000000000000..a09a708a0de4 --- /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 000000000000..5ee25afd3091 --- /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 000000000000..5dc3eee09ba4 --- /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 000000000000..e6e03d77dfb8 --- /dev/null +++ b/net-p2p/syncthing-relaysrv/metadata.xml @@ -0,0 +1,20 @@ + + + + + kaikaikai@yandex.ru + Alexey Korepanov + + + proxy-maint@gentoo.org + Proxy Maintainers + + + Relay server for Syncthing helps people behind nats and + firewalls synchronize their data. + + + syncthing/relaysrv + https://github.com/syncthing/relaysrv/issues + + 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 000000000000..a0cae01a73af --- /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 +} -- cgit v1.2.3-65-gdbad