Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # Copyright (c) 2017 Yu Wang <[email protected]>
  3. #
  4. # This is free software, licensed under the MIT.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=udp2raw-tunnel
  9. PKG_VERSION:=20181113.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/wangyu-/udp2raw-tunnel.git
  13. PKG_SOURCE_VERSION:=238e85a5e4eed315c6cc99301e737fd8d8d68e0e
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_MAINTAINER:=wangyu-
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/udp2raw-tunnel
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=Tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic
  26. URL:=https://github.com/wangyu-/udp2raw-tunnel
  27. DEPENDS:= +libstdcpp +libpthread +librt
  28. endef
  29. define Package/udp2raw-tunnel/description
  30. udp2raw-tunnel is a tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic by using Raw Socket.
  31. endef
  32. MAKE_FLAGS += cross
  33. define Build/Prepare
  34. $(PKG_UNPACK)
  35. sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
  36. sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
  37. echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
  38. $(Build/Patch)
  39. endef
  40. define Package/udp2raw-tunnel/install
  41. $(INSTALL_DIR) $(1)/usr/bin
  42. $(INSTALL_BIN) $(PKG_BUILD_DIR)/udp2raw_cross $(1)/usr/bin/udp2raw
  43. endef
  44. $(eval $(call BuildPackage,udp2raw-tunnel))