42f8e6e6ef30f5ed5c8c051da739ea38502dd83c
[feed/packages.git] / net / wireguard / Makefile
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
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/kernel.mk
9
10 PKG_NAME:=wireguard
11
12 PKG_VERSION:=0.0.20161001
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=WireGuard-experimental-$(PKG_VERSION).tar.xz
16 # This is actually SHA256, but OpenWRT/LEDE will figure it out based on the length
17 PKG_MD5SUM:=ac3abb7b940716ac12b96a2cb3f7666598cbefd26f19c268f627dc47cd113ac8
18 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
19 PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-experimental-$(PKG_VERSION)
20
21 PKG_LICENSE:=GPL-2.0
22 PKG_LICENSE_FILES:=COPYING
23
24 PKG_USE_MIPS16:=0
25 PKG_BUILD_PARALLEL:=1
26
27 # Wireguard's makefile needs this to know where to build the kernel module
28 export KERNELDIR:=$(LINUX_DIR)
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/wireguard/Default
33 SECTION:=net
34 CATEGORY:=Network
35 URL:=https://www.wireguard.io
36 MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>
37 endef
38
39 define Package/wireguard/Default/description
40 WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
41 state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
42 more useful than IPSec, while avoiding the massive headache. It intends to
43 be considerably more performant than OpenVPN. WireGuard is designed as a
44 general purpose VPN for running on embedded interfaces and super computers
45 alike, fit for many different circumstances.
46 It runs over UDP.
47 endef
48
49 define Package/wireguard
50 $(call Package/wireguard/Default)
51 TITLE:=Wireguard meta-package
52 DEPENDS:=+wireguard-tools +kmod-wireguard
53 endef
54
55 include $(INCLUDE_DIR)/kernel-defaults.mk
56 include $(INCLUDE_DIR)/package-defaults.mk
57
58 # Used by Build/Compile/Default
59 MAKE_PATH:=src/tools
60
61 define Build/Compile
62 $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
63 $(call Build/Compile/Default)
64 endef
65
66 define Package/wireguard/description
67 $(call Package/wireguard/Default/description)
68 endef
69
70 define Package/wireguard-tools
71 $(call Package/wireguard/Default)
72 TITLE:=Wireguard userspace control program (wg)
73 DEPENDS:=+libmnl
74 endef
75
76 define Package/wireguard-tools/description
77 $(call Package/wireguard/Default/description)
78
79 This package provides the userspace control program for wireguard: `wg`.
80 endef
81
82 define Package/wireguard-tools/install
83 $(INSTALL_DIR) $(1)/usr/bin/
84 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
85 endef
86
87 define KernelPackage/wireguard
88 SECTION:=kernel
89 CATEGORY:=Kernel modules
90 SUBMENU:=Network Support
91 TITLE:=Wireguard kernel module
92 DEPENDS:=@IPV6 +kmod-udptunnel4 +kmod-udptunnel6 +kmod-ipt-hashlimit
93 FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
94 AUTOLOAD:=$(call AutoLoad,33,wireguard)
95 endef
96
97 define KernelPackage/wireguard/description
98 $(call Package/wireguard/Default/description)
99
100 This package provides the kernel module for wireguard.
101 endef
102
103 $(eval $(call BuildPackage,wireguard))
104 $(eval $(call BuildPackage,wireguard-tools))
105 $(eval $(call KernelPackage,wireguard))