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.

130 lines
3.4 KiB

  1. #
  2. # Copyright (C) 2017-2020 Yousong Zhou <yszhou4tech@gmail.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. # Checklist when bumping versions
  9. #
  10. # - update cipher list by checking src/crypto.c:crypto_init()
  11. # - check if default mode has changed from being tcp_only
  12. #
  13. PKG_NAME:=shadowsocks-libev
  14. PKG_VERSION:=3.3.5
  15. PKG_RELEASE:=4
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  17. PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
  18. PKG_HASH:=cfc8eded35360f4b67e18dc447b0c00cddb29cc57a3cec48b135e5fb87433488
  19. PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
  20. PKG_LICENSE:=GPL-3.0-or-later
  21. PKG_LICENSE_FILES:=LICENSE
  22. PKG_FIXUP:=autoreconf
  23. PKG_INSTALL:=1
  24. PKG_USE_MIPS16:=0
  25. PKG_BUILD_PARALLEL:=1
  26. PKG_BUILD_DEPENDS:=c-ares pcre
  27. include $(INCLUDE_DIR)/package.mk
  28. define Package/shadowsocks-libev-config
  29. SECTION:=net
  30. CATEGORY:=Network
  31. SUBMENU:=Web Servers/Proxies
  32. TITLE:=shadowsocks-libev config scripts
  33. URL:=https://github.com/shadowsocks/shadowsocks-libev
  34. endef
  35. define Package/shadowsocks-libev-config/conffiles
  36. /etc/config/shadowsocks-libev
  37. endef
  38. define Package/shadowsocks-libev-config/install
  39. $(INSTALL_DIR) $(1)/etc/config
  40. $(INSTALL_DATA) ./files/shadowsocks-libev.config $(1)/etc/config/shadowsocks-libev
  41. $(INSTALL_DIR) $(1)/etc/init.d
  42. $(INSTALL_BIN) ./files/shadowsocks-libev.init $(1)/etc/init.d/shadowsocks-libev
  43. endef
  44. define Package/shadowsocks-libev/Default
  45. define Package/shadowsocks-libev-$(1)
  46. SECTION:=net
  47. CATEGORY:=Network
  48. SUBMENU:=Web Servers/Proxies
  49. TITLE:=shadowsocks-libev $(1)
  50. URL:=https://github.com/shadowsocks/shadowsocks-libev
  51. DEPENDS:=+libev +libmbedtls +libpthread +libsodium +shadowsocks-libev-config $(DEPENDS_$(1))
  52. endef
  53. define Package/shadowsocks-libev-$(1)/install
  54. $$(INSTALL_DIR) $$(1)/usr/bin
  55. $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin
  56. endef
  57. endef
  58. DEPENDS_ss-local = +libpcre
  59. DEPENDS_ss-server = +libcares +libpcre
  60. SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server
  61. define shadowsocks-libev/templates
  62. $(foreach component,$(SHADOWSOCKS_COMPONENTS),
  63. $(call Package/shadowsocks-libev/Default,$(component))
  64. )
  65. endef
  66. $(eval $(call shadowsocks-libev/templates))
  67. define Package/shadowsocks-libev-ss-rules
  68. SECTION:=net
  69. CATEGORY:=Network
  70. SUBMENU:=Web Servers/Proxies
  71. TITLE:=shadowsocks-libev ss-rules
  72. URL:=https://github.com/shadowsocks/shadowsocks-libev
  73. DEPENDS:=+firewall4 \
  74. +ip \
  75. +resolveip \
  76. +ucode \
  77. +ucode-mod-fs \
  78. +shadowsocks-libev-ss-redir \
  79. +shadowsocks-libev-config \
  80. +kmod-nft-tproxy
  81. endef
  82. define Package/shadowsocks-libev-ss-rules/install
  83. $(INSTALL_DIR) $(1)/usr/share/ss-rules
  84. $(INSTALL_DATA) ./files/ss-rules/* $(1)/usr/share/ss-rules/
  85. endef
  86. define Build/Prepare
  87. $(call Build/Prepare/Default)
  88. $(FIND) $(PKG_BUILD_DIR) \
  89. -name '*.o' \
  90. -o -name '*.lo' \
  91. -o -name '.deps' \
  92. -o -name '.libs' \
  93. | $(XARGS) rm -rvf
  94. endef
  95. CONFIGURE_ARGS += \
  96. --disable-documentation \
  97. --disable-silent-rules \
  98. --disable-assert \
  99. --disable-ssp \
  100. TARGET_CFLAGS += -flto
  101. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  102. $(eval $(call BuildPackage,shadowsocks-libev-config))
  103. $(eval $(call BuildPackage,shadowsocks-libev-ss-rules))
  104. $(foreach component,$(SHADOWSOCKS_COMPONENTS), \
  105. $(eval $(call BuildPackage,shadowsocks-libev-$(component))) \
  106. )