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.

107 lines
3.1 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.20161110
  10. PKG_RELEASE:=2
  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:=205478709127c4797b5aa9d6448fae03c10b083404414444bad33e62a609e48f
  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 +resolveip
  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. and a netifd protocol helper.
  63. endef
  64. define Package/wireguard-tools/install
  65. $(INSTALL_DIR) $(1)/usr/bin/
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
  67. $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/
  68. endef
  69. define KernelPackage/wireguard
  70. SECTION:=kernel
  71. CATEGORY:=Kernel modules
  72. SUBMENU:=Network Support
  73. TITLE:=Wireguard kernel module
  74. DEPENDS:=@IPV6 +kmod-udptunnel4 +kmod-udptunnel6 +kmod-ipt-hashlimit
  75. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  76. AUTOLOAD:=$(call AutoLoad,33,wireguard)
  77. endef
  78. define KernelPackage/wireguard/description
  79. $(call Package/wireguard/Default/description)
  80. This package provides the kernel module for wireguard.
  81. endef
  82. $(eval $(call BuildPackage,wireguard))
  83. $(eval $(call BuildPackage,wireguard-tools))
  84. $(eval $(call KernelPackage,wireguard))