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
:=2022-09-16.1
14 PKG_SOURCE_VERSION
:=6c888f897862b152e2cfae735faafc9cdcb07336
15 PKG_MIRROR_HASH
:=35df8c822c671495146c3d5d1c193c1d1a44721c274aee2035943eb5e8c04768
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
+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
47 define Package
/unet-dht
51 TITLE
:=unetd DHT discovery support
54 define Package
/unet-cli
57 DEPENDS
:=+unetd
+ucode
+ucode-mod-fs
58 TITLE
:=unetd administration command line utility
62 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
63 -I
$(STAGING_DIR
)/usr
/include
66 -DLIBNL_LIBS
=-lnl-tiny \
67 -DVXLAN_SUPPORT
=$(if
$(CONFIG_UNETD_VXLAN_SUPPORT
),ON
,OFF
)
69 ifdef CONFIG_UNETD_VXLAN_SUPPORT
71 $(call CompileBPF
,$(PKG_BUILD_DIR
)/mss-bpf.c
)
72 $(call Build
/Compile
/Default
,)
76 define Package
/unetd
/conffiles
80 define Package
/unetd
/install
85 $(1)/lib
/netifd
/proto \
88 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libunet.so
* $(1)/usr
/lib
/
90 $(PKG_INSTALL_DIR
)/usr
/sbin
/unetd \
91 $(PKG_INSTALL_DIR
)/usr
/sbin
/unet-tool \
93 $(if
$(CONFIG_UNETD_VXLAN_SUPPORT
),$(INSTALL_DATA
) $(PKG_BUILD_DIR
)/mss-bpf.o
$(1)/lib
/bpf
/mss.o
)
94 $(INSTALL_BIN
) .
/files
/unetd.init
$(1)/etc
/init.d
/unetd
95 $(INSTALL_BIN
) .
/files
/unetd.sh
$(1)/lib
/netifd
/proto
98 define Package
/unet-dht
/install
102 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/unet-dht
$(1)/usr
/sbin
103 $(INSTALL_BIN
) .
/files
/unet-dht.init
$(1)/etc
/init.d
/unet-dht
106 define Package
/unet-cli
/install
107 $(INSTALL_DIR
) $(1)/usr
/sbin
108 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/scripts
/unet-cli
$(1)/usr
/sbin
111 $(eval
$(call BuildPackage
,unetd
))
112 $(eval
$(call BuildPackage
,unet-dht
))
113 $(eval
$(call BuildPackage
,unet-cli
))