commit:     97ee15648f49af75108356a4a8033b61de46ef58
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Thu May  4 22:49:38 2023 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Thu May  4 22:49:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97ee1564

www-apps/ttyd: new package, add 1.7.3, 9999

ttyd, a simple command-line tool for sharing
terminal over the web

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 www-apps/ttyd/Manifest           |  1 +
 www-apps/ttyd/files/ttyd.confd   | 29 +++++++++++++++++++++++++++
 www-apps/ttyd/files/ttyd.initd   | 14 ++++++++++++++
 www-apps/ttyd/files/ttyd.service | 10 ++++++++++
 www-apps/ttyd/metadata.xml       | 10 ++++++++++
 www-apps/ttyd/ttyd-1.7.3.ebuild  | 41 +++++++++++++++++++++++++++++++++++++++
 www-apps/ttyd/ttyd-9999.ebuild   | 42 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 147 insertions(+)

diff --git a/www-apps/ttyd/Manifest b/www-apps/ttyd/Manifest
new file mode 100644
index 000000000000..4039ce4e90bd
--- /dev/null
+++ b/www-apps/ttyd/Manifest
@@ -0,0 +1 @@
+DIST ttyd-1.7.3.tar.gz 579492 BLAKE2B 
14b66dbe83c0ccb601a6e3bf35a804f69f679387c9aca2f55a055dda85b2e3a396ddb4f9a3fb56575d0554837faf1d5c090cf66f4e7571201323659db3feb0b7
 SHA512 
e0900e2b4620095717d0f32206d08177ce74bc2f24cd9c20793cc2e370a8ee961272b73698b0dda857360703df20378c080293dfdfd287ae863801d338c8b2a4

diff --git a/www-apps/ttyd/files/ttyd.confd b/www-apps/ttyd/files/ttyd.confd
new file mode 100644
index 000000000000..57d24e3fb394
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.confd
@@ -0,0 +1,29 @@
+# conf.d file for ttyd 
+
+# Please check man 1 ttyd for more information about the options
+#
+# Some of the meaningful options are:
+#    -p, --port              Port to listen (default: 7681, use `0` for random 
port)
+#    -i, --interface         Network interface to bind (eg: eth0), or UNIX 
domain socket path (eg: /var/run/ttyd.sock)
+#    -c, --credential        Credential for Basic Authentication (format: 
username:password)
+#    -u, --uid               User id to run with
+#    -g, --gid               Group id to run with
+#    -s, --signal            Signal to send to the command when exit it 
(default: 1, SIGHUP)
+#    -r, --reconnect         Time to reconnect for the client in seconds 
(default: 10)
+#    -R, --readonly          Do not allow clients to write to the TTY
+#    -t, --client-option     Send option to client (format: key=value), repeat 
to add more options
+#    -T, --terminal-type     Terminal type to report, default: xterm-256color
+#    -O, --check-origin      Do not allow websocket connection from different 
origin
+#    -m, --max-clients       Maximum clients to support (default: 0, no limit)
+#    -o, --once              Accept only one client and exit on disconnection
+#    -B, --browser           Open terminal with the default system browser
+#    -I, --index             Custom index.html path
+#    -6, --ipv6              Enable IPv6 support
+#    -S, --ssl               Enable SSL
+#    -C, --ssl-cert          SSL certificate file path
+#    -K, --ssl-key           SSL key file path
+#    -A, --ssl-ca            SSL CA file path for client certificate 
verification
+#    -d, --debug             Set log level (default: 7)
+#   login        --- Login with system accounts 
+
+TTYD_OPTS="login"

diff --git a/www-apps/ttyd/files/ttyd.initd b/www-apps/ttyd/files/ttyd.initd
new file mode 100644
index 000000000000..9d1afdec19da
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+name="ttyd daemon"
+pidfile="/var/run/ttyd.pid"
+command="/usr/bin/ttyd"
+command_args="${TTYD_OPTS}"
+command_background="true"
+start_stop_daemon_args="-b"
+
+depend() {
+   use logger
+}

diff --git a/www-apps/ttyd/files/ttyd.service b/www-apps/ttyd/files/ttyd.service
new file mode 100644
index 000000000000..caa95ab1a910
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Terminal over HTTP
+
+[Service]
+User=root
+ExecStart=/usr/bin/ttyd -p 9000 login
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target

diff --git a/www-apps/ttyd/metadata.xml b/www-apps/ttyd/metadata.xml
new file mode 100644
index 000000000000..cbc3ff79c423
--- /dev/null
+++ b/www-apps/ttyd/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">tsl0922/ttyd</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/www-apps/ttyd/ttyd-1.7.3.ebuild b/www-apps/ttyd/ttyd-1.7.3.ebuild
new file mode 100644
index 000000000000..80b189a914d4
--- /dev/null
+++ b/www-apps/ttyd/ttyd-1.7.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake systemd
+
+MY_PV="$(ver_rs 3 '-')"
+
+DESCRIPTION="ttyd, a simple command-line tool for sharing terminal over the 
web"
+HOMEPAGE="https://github.com/tsl0922/ttyd";
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://github.com/tsl0922/ttyd.git";
+       inherit git-r3
+else
+       SRC_URI="https://github.com/tsl0922/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+BDEPEND="dev-util/cmake"
+
+DEPEND="
+       dev-libs/json-c:=
+       dev-libs/libuv:=
+       net-libs/libwebsockets:=[libuv,ssl]
+       sys-libs/zlib:=
+       "
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+       dobin ../${P}_build/${PN}
+       doman man/*.1
+       newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+       newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+       systemd_dounit "${FILESDIR}"/${PN}.service
+}

diff --git a/www-apps/ttyd/ttyd-9999.ebuild b/www-apps/ttyd/ttyd-9999.ebuild
new file mode 100644
index 000000000000..14c795388490
--- /dev/null
+++ b/www-apps/ttyd/ttyd-9999.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake systemd
+
+MY_PV="$(ver_rs 3 '-')"
+
+DESCRIPTION="ttyd, a simple command-line tool for sharing terminal over the 
web"
+HOMEPAGE="https://github.com/tsl0922/ttyd";
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://github.com/tsl0922/ttyd.git";
+       inherit git-r3
+else
+       SRC_URI="https://github.com/tsl0922/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+BDEPEND="dev-util/cmake"
+
+DEPEND="
+       dev-vcs/git:=
+       dev-libs/json-c:=
+       dev-libs/libuv:=
+       net-libs/libwebsockets:=[libuv,ssl]
+       sys-libs/zlib:=
+       "
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+       dobin ../${P}_build/${PN}
+       doman man/*.1
+       newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+       newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+       systemd_dounit "${FILESDIR}"/${PN}.service
+}

Reply via email to