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.

105 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. include $(INCLUDE_DIR)/kernel.mk
  8. PKG_NAME:=wireguard
  9. PKG_VERSION:=0.0.20160722
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=WireGuard-experimental-$(PKG_VERSION).tar.xz
  12. # This is actually SHA256, but OpenWRT/LEDE will figure it out based on the length
  13. PKG_MD5SUM:=0dcda97b6bb4e962f731a863df9b4291c1c453b01f4faba78be4aaa13a594242
  14. PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-experimental-$(PKG_VERSION)
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_USE_MIPS16:=0
  19. PKG_BUILD_PARALLEL:=1
  20. # Wireguard's makefile needs this to know where to build the kernel module
  21. export KERNELDIR:=$(LINUX_DIR)
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/wireguard/Default
  24. SECTION:=net
  25. CATEGORY:=Network
  26. URL:=https://www.wireguard.io
  27. MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>
  28. endef
  29. define Package/wireguard/Default/description
  30. WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
  31. state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
  32. more useful than IPSec, while avoiding the massive headache. It intends to
  33. be considerably more performant than OpenVPN. WireGuard is designed as a
  34. general purpose VPN for running on embedded interfaces and super computers
  35. alike, fit for many different circumstances.
  36. It runs over UDP.
  37. endef
  38. define Package/wireguard
  39. $(call Package/wireguard/Default)
  40. TITLE:=Wireguard meta-package
  41. DEPENDS:=+wireguard-tools +kmod-wireguard
  42. endef
  43. include $(INCLUDE_DIR)/kernel-defaults.mk
  44. include $(INCLUDE_DIR)/package-defaults.mk
  45. # Used by Build/Compile/Default
  46. MAKE_PATH:=src/tools
  47. define Build/Compile
  48. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
  49. $(call Build/Compile/Default)
  50. endef
  51. define Package/wireguard/description
  52. $(call Package/wireguard/Default/description)
  53. endef
  54. define Package/wireguard-tools
  55. $(call Package/wireguard/Default)
  56. TITLE:=Wireguard userspace control program (wg)
  57. DEPENDS:=+libmnl
  58. endef
  59. define Package/wireguard-tools/description
  60. $(call Package/wireguard/Default/description)
  61. This package provides the userspace control program for wireguard: `wg`.
  62. endef
  63. define Package/wireguard-tools/install
  64. $(INSTALL_DIR) $(1)/usr/bin/
  65. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
  66. endef
  67. define KernelPackage/wireguard
  68. SECTION:=kernel
  69. CATEGORY:=Kernel modules
  70. SUBMENU:=Network Support
  71. TITLE:=Wireguard kernel module
  72. DEPENDS:=@IPV6 +kmod-udptunnel4 +kmod-udptunnel6 +kmod-ipt-hashlimit
  73. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  74. AUTOLOAD:=$(call AutoLoad,33,wireguard)
  75. endef
  76. define KernelPackage/wireguard/description
  77. $(call Package/wireguard/Default/description)
  78. This package provides the kernel module for wireguard.
  79. endef
  80. $(eval $(call BuildPackage,wireguard))
  81. $(eval $(call BuildPackage,wireguard-tools))
  82. $(eval $(call KernelPackage,wireguard))