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.

70 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=frp
  3. PKG_VERSION:=0.42.0
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v${PKG_VERSION}?
  7. PKG_HASH:=4bb815e9c9a4588fce20c6ef33168f0ceb1f420937c4dcf03ce085666328043a
  8. PKG_MAINTAINER:=Richard Yu <yurichard3839@gmail.com>
  9. PKG_LICENSE:=Apache-2.0
  10. PKG_LICENSE_FILES:=LICENSE
  11. PKG_BUILD_DEPENDS:=golang/host
  12. PKG_BUILD_PARALLEL:=1
  13. PKG_USE_MIPS16:=0
  14. GO_PKG:=github.com/fatedier/frp
  15. GO_PKG_BUILD_PKG:=github.com/fatedier/frp/cmd/...
  16. include $(INCLUDE_DIR)/package.mk
  17. include ../../lang/golang/golang-package.mk
  18. define Package/frp/install
  19. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  20. $(INSTALL_DIR) $(1)/usr/bin/
  21. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/
  22. $(INSTALL_DIR) $(1)/etc/frp/$(2).d/
  23. $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/$(2)_full.ini $(1)/etc/frp/$(2).d/
  24. $(INSTALL_DIR) $(1)/etc/config/
  25. $(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2)
  26. $(INSTALL_DIR) $(1)/etc/init.d/
  27. $(INSTALL_BIN) ./files/$(2).init $(1)/etc/init.d/$(2)
  28. if [ -r ./files/$(2).uci-defaults ]; then \
  29. $(INSTALL_DIR) $(1)/etc/uci-defaults; \
  30. $(INSTALL_DATA) ./files/$(2).uci-defaults $(1)/etc/uci-defaults/$(2); \
  31. fi
  32. endef
  33. define Package/frp/template
  34. define Package/$(1)
  35. SECTION:=net
  36. CATEGORY:=Network
  37. SUBMENU:=Web Servers/Proxies
  38. TITLE:=$(1) - fast reverse proxy $(2)
  39. URL:=https://github.com/fatedier/frp
  40. DEPENDS:=$(GO_ARCH_DEPENDS)
  41. endef
  42. define Package/$(1)/description
  43. $(1) is a fast reverse proxy $(2) to help you expose a local server behind
  44. a NAT or firewall to the internet.
  45. endef
  46. define Package/$(1)/conffiles
  47. /etc/config/$(1)
  48. endef
  49. define Package/$(1)/install
  50. $(call Package/frp/install,$$(1),$(1))
  51. endef
  52. endef
  53. $(eval $(call Package/frp/template,frpc,client))
  54. $(eval $(call Package/frp/template,frps,server))
  55. $(eval $(call BuildPackage,frpc))
  56. $(eval $(call BuildPackage,frps))