hev-socks5-server: add new package
HevSocks5Server is a high-performance socks5 server for Unix.
More details: https://github.com/heiher/hev-socks5-server
Signed-off-by: Ray Wang <r@hev.cc>
(cherry picked from commit 8d36908aea
)
This commit is contained in:
parent
30a9623c40
commit
baf80469d0
|
@ -0,0 +1,49 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hev-socks5-server
|
||||
PKG_VERSION:=2.6.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/heiher/hev-socks5-server/releases/download/$(PKG_VERSION)
|
||||
PKG_HASH:=07d3297483cc624464eec424f7dd27f2028f4f56c70c2c9d0b6902e181a32ccb
|
||||
|
||||
PKG_MAINTAINER:=Ray Wang <r@hev.cc>
|
||||
PKG_LICENSE:=GPL-3.0-only
|
||||
PKG_LICENSE_FILES:=License
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/hev-socks5-server
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A high-performance socks5 server for Unix
|
||||
URL:=https://github.com/heiher/hev-socks5-server
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += REV_ID="$(PKG_VERSION)"
|
||||
|
||||
define Package/hev-socks5-server/conffiles
|
||||
/etc/config/hev-socks5-server
|
||||
/etc/hev-socks5-server/
|
||||
endef
|
||||
|
||||
define Package/hev-socks5-server/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/hev-socks5-server $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/hev-socks5-server/
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/main.yml $(1)/etc/hev-socks5-server/main.yml
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/auth.txt $(1)/etc/hev-socks5-server/auth.txt
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_CONF) ./files/hev-socks5-server.config $(1)/etc/config/hev-socks5-server
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/hev-socks5-server.init $(1)/etc/init.d/hev-socks5-server
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,hev-socks5-server))
|
|
@ -0,0 +1,3 @@
|
|||
config hev-socks5-server 'config'
|
||||
option enabled '0'
|
||||
option conffile '/etc/hev-socks5-server/main.yml'
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=99
|
||||
|
||||
CONF="hev-socks5-server"
|
||||
PROG="/usr/bin/hev-socks5-server"
|
||||
|
||||
start_service() {
|
||||
config_load "$CONF"
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled "config" "enabled" "0"
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
|
||||
local conffile
|
||||
config_get conffile "config" "conffile"
|
||||
|
||||
procd_open_instance "$CONF"
|
||||
procd_set_param command "$PROG" "$conffile"
|
||||
procd_set_param file "$conffile"
|
||||
|
||||
procd_set_param limits core="unlimited"
|
||||
procd_set_param limits nofile="1000000 1000000"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$CONF"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
"$1" 2>&1 | grep "$2"
|
Loading…
Reference in New Issue