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.9 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  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. PKG_NAME:=shadowsocks-libev
  9. PKG_VERSION:=2.2.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
  14. PKG_SOURCE_VERSION:=4883903e657095b93f88a3a3b9a0dccdffdaa397
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
  17. PKG_LICENSE:=GPLv2
  18. PKG_LICENSE_FILES:=LICENSE
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
  20. PKG_INSTALL:=1
  21. PKG_FIXUP:=autoreconf
  22. PKG_USE_MIPS16:=0
  23. PKG_BUILD_PARALLEL:=1
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/shadowsocks-libev/Default
  26. SECTION:=net
  27. CATEGORY:=Network
  28. TITLE:=Lightweight Secured Socks5 Proxy $(2)
  29. URL:=https://github.com/shadowsocks/shadowsocks-libev
  30. VARIANT:=$(1)
  31. DEPENDS:=$(3) +resolveip +ipset +ip +iptables-mod-tproxy
  32. endef
  33. Package/shadowsocks-libev = $(call Package/shadowsocks-libev/Default,openssl,(OpenSSL),+libopenssl)
  34. Package/shadowsocks-libev-polarssl = $(call Package/shadowsocks-libev/Default,polarssl,(PolarSSL),+libpolarssl)
  35. define Package/shadowsocks-libev/description
  36. Shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes.
  37. endef
  38. Package/shadowsocks-libev-polarssl/description = $(Package/shadowsocks-libev/description)
  39. define Package/shadowsocks-libev/conffiles
  40. /etc/config/shadowsocks-libev
  41. endef
  42. Package/shadowsocks-libev-polarssl/conffiles = $(Package/shadowsocks-libev/conffiles)
  43. define Package/shadowsocks-libev/postinst
  44. #!/bin/sh
  45. uci -q batch <<-EOF >/dev/null
  46. delete firewall.shadowsocks_libev
  47. set firewall.shadowsocks_libev=include
  48. set firewall.shadowsocks_libev.type=script
  49. set firewall.shadowsocks_libev.path=/usr/share/shadowsocks-libev/firewall.include
  50. set firewall.shadowsocks_libev.reload=1
  51. commit firewall
  52. EOF
  53. exit 0
  54. endef
  55. Package/shadowsocks-libev-polarssl/postinst = $(Package/shadowsocks-libev/postinst)
  56. ifeq ($(BUILD_VARIANT),polarssl)
  57. CONFIGURE_ARGS += --with-crypto-library=polarssl
  58. endif
  59. define Package/shadowsocks-libev/install
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-{redir,tunnel} $(1)/usr/bin
  62. $(INSTALL_BIN) ./files/ss-rules $(1)/usr/bin
  63. $(INSTALL_DIR) $(1)/etc/config
  64. $(INSTALL_DATA) ./files/shadowsocks-libev.config $(1)/etc/config/shadowsocks-libev
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) ./files/shadowsocks-libev.init $(1)/etc/init.d/shadowsocks-libev
  67. $(INSTALL_DIR) $(1)/usr/share/shadowsocks-libev
  68. $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/shadowsocks-libev/firewall.include
  69. endef
  70. Package/shadowsocks-libev-polarssl/install = $(Package/shadowsocks-libev/install)
  71. $(eval $(call BuildPackage,shadowsocks-libev))
  72. $(eval $(call BuildPackage,shadowsocks-libev-polarssl))