Merge pull request #4478 from valdi74/add_package_python-curl
[feed/packages.git] / net / wireguard / Makefile
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
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=wireguard
13
14 PKG_VERSION:=0.0.20170907
15 PKG_RELEASE:=1
16
17 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
18 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
19 PKG_HASH:=a1ee12d60662607e4c5a19f84b5115e56f083e2600053882e161537f12d963fd
20
21 PKG_LICENSE:=GPL-2.0
22 PKG_LICENSE_FILES:=COPYING
23
24 PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-$(PKG_VERSION)
25 PKG_BUILD_PARALLEL:=1
26 PKG_USE_MIPS16:=0
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 SUBMENU:=VPN
37 URL:=https://www.wireguard.io
38 MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \
39 Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> \
40 Dan Luedtke <mail@danrl.com>, \
41 Jason A. Donenfeld <Jason@zx2c4.com>
42 endef
43
44 define Package/wireguard/Default/description
45 WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
46 state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
47 more useful than IPSec, while avoiding the massive headache. It intends to
48 be considerably more performant than OpenVPN. WireGuard is designed as a
49 general purpose VPN for running on embedded interfaces and super computers
50 alike, fit for many different circumstances.
51 It runs over UDP.
52 endef
53
54 define Package/wireguard
55 $(call Package/wireguard/Default)
56 TITLE:=Wireguard meta-package
57 DEPENDS:=+wireguard-tools +kmod-wireguard
58 endef
59
60 include $(INCLUDE_DIR)/kernel-defaults.mk
61 include $(INCLUDE_DIR)/package-defaults.mk
62
63 # Used by Build/Compile/Default
64 MAKE_PATH:=src/tools
65
66 define Build/Compile
67 $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
68 $(call Build/Compile/Default)
69 endef
70
71 define Package/wireguard/install
72 true
73 endef
74
75 define Package/wireguard/description
76 $(call Package/wireguard/Default/description)
77 endef
78
79 define Package/wireguard-tools
80 $(call Package/wireguard/Default)
81 TITLE:=Wireguard userspace control program (wg)
82 DEPENDS:=+libmnl
83 endef
84
85 define Package/wireguard-tools/description
86 $(call Package/wireguard/Default/description)
87
88 This package provides the userspace control program for wireguard, `wg`,
89 and a netifd protocol helper.
90 endef
91
92 define Package/wireguard-tools/install
93 $(INSTALL_DIR) $(1)/usr/bin/
94 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
95 $(INSTALL_DIR) $(1)/lib/netifd/proto/
96 $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/
97 endef
98
99 define KernelPackage/wireguard
100 SECTION:=kernel
101 CATEGORY:=Kernel modules
102 SUBMENU:=Network Support
103 TITLE:=Wireguard kernel module
104 DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4
105 FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
106 AUTOLOAD:=$(call AutoProbe,wireguard)
107 endef
108
109 define KernelPackage/wireguard/description
110 $(call Package/wireguard/Default/description)
111
112 This package provides the kernel module for wireguard.
113 endef
114
115 $(eval $(call BuildPackage,wireguard))
116 $(eval $(call BuildPackage,wireguard-tools))
117 $(eval $(call KernelPackage,wireguard))