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.

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