wireguard: add new package
authorAurélien Chabot <aurelien@chabot.fr>
Wed, 6 Sep 2017 20:30:06 +0000 (21:30 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 2 Oct 2017 20:59:26 +0000 (22:59 +0200)
[Peter: Fix help text, drop suboptions, drop patches, fix dependencies,
 handle optional bash dependency, use kernel-module infrastructure,
 enable needed kernel options]
Signed-off-by: Aurélien Chabot <aurelien@chabot.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
linux/linux.mk
package/Config.in
package/wireguard/Config.in [new file with mode: 0644]
package/wireguard/wireguard.hash [new file with mode: 0644]
package/wireguard/wireguard.mk [new file with mode: 0644]

index c7bf83a66a2e01c9164ce235e4b464ec8024f257..9c2aa77a1064acdeb68fb62fb1535ba4012d293c 100644 (file)
@@ -300,6 +300,12 @@ define LINUX_KCONFIG_FIXUP_CMDS
                $(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_ADVANCED,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK_MARK,$(@D)/.config))
+       $(if $(BR2_PACKAGE_WIREGUARD),
+               $(call KCONFIG_ENABLE_OPT,CONFIG_INET,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_NET,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_NET_FOU,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_MANAGER,$(@D)/.config))
        $(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
                $(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
        $(if $(BR2_PACKAGE_KERNEL_MODULE_IMX_GPU_VIV),
index 0dfe086eadc9e1a5ea7e46e93e2278b29ceefe91..23818788e3a7411867a2f6e678ec580b34380b56 100644 (file)
@@ -1794,6 +1794,7 @@ endif
        source "package/wavemon/Config.in"
        source "package/wget/Config.in"
        source "package/whois/Config.in"
+       source "package/wireguard/Config.in"
        source "package/wireless-regdb/Config.in"
        source "package/wireless_tools/Config.in"
        source "package/wireshark/Config.in"
diff --git a/package/wireguard/Config.in b/package/wireguard/Config.in
new file mode 100644 (file)
index 0000000..0321755
--- /dev/null
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_WIREGUARD
+       bool "wireguard"
+       select BR2_PACKAGE_LIBMNL
+       help
+         WireGuard is an extremely simple yet fast and modern VPN
+         that utilizes state-of-the-art cryptography. It aims to be
+         faster, simpler, leaner, and more useful than IPSec, while
+         avoiding the massive headache. It intends to be considerably
+         more performant than OpenVPN. WireGuard is designed as a
+         general purpose VPN for running on embedded interfaces and
+         super computers alike, fit for many different
+         circumstances. Initially released for the Linux kernel, it
+         plans to be cross-platform and widely deployable. It is
+         currently under heavy development, but already it might be
+         regarded as the most secure, easiest to use, and simplest
+         VPN solution in the industry.
+
+         https://www.wireguard.com
diff --git a/package/wireguard/wireguard.hash b/package/wireguard/wireguard.hash
new file mode 100644 (file)
index 0000000..5bd1163
--- /dev/null
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 ab96230390625aad6f4816fa23aef6e9f7fee130f083d838919129ff12089bf7 WireGuard-0.0.20170810.tar.xz
diff --git a/package/wireguard/wireguard.mk b/package/wireguard/wireguard.mk
new file mode 100644 (file)
index 0000000..1f2190c
--- /dev/null
@@ -0,0 +1,41 @@
+################################################################################
+#
+# wireguard
+#
+################################################################################
+
+WIREGUARD_VERSION = 0.0.20170810
+WIREGUARD_SITE = https://git.zx2c4.com/WireGuard/snapshot
+WIREGUARD_SOURCE = WireGuard-$(WIREGUARD_VERSION).tar.xz
+WIREGUARD_LICENSE = GPL-2.0
+WIREGUARD_LICENSE_FILES = COPYING
+WIREGUARD_DEPENDENCIES = host-pkgconf libmnl
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+WIREGUARD_MAKE_OPTS += WITH_SYSTEMDUNITS=yes
+else
+WIREGUARD_MAKE_OPTS += WITH_SYSTEMDUNITS=no
+endif
+
+ifeq ($(BR2_PACKAGE_BASH),y)
+WIREGUARD_MAKE_OPTS += WITH_BASHCOMPLETION=yes WITH_WGQUICK=yes
+else
+WIREGUARD_MAKE_OPTS += WITH_BASHCOMPLETION=no WITH_WGQUICK=no
+endif
+
+define WIREGUARD_BUILD_CMDS
+       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(WIREGUARD_MAKE_OPTS) \
+               -C $(@D)/src/tools
+endef
+
+define WIREGUARD_INSTALL_TARGET_CMDS
+       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(WIREGUARD_MAKE_OPTS) \
+               -C $(@D)/src/tools install DESTDIR=$(TARGET_DIR)
+endef
+
+ifeq ($(BR2_LINUX_KERNEL),y)
+WIREGUARD_MODULE_SUBDIRS = src
+$(eval $(kernel-module))
+endif
+
+$(eval $(generic-package))