commit:     7551f7c986453338f930f1ba87e2ab0c9de53a2a
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Fri Mar 31 21:28:10 2023 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Fri Mar 31 21:28:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7551f7c9

www-apps/ttyd: new package, add 1.7.3

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 www-apps/ttyd/Manifest           |  1 +
 www-apps/ttyd/files/ttyd.initd   | 13 +++++++++++++
 www-apps/ttyd/files/ttyd.service | 16 ++++++++++++++++
 www-apps/ttyd/metadata.xml       | 11 +++++++++++
 www-apps/ttyd/ttyd-1.7.3.ebuild  | 33 +++++++++++++++++++++++++++++++++
 5 files changed, 74 insertions(+)

diff --git a/www-apps/ttyd/Manifest b/www-apps/ttyd/Manifest
new file mode 100644
index 000000000..4039ce4e9
--- /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.initd b/www-apps/ttyd/files/ttyd.initd
new file mode 100644
index 000000000..cbd70989f
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.initd
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# shellcheck shell=sh
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/ttyd"
+command_args="${TTYD_OPTS:--i lo -p 7681 -O} login"
+command_background=1
+pidfile="/run/ttyd.pid"
+
+depend() {
+       use net
+}

diff --git a/www-apps/ttyd/files/ttyd.service b/www-apps/ttyd/files/ttyd.service
new file mode 100644
index 000000000..3e0f59808
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=ttyd daemon
+Documentation=man:ttyd(1)
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/ttyd -i lo -O login
+ExecReload=/usr/bin/kill -HUP $MAINPID
+KillMode=process
+LimitNOFILE=512
+LimitMEMLOCK=infinity
+LimitSTACK=infinity
+
+[Install]
+WantedBy=multi-user.target

diff --git a/www-apps/ttyd/metadata.xml b/www-apps/ttyd/metadata.xml
new file mode 100644
index 000000000..245b7381b
--- /dev/null
+++ b/www-apps/ttyd/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>cyber+gen...@sysrq.in</email>
+               <name>Anna</name>
+       </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 000000000..8190b5b30
--- /dev/null
+++ b/www-apps/ttyd/ttyd-1.7.3.ebuild
@@ -0,0 +1,33 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake systemd
+
+DESCRIPTION="Share your terminal over the web"
+HOMEPAGE="
+       https://tsl0922.github.io/ttyd
+       https://github.com/tsl0922/ttyd
+"
+SRC_URI="https://github.com/tsl0922/${PN}/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="
+       dev-libs/json-c:=
+       dev-libs/libuv:=
+       dev-libs/openssl:=
+       net-libs/libwebsockets:=[libuv,ssl]
+       sys-libs/zlib:=
+"
+RDEPEND="${DEPEND}"
+
+src_install() {
+       cmake_src_install
+
+       systemd_dounit "${FILESDIR}"/ttyd.service
+       newinitd "${FILESDIR}"/ttyd.initd ttyd
+}

Reply via email to