tmate: add new package
authorTianling Shen <cnsztl@immortalwrt.org>
Thu, 18 Mar 2021 05:12:13 +0000 (13:12 +0800)
committerPaul Spooren <mail@aparcar.org>
Fri, 19 Mar 2021 09:22:48 +0000 (23:22 -1000)
Tmate is a fork of tmux. It provides an instant pairing solution.
For more details, see https://tmate.io.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit ccfe1bfa508e7041c4b5f902f1354ef9566bff28)

net/tmate/Makefile [new file with mode: 0644]
net/tmate/patches/010-Avoid-initializing-stdout-twice.patch [new file with mode: 0644]
net/tmate/test.sh [new file with mode: 0644]

diff --git a/net/tmate/Makefile b/net/tmate/Makefile
new file mode 100644 (file)
index 0000000..b2d50f9
--- /dev/null
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: GPL-3.0-only
+#
+# Copyright (C) 2021 ImmortalWrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tmate
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/tmate-io/tmate/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=62b61eb12ab394012c861f6b48ba0bc04ac8765abca13bdde5a4d9105cb16138
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DEPENDS:=ncurses
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tmate
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=SSH
+  TITLE:=Instant Terminal Sharing
+  URL:=https://tmate.io
+  DEPENDS:=+libevent2 +libncurses +libpthread +libssh +msgpack-c +terminfo
+endef
+
+define Package/tmate/description
+  Tmate is a fork of tmux. It provides an instant pairing solution.
+endef
+
+CONFIGURE_ARGS+= \
+       --oldincludedir="$(STAGING_DIR)"
+
+CONFIGURE_VARS+= \
+       LIBSSH_CFLAGS="-I$(STAGING_DIR)/usr/include" \
+       LIBSSH_LIBS="-lssh"
+
+define Package/tmate/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tmate $(1)/usr/bin/tmate
+endef
+
+$(eval $(call BuildPackage,tmate))
diff --git a/net/tmate/patches/010-Avoid-initializing-stdout-twice.patch b/net/tmate/patches/010-Avoid-initializing-stdout-twice.patch
new file mode 100644 (file)
index 0000000..ca2d703
--- /dev/null
@@ -0,0 +1,22 @@
+From 9e3e39d66ddb4a610720fa37a5683c846d2a1ba6 Mon Sep 17 00:00:00 2001
+From: Nicolas Viennot <nicolas@viennot.biz>
+Date: Wed, 11 Mar 2020 11:30:33 -0400
+Subject: [PATCH] Avoid initializing stdout twice
+
+Closes #190
+---
+ log.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/log.c
++++ b/log.c
+@@ -61,6 +61,9 @@ log_get_level(void)
+ void
+ log_open_fp(FILE *f)
+ {
++      if (log_file == f)
++              return;
++
+       if (log_file != NULL && !is_log_stdout())
+               fclose(log_file);
diff --git a/net/tmate/test.sh b/net/tmate/test.sh
new file mode 100644 (file)
index 0000000..0f4a866
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+tmate -V | grep "$PKG_VERSION"