summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-misc/zerotier/Manifest1
-rw-r--r--net-misc/zerotier/files/zerotier.init22
-rw-r--r--net-misc/zerotier/files/zerotier.service11
-rw-r--r--net-misc/zerotier/metadata.xml12
-rw-r--r--net-misc/zerotier/zerotier-1.2.4.ebuild42
5 files changed, 88 insertions, 0 deletions
diff --git a/net-misc/zerotier/Manifest b/net-misc/zerotier/Manifest
new file mode 100644
index 000000000000..8dfd2400eb7c
--- /dev/null
+++ b/net-misc/zerotier/Manifest
@@ -0,0 +1 @@
+DIST zerotier-1.2.4.tar.gz 7963254 SHA256 9f275b3732b721f02cc4b8df75b51e6a8fb56dfe1a542a7bd681538d852b0358 SHA512 82adb110208d24ae2745e3839810afcac87955de050ebfe0517a7dc2a875881dafd40c1b16a041742d8c4d0f6513abcc71d6ea3e06c2fb89b47be2630a500363 WHIRLPOOL 661af8a0255ceedbedaf540c77711753d28041986811f30552a2f04432f02ea41b0d6f23786c4dfc664e4d9bd385b7a8da30c42ce902204d4a3ab64e0b17d839
diff --git a/net-misc/zerotier/files/zerotier.init b/net-misc/zerotier/files/zerotier.init
new file mode 100644
index 000000000000..7d226552dad2
--- /dev/null
+++ b/net-misc/zerotier/files/zerotier.init
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+
+ZEROTIERONE_PIDFILE="/var/run/${SVCNAME}.pid"
+PN="zerotier-one"
+PN_PATH="/usr/bin/${PN}"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting ${PN}"
+ start-stop-daemon --start \
+ --exec "${PN_PATH}" --make-pidfile --pidfile "${ZEROTIERONE_PIDFILE}" --background
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${PN}"
+ start-stop-daemon --stop --quiet --pidfile "${ZEROTIERONE_PIDFILE}"
+ eend $?
+}
diff --git a/net-misc/zerotier/files/zerotier.service b/net-misc/zerotier/files/zerotier.service
new file mode 100644
index 000000000000..c4a1c4d29979
--- /dev/null
+++ b/net-misc/zerotier/files/zerotier.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=ZeroTier One
+After=network.target
+
+[Service]
+ExecStart=/var/lib/zerotier-one/zerotier-one
+Restart=always
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/zerotier/metadata.xml b/net-misc/zerotier/metadata.xml
new file mode 100644
index 000000000000..af9de97a426e
--- /dev/null
+++ b/net-misc/zerotier/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>neil@digimed.co.uk</email>
+ <name>Neil Bothwick</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-misc/zerotier/zerotier-1.2.4.ebuild b/net-misc/zerotier/zerotier-1.2.4.ebuild
new file mode 100644
index 000000000000..9150c0a91052
--- /dev/null
+++ b/net-misc/zerotier/zerotier-1.2.4.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs systemd
+
+HOMEPAGE="https://www.zerotier.com/"
+DESCRIPTION="A software-based managed Ethernet switch for planet Earth"
+SRC_URI="https://github.com/zerotier/ZeroTierOne/archive/${PV}.tar.gz -> zerotier-${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+S="${WORKDIR}/ZeroTierOne-${PV}"
+
+RDEPEND="
+ net-libs/miniupnpc
+ net-libs/libnatpmp
+ dev-libs/json-glib
+ net-libs/http-parser"
+
+DEPEND="${RDEPEND}
+ >=sys-devel/gcc-4.9.3"
+
+QA_PRESTRIPPED="/usr/sbin/zerotier-one"
+
+DOCS=( README.md AUTHORS.md )
+
+src_compile() {
+ append-ldflags -Wl,-z,noexecstack
+ emake CXX="$(tc-getCXX)" one
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}/${PN}.init" "${PN}"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ doman "${S}/doc/zerotier-"{cli.1,idtool.1,one.8}
+}