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.

112 lines
3.3 KiB

  1. #
  2. # Copyright (C) 2016-2017 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:=0.0.20170214
  12. PKG_RELEASE:=2
  13. PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
  15. PKG_HASH:=1e4ee213d2a5ac672c952c59e9c64d6d7d5dc3e21c003aee30d75208237e8bf5
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-$(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.io
  29. MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \
  30. Dan Luedtke <mail@danrl.com>, \
  31. Jason A. Donenfeld <Jason@zx2c4.com>
  32. endef
  33. define Package/wireguard/Default/description
  34. WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
  35. state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
  36. more useful than IPSec, while avoiding the massive headache. It intends to
  37. be considerably more performant than OpenVPN. WireGuard is designed as a
  38. general purpose VPN for running on embedded interfaces and super computers
  39. alike, fit for many different circumstances.
  40. It runs over UDP.
  41. endef
  42. define Package/wireguard
  43. $(call Package/wireguard/Default)
  44. TITLE:=Wireguard meta-package
  45. DEPENDS:=+wireguard-tools +kmod-wireguard
  46. endef
  47. include $(INCLUDE_DIR)/kernel-defaults.mk
  48. include $(INCLUDE_DIR)/package-defaults.mk
  49. # Used by Build/Compile/Default
  50. MAKE_PATH:=src/tools
  51. define Build/Compile
  52. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
  53. $(call Build/Compile/Default)
  54. endef
  55. define Package/wireguard/description
  56. $(call Package/wireguard/Default/description)
  57. endef
  58. define Package/wireguard-tools
  59. $(call Package/wireguard/Default)
  60. TITLE:=Wireguard userspace control program (wg)
  61. DEPENDS:=+libmnl
  62. endef
  63. define Package/wireguard-tools/description
  64. $(call Package/wireguard/Default/description)
  65. This package provides the userspace control program for wireguard, `wg`,
  66. and a netifd protocol helper.
  67. endef
  68. define Package/wireguard-tools/install
  69. $(INSTALL_DIR) $(1)/usr/bin/
  70. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
  71. $(INSTALL_DIR) $(1)/lib/netifd/proto/
  72. $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/
  73. endef
  74. define KernelPackage/wireguard
  75. SECTION:=kernel
  76. CATEGORY:=Kernel modules
  77. SUBMENU:=Network Support
  78. TITLE:=Wireguard kernel module
  79. DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 +kmod-ipt-hashlimit
  80. FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
  81. AUTOLOAD:=$(call AutoProbe,wireguard)
  82. endef
  83. define KernelPackage/wireguard/description
  84. $(call Package/wireguard/Default/description)
  85. This package provides the kernel module for wireguard.
  86. endef
  87. $(eval $(call BuildPackage,wireguard))
  88. $(eval $(call BuildPackage,wireguard-tools))
  89. $(eval $(call KernelPackage,wireguard))