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