2 # Copyright (C) 2022 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
12 PKG_SOURCE_URL
=$(PROJECT_GIT
)/project
/unetd.git
13 PKG_SOURCE_DATE
:=2025-10-03
14 PKG_SOURCE_VERSION
:=2f67f6faa08aa4b20663d4cbaf063a79041947c1
15 PKG_MIRROR_HASH
:=df9b2500f5475775ae312ac2860435d7a56a713dab0a30c56d7292ad9ab20ae4
18 PKG_MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
20 PKG_BUILD_DEPENDS
:=HAS_BPF_TOOLCHAIN
:bpf-headers
24 PKG_CONFIG_DEPENDS
+= CONFIG_UNETD_VXLAN_SUPPORT
26 include $(INCLUDE_DIR
)/package.mk
27 include $(INCLUDE_DIR
)/cmake.mk
28 include $(INCLUDE_DIR
)/bpf.mk
29 include $(INCLUDE_DIR
)/nls.mk
34 TITLE
:=WireGuard based VPN connection manager for OpenWrt
35 DEPENDS
:=+libubox
+libubus
+libudebug
+libblobmsg-json
+libnl-tiny
+kmod-wireguard
+UNETD_VXLAN_SUPPORT
:libbpf
38 define Package
/unetd
/config
39 config UNETD_VXLAN_SUPPORT
41 depends on PACKAGE_unetd
42 depends on HAS_BPF_TOOLCHAIN
43 select NEED_BPF_TOOLCHAIN
48 define Package
/unet-dht
52 TITLE
:=unetd DHT discovery support
55 define Package
/unet-cli
58 DEPENDS
:=+unetd
+ucode
+ucode-mod-fs
59 TITLE
:=unetd administration command line utility
63 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
64 -I
$(STAGING_DIR
)/usr
/include
67 -DLIBNL_LIBS
=-lnl-tiny \
68 -DVXLAN_SUPPORT
=$(if
$(CONFIG_UNETD_VXLAN_SUPPORT
),ON
,OFF
)
70 ifdef CONFIG_UNETD_VXLAN_SUPPORT
72 $(call CompileBPF
,$(PKG_BUILD_DIR
)/mss-bpf.c
)
73 $(call Build
/Compile
/Default
,)
77 define Package
/unetd
/conffiles
81 define Package
/unetd
/install
83 $(1)/usr
/share
/ucode
/cli
/modules \
87 $(1)/lib
/netifd
/proto \
90 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libunet.so
* $(1)/usr
/lib
/
92 $(PKG_INSTALL_DIR
)/usr
/sbin
/unetd \
93 $(PKG_INSTALL_DIR
)/usr
/sbin
/unet-tool \
95 $(if
$(CONFIG_UNETD_VXLAN_SUPPORT
),$(INSTALL_DATA
) $(PKG_BUILD_DIR
)/mss-bpf.o
$(1)/lib
/bpf
/mss.o
)
96 $(INSTALL_DATA
) .
/files
/unet.uc
$(1)/usr
/share
/ucode
/cli
/modules
97 $(INSTALL_BIN
) .
/files
/unetd.init
$(1)/etc
/init.d
/unetd
98 $(INSTALL_BIN
) .
/files
/unetd.sh
$(1)/lib
/netifd
/proto
101 define Package
/unet-dht
/install
105 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/unet-dht
$(1)/usr
/sbin
106 $(INSTALL_BIN
) .
/files
/unet-dht.init
$(1)/etc
/init.d
/unet-dht
109 define Package
/unet-cli
/install
110 $(INSTALL_DIR
) $(1)/usr
/sbin
111 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/scripts
/unet-cli
$(1)/usr
/sbin
114 $(eval
$(call BuildPackage
,unetd
))
115 $(eval
$(call BuildPackage
,unet-dht
))
116 $(eval
$(call BuildPackage
,unet-cli
))