Advertisement
Guest User

obfs4

a guest
Jan 25th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. cat obfs4/Makefile
  2. #
  3. # Copyright (C) 2011-2019 Entware
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8.  
  9. include $(TOPDIR)/rules.mk
  10.  
  11. PKG_NAME:=obfs4
  12. PKG_VERSION:=0.0.12
  13. PKG_RELEASE:=1
  14. PKG_GOGET:=gitlab.com/yawning/obfs4
  15.  
  16. GOPKG_SOURCE=GO_$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.bz2
  17.  
  18. #!!! uncomment PKG_SOURCE to download fixed version
  19. #PKG_SOURCE=$(GOPKG_SOURCE)
  20. PKG_COMMIT=c357dd56dfa63add9eca7ed9d7de11c69c2a66f1
  21.  
  22. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  23.  
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/golang.mk
  26.  
  27. ifeq ($(BUILD_VARIANT),nohf)
  28. GOARM=GOARM=5
  29. endif
  30.  
  31. define Package/obfs4/Default
  32. $(call Package/gopackage/Default)
  33. TITLE:=A Tor pluggable transport proxy, implementing obfs4
  34. URL:=https://gitlab.com/yawning/obfs4
  35. endef
  36.  
  37. define Package/obfs4
  38. $(call Package/obfs4/Default)
  39. VARIANT:=hf
  40. DEPENDS:=+tor
  41. endef
  42.  
  43. define Package/obfs4_nohf
  44. $(call Package/obfs4/Default)
  45. VARIANT:=nohf
  46. DEPENDS:=@(TARGET_armv7_2_6||TARGET_armv7_3_2) +tor
  47. endef
  48.  
  49. define Package/obfs4/description
  50. obfs4proxy is a tool that attempts to circumvent censorship by
  51. transforming the Tor traffic between the client and the bridge. This way
  52. censors, who usually monitor traffic between the client and the bridge,
  53. will see innocent-looking transformed traffic instead of the actual Tor
  54. traffic.
  55.  
  56. obfs4proxy implements the obfsucation protocols obfs2, obfs3, and obfs4.
  57.  
  58. It is written in Go and is compliant with the Tor pluggable transports
  59. specification, and its modular architecture allows it to support
  60. multiple pluggable transports.
  61. endef
  62.  
  63. Package/obfs4_nohf/description=$(Package/obfs4/description)
  64.  
  65. define Build/Compile
  66. (\
  67. cd $(PKG_BUILD_DIR)/src/$(PKG_GOGET); \
  68. GOOS=linux GOARCH=$(GOARCH) $(GOARM) GOPATH=$$$$PATH:$(PKG_BUILD_DIR)/src/$(PKG_GOGET) $(GOROOT)/bin/go build -ldflags="-s -w" -x -v -o obfs4proxy/obfs4proxy ./obfs4proxy; \
  69. )
  70. endef
  71.  
  72. Package/obfs4_nohf/conffiles=$(Package/obfs4/conffiles)
  73.  
  74. define Package/obfs4/install
  75. $(INSTALL_DIR) $(1)/opt/sbin
  76. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_GOGET)/obfs4proxy/obfs4proxy $(1)/opt/sbin
  77. endef
  78.  
  79. Package/obfs4_nohf/install=$(Package/obfs4/install)
  80.  
  81. $(eval $(call BuildPackage,obfs4))
  82. $(eval $(call BuildPackage,obfs4_nohf))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement