Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # Copyright (C) 2016-2019 Jason A. Donenfeld <Jason@zx2c4.com>
  3. # Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org>
  4. # Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com>
  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.20220627
  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:=362d412693c8fe82de00283435818d5c5def7f15e2433a07a9fe99d0518f63c0
  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 <Jason@zx2c4.com> \
  30. Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
  31. endef
  32. define Package/wireguard/Default/description
  33. WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
  34. state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
  35. more useful than IPSec, while avoiding the massive headache. It intends to
  36. be considerably more performant than OpenVPN. WireGuard is designed as a
  37. general purpose VPN for running on embedded interfaces and super computers
  38. alike, fit for many different circumstances. It uses UDP.
  39. endef
  40. define Package/wireguard
  41. $(call Package/wireguard/Default)
  42. TITLE:=WireGuard meta-package
  43. DEPENDS:=+wireguard-tools +kmod-wireguard
  44. endef
  45. include $(INCLUDE_DIR)/kernel-defaults.mk
  46. include $(INCLUDE_DIR)/package-defaults.mk
  47. define Build/Compile
  48. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
  49. endef
  50. define Package/wireguard/install
  51. true
  52. endef
  53. define Package/wireguard/description
  54. $(call Package/wireguard/Default/description)
  55. endef
  56. define KernelPackage/wireguard
  57. SECTION:=kernel
  58. CATEGORY:=Kernel modules
  59. SUBMENU:=Network Support
  60. TITLE:=WireGuard kernel module
  61. DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4
  62. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  63. AUTOLOAD:=$(call AutoProbe,wireguard)
  64. endef
  65. define KernelPackage/wireguard/description
  66. $(call Package/wireguard/Default/description)
  67. This package provides the kernel module for WireGuard.
  68. endef
  69. $(eval $(call BuildPackage,wireguard))
  70. $(eval $(call KernelPackage,wireguard))