commit:     f78d733cc6d1a1fc2d99be48781deafd5fd09854
Author:     Graeme Lawes <graemelawes <AT> gmail <DOT> com>
AuthorDate: Sat Mar 17 02:29:36 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 18 08:31:07 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f78d733c

sys-cluster/teleport: add v2.5.2

v2.5.0 introduced a new graceful restart capability, this commit
includes a new openrc init script (files/teleport-2.5.init.d) and
systemd service unit (teleport-2.5.service) to support this. Because
v2.4.x is not compatible with this feature, the old init script/service
files are preserved under the original names.

Closes: https://github.com/gentoo/gentoo/pull/7481

 sys-cluster/teleport/Manifest                   |  1 +
 sys-cluster/teleport/files/teleport-2.5.init.d  | 37 ++++++++++++++++
 sys-cluster/teleport/files/teleport-2.5.service | 13 ++++++
 sys-cluster/teleport/teleport-2.5.2.ebuild      | 57 +++++++++++++++++++++++++
 4 files changed, 108 insertions(+)

diff --git a/sys-cluster/teleport/Manifest b/sys-cluster/teleport/Manifest
index e28f189fd83..e34331f1db3 100644
--- a/sys-cluster/teleport/Manifest
+++ b/sys-cluster/teleport/Manifest
@@ -1,2 +1,3 @@
 DIST teleport-2.4.2.tar.gz 9975909 BLAKE2B 
68916e1d15f49448e918b39b2a760f90eca292b07f61e51cfe125eb99c6b36d95a528cfec40b62cd61893ce81edbf5f26066eb59063214369402e2a62d07bd5e
 SHA512 
f9c2f923e05c8fa0b82708955c944e1bd35da2e6bf8b673832e76c91b918a4bc6d6666797faf0f7572cfaa7341991ef8937cd9b374cdc273271aff45f96b2960
 DIST teleport-2.4.5.tar.gz 9975753 BLAKE2B 
cdb6e577cd565cf6760d73c92cac674571e9b1257d23b280bd96428cca4e7c593738a925d3632a80fed3e0868c5f3aac79800db19bbf2a2b92d495600bf014cc
 SHA512 
15e7e3c52c058625eb525c7c9cda00186eba037edbed89d21fb090b87c05570a1636f328260d4c7445253b0f5b81f321ce0da7d2b7fc316a0a9938ed22cc6c9c
+DIST teleport-2.5.2.tar.gz 16211219 BLAKE2B 
28d0d1bb8d01fba39e79a262744b69a9df27438b9dbb0a25cd23acd57b6004a7f2309e432c0db4188c2e023a0b0299fd64723acfd57c1328d2345bba08fff4a9
 SHA512 
58fad4015824b9077bbd13cc3c6a994e5a54ed367264477854da7b129eea04c4cba44a580650a259b01f390a9f2028d7501df2ac4ab4821d085bbfe1cd887ec5

diff --git a/sys-cluster/teleport/files/teleport-2.5.init.d 
b/sys-cluster/teleport/files/teleport-2.5.init.d
new file mode 100644
index 00000000000..a951ec5318a
--- /dev/null
+++ b/sys-cluster/teleport/files/teleport-2.5.init.d
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${TELEPORT_CONFDIR:=/etc/teleport}
+: ${TELEPORT_PIDFILE:=/var/run/${SVCNAME}.pid}
+: ${TELEPORT_BINARY:=/usr/bin/teleport}
+: ${TELEPORT_LOGFILE:=/var/log/teleport.log}
+
+depend() {
+       need net
+}
+
+start() {
+       ebegin "Starting Teleport SSH Service"
+               start-stop-daemon --start --exec /usr/bin/teleport \
+               --background --make-pidfile --pidfile "${TELEPORT_PIDFILE}" \
+               --stderr "${TELEPORT_LOGFILE}" \
+               -- start --config="${TELEPORT_CONFDIR}/teleport.yaml" \
+               ${TELEPORT_OPTS}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping Teleport SSH Service"
+               start-stop-daemon --stop --exec /usr/bin/teleport \
+               --pidfile "${TELEPORT_PIDFILE}"
+       eend $?
+}
+
+reload() {
+       checkconfig || return 1
+       ebegin "Reloading ${SVCNAME}"
+       start-stop-daemon --signal HUP \
+           --exec "${TELEPORT_BINARY}" --pidfile "${TELEPORT_PIDFILE}"
+       eend $?
+}

diff --git a/sys-cluster/teleport/files/teleport-2.5.service 
b/sys-cluster/teleport/files/teleport-2.5.service
new file mode 100644
index 00000000000..37b38210aff
--- /dev/null
+++ b/sys-cluster/teleport/files/teleport-2.5.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Teleport SSH Service
+After=network.target
+
+[Service]
+Type=simple
+Restart=on-failure
+ExecStart=/usr/bin/teleport start --config=/etc/teleport/teleport.yaml 
--pid-file=/var/run/teleport.pid
+ExecReload=/bin/kill -HUP $MAINPID
+PIDFile=/var/run/teleport.pid
+
+[Install]
+WantedBy=multi-user.target

diff --git a/sys-cluster/teleport/teleport-2.5.2.ebuild 
b/sys-cluster/teleport/teleport-2.5.2.ebuild
new file mode 100644
index 00000000000..4b4aeb53e58
--- /dev/null
+++ b/sys-cluster/teleport/teleport-2.5.2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils golang-build systemd user
+
+DESCRIPTION="Modern SSH server for teams managing distributed infrastructure"
+HOMEPAGE="https://gravitational.com/teleport";
+
+EGO_PN="github.com/gravitational/${PN}/..."
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3 golang-vcs
+       EGIT_REPO_URI="https://github.com/gravitational/${PN}.git";
+else
+       inherit golang-vcs-snapshot
+       SRC_URI="https://github.com/gravitational/${PN}/archive/v${PV}.tar.gz 
-> ${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm"
+fi
+
+IUSE=""
+LICENSE="Apache-2.0"
+RESTRICT="test strip"
+SLOT="0"
+
+DEPEND="
+       app-arch/zip
+       >=dev-lang/go-1.9.2"
+RDEPEND=""
+
+src_prepare() {
+       default
+
+       sed -i -e 's/-j 3/-j 1/g' src/${EGO_PN%/*}/Makefile
+}
+
+src_compile() {
+       GOPATH="${S}" emake -j1 -C src/${EGO_PN%/*} full
+}
+
+src_install() {
+       keepdir /var/lib/${PN} /etc/${PN}
+       dobin src/${EGO_PN%/*}/build/{tsh,tctl,teleport}
+
+       insinto /etc/${PN}
+       doins "${FILESDIR}"/${PN}.yaml
+
+       newinitd "${FILESDIR}"/${PN}-2.5.init.d ${PN}
+       newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
+
+       systemd_newunit "${FILESDIR}"/${PN}-2.5.service ${PN}.service
+       systemd_install_serviced "${FILESDIR}"/${PN}.service.conf ${PN}.service
+}
+
+src_test() {
+       BUILDFLAGS="" GOPATH="${S}" emake -C src/${EGO_PN%/*} test
+}

Reply via email to