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.

108 lines
3.2 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.20161129
  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:=7bdce3e56aaae91b195b8bbf7afc8d07f68632c997aa702c1ab84745c099d1b7
  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_DIR) $(1)/lib/netifd/proto/
  68. $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/
  69. endef
  70. define KernelPackage/wireguard
  71. SECTION:=kernel
  72. CATEGORY:=Kernel modules
  73. SUBMENU:=Network Support
  74. TITLE:=Wireguard kernel module
  75. DEPENDS:=@IPV6 +kmod-udptunnel4 +kmod-udptunnel6 +kmod-ipt-hashlimit
  76. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  77. AUTOLOAD:=$(call AutoLoad,33,wireguard)
  78. endef
  79. define KernelPackage/wireguard/description
  80. $(call Package/wireguard/Default/description)
  81. This package provides the kernel module for wireguard.
  82. endef
  83. $(eval $(call BuildPackage,wireguard))
  84. $(eval $(call BuildPackage,wireguard-tools))
  85. $(eval $(call KernelPackage,wireguard))