]> prime8.dev >> repos - ttyd.git/commitdiff
[ci skip] openwrt: bump to 1.0.0
authorShuanglei Tao <tsl0922@gmail.com>
Tue, 27 Sep 2016 16:46:21 +0000 (00:46 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Wed, 28 Sep 2016 00:44:04 +0000 (08:44 +0800)
openwrt/Makefile
openwrt/files/ttyd.init [new file with mode: 0644]

index 40761886c2f275517a411720f69ec1cdb1023e05..7bf743e11986921988ff6bbba7615c2301277fe3 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2016 Shuanglei Tao <tsl0922@gmail.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,17 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ttyd
-PKG_VERSION:=master
+PKG_VERSION:=1.0.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/tsl0922/ttyd.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
-
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
 
@@ -30,19 +28,23 @@ include $(INCLUDE_DIR)/cmake.mk
 define Package/ttyd
        SECTION:=utils
        CATEGORY:=Utilities
-       TITLE:=A command line tool for sharing terminal over the web
+       TITLE:=Command-line tool for sharing terminal over the web
        DEPENDS:=+openssl +libjson-c +libpthread +libwebsockets-openssl
        URL:=https://github.com/tsl0922/ttyd
+       SUBMENU:=Terminal
        MAINTAINER:=Shuanglei Tao <tsl0922@gmail.com>
 endef
 
 define Package/ttyd/description
-ttyd is a simple command line tool for sharing terminal over the web.
+ttyd is a command-line tool for sharing terminal over the web.
 endef
 
 define Package/ttyd/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ttyd $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/ttyd.init $(1)/etc/init.d/ttyd
 endef
 
-$(eval $(call BuildPackage,ttyd))
\ No newline at end of file
+$(eval $(call BuildPackage,ttyd))
diff --git a/openwrt/files/ttyd.init b/openwrt/files/ttyd.init
new file mode 100644 (file)
index 0000000..d8d6d10
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+SERVICE_WRITE_PID=1
+SERVICE_DAEMONIZE=1
+
+start() {
+       logger -t TTYD 'Starting ttyd service'
+       service_start /usr/bin/ttyd login
+       return 0
+}
+
+stop() {
+       if [ -n "`pidof ttyd`" ]; then
+               logger -t TTYD 'Shutting down ttyd service'
+               service_stop /usr/bin/ttyd
+       fi
+       return 0
+}
+
+restart() {
+       logger -t TTYD 'Restarting ttyd service'
+       stop
+       sleep 2 # give time to shutdown
+       start
+}