net-misc/zerotier: new ebuild.
authorPatrice Clement <monsieurp@gentoo.org>
Thu, 6 Jul 2017 21:59:43 +0000 (23:59 +0200)
committerPatrice Clement <monsieurp@gentoo.org>
Thu, 6 Jul 2017 22:08:47 +0000 (00:08 +0200)
zerotier-one is a smart Ethernet switch for Earth.

Gentoo-Bug: https://bugs.gentoo.org/588324

Package-Manager: Portage-2.3.5, Repoman-2.3.1

net-misc/zerotier/Manifest [new file with mode: 0644]
net-misc/zerotier/files/zerotier.init [new file with mode: 0644]
net-misc/zerotier/files/zerotier.service [new file with mode: 0644]
net-misc/zerotier/metadata.xml [new file with mode: 0644]
net-misc/zerotier/zerotier-1.2.4.ebuild [new file with mode: 0644]

diff --git a/net-misc/zerotier/Manifest b/net-misc/zerotier/Manifest
new file mode 100644 (file)
index 0000000..8dfd240
--- /dev/null
@@ -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 (file)
index 0000000..7d22655
--- /dev/null
@@ -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 (file)
index 0000000..c4a1c4d
--- /dev/null
@@ -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 (file)
index 0000000..af9de97
--- /dev/null
@@ -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 (file)
index 0000000..9150c0a
--- /dev/null
@@ -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}
+}