You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.5 KiB

  1. # SPDX-License-Identifier: GPL-3.0-only
  2. #
  3. # Copyright (C) 2021 ImmortalWrt.org
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=v2rayA
  6. PKG_VERSION:=1.5.8.1
  7. PKG_RELEASE:=$(AUTORELEASE)
  8. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  9. PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)?
  10. PKG_HASH:=822ec4a93933d93aed1bda6f9a3c08915135c0fc33bebe5e69b293cf30fe35c2
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/service
  12. PKG_LICENSE:=AGPL-3.0-only
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
  15. PKG_BUILD_DEPENDS:=golang/host
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_USE_MIPS16:=0
  18. GO_PKG:=github.com/v2rayA/v2rayA
  19. GO_PKG_LDFLAGS_X:=$(GO_PKG)/conf.Version=$(PKG_VERSION)
  20. include $(INCLUDE_DIR)/package.mk
  21. include ../../lang/golang/golang-package.mk
  22. TAR_OPTIONS+= --strip-components 1
  23. TAR_CMD=$(HOST_TAR) -C $(1)/.. $(TAR_OPTIONS)
  24. define Package/v2raya
  25. TITLE:=A Linux web GUI client of Project V
  26. SECTION:=net
  27. CATEGORY:=Network
  28. SUBMENU:=Web Servers/Proxies
  29. DEPENDS:=$(GO_ARCH_DEPENDS) \
  30. +ca-bundle \
  31. +iptables \
  32. +IPV6:ip6tables \
  33. +iptables-mod-conntrack-extra \
  34. +iptables-mod-extra \
  35. +iptables-mod-filter \
  36. +iptables-mod-tproxy \
  37. +kmod-ipt-nat6 \
  38. +xray-core
  39. URL:=https://v2raya.org
  40. endef
  41. define Package/v2raya/description
  42. v2rayA is a V2Ray Linux client supporting global transparent proxy,
  43. compatible with SS, SSR, Trojan(trojan-go), PingTunnel protocols.
  44. endef
  45. define Package/v2raya/conffiles
  46. /etc/v2raya/
  47. /etc/config/v2raya
  48. endef
  49. WEB_FILE:=$(PKG_NAME)-web-$(PKG_VERSION).tar.gz
  50. define Download/v2raya-web
  51. URL:=https://codeload.github.com/v2rayA/v2raya-web/tar.gz/v$(PKG_VERSION)?
  52. URL_FILE:=$(WEB_FILE)
  53. FILE:=$(WEB_FILE)
  54. HASH:=b13beac91d75c64af4ca6d7365716968702ce1be3f0c3e94d26e01daa07f223b
  55. endef
  56. define Build/Prepare
  57. $(call Build/Prepare/Default)
  58. ( \
  59. mkdir -p $(PKG_BUILD_DIR)/server/router/web ; \
  60. gzip -dc $(DL_DIR)/$(WEB_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/server/router/web $(TAR_OPTIONS) ; \
  61. )
  62. endef
  63. define Package/v2raya/install
  64. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  65. $(INSTALL_DIR) $(1)/usr/bin/
  66. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2rayA $(1)/usr/bin/v2raya
  67. $(INSTALL_DIR) $(1)/etc/config/
  68. $(INSTALL_CONF) $(CURDIR)/files/v2raya.config $(1)/etc/config/v2raya
  69. $(INSTALL_DIR) $(1)/etc/init.d/
  70. $(INSTALL_BIN) $(CURDIR)/files/v2raya.init $(1)/etc/init.d/v2raya
  71. endef
  72. $(eval $(call Download,v2raya-web))
  73. $(eval $(call GoBinPackage,v2raya))
  74. $(eval $(call BuildPackage,v2raya))