Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #
  2. # Copyright (C) 2016-2019 Jason A. Donenfeld <[email protected]>
  3. # Copyright (C) 2016 Baptiste Jonglez <[email protected]>
  4. # Copyright (C) 2016-2017 Dan Luedtke <[email protected]>
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/kernel.mk
  10. PKG_NAME:=wireguard
  11. PKG_VERSION:=1.0.20201112
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=wireguard-linux-compat-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-linux-compat/snapshot/
  15. PKG_HASH:=89eae7f0c0bd6c8df3ba2e090984974ff68741a9f26aa0922890f8ca727897e1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/wireguard-linux-compat-$(PKG_VERSION)
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_USE_MIPS16:=0
  21. # WireGuard's makefile needs this to know where to build the kernel module
  22. export KERNELDIR:=$(LINUX_DIR)
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/wireguard/Default
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=VPN
  28. URL:=https://www.wireguard.com
  29. MAINTAINER:=Jason A. Donenfeld <[email protected]>
  30. endef
  31. define Package/wireguard/Default/description
  32. WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
  33. state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
  34. more useful than IPSec, while avoiding the massive headache. It intends to
  35. be considerably more performant than OpenVPN. WireGuard is designed as a
  36. general purpose VPN for running on embedded interfaces and super computers
  37. alike, fit for many different circumstances. It uses UDP.
  38. endef
  39. define Package/wireguard
  40. $(call Package/wireguard/Default)
  41. TITLE:=WireGuard meta-package
  42. DEPENDS:=+wireguard-tools +kmod-wireguard
  43. endef
  44. include $(INCLUDE_DIR)/kernel-defaults.mk
  45. include $(INCLUDE_DIR)/package-defaults.mk
  46. define Build/Compile
  47. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
  48. endef
  49. define Package/wireguard/install
  50. true
  51. endef
  52. define Package/wireguard/description
  53. $(call Package/wireguard/Default/description)
  54. endef
  55. define KernelPackage/wireguard
  56. SECTION:=kernel
  57. CATEGORY:=Kernel modules
  58. SUBMENU:=Network Support
  59. TITLE:=WireGuard kernel module
  60. DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4
  61. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  62. AUTOLOAD:=$(call AutoProbe,wireguard)
  63. endef
  64. define KernelPackage/wireguard/description
  65. $(call Package/wireguard/Default/description)
  66. This package provides the kernel module for WireGuard.
  67. endef
  68. $(eval $(call BuildPackage,wireguard))
  69. $(eval $(call KernelPackage,wireguard))