Files
KodaandKoda 3fcd99af1f
Build and publish release / metadata (push) Successful in 44s
Build and publish release / create-release (push) Successful in 49s
Build and publish release / publish-release (push) Canceled after 0s
Build and publish release / build (push) Canceled after 7m44s
refactor #1 + adding documentation (#36)
Reviewed-on: #36
Co-authored-by: Koda YeenBean <n122330@gmail.com>
2026-07-19 21:26:28 +01:00

63 lines
1.8 KiB
Makefile

# openuf — OpenWrt SDK package Makefile
include $(TOPDIR)/rules.mk
PKG_NAME := openuf
PKG_VERSION := 0.4.0
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/openuf
SECTION := net
CATEGORY := Network
TITLE := openUF — UniFi bridge daemon for OpenWrt
DEPENDS := +libmbedtls +libuci +libjson-c +kmod-tun +usteer
URL := https://git.ascheu.de/Koda/OpenUniFi
endef
define Package/openuf/description
Emulates a UniFi U6 IW access point, allowing OpenWrt to be managed
by a UniFi Network controller. Supports adoption, WiFi config push
(band steering, fast roaming, WPA3, PMF), client reporting, CPU/RAM
stats, and LLDP topology.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/. $(PKG_BUILD_DIR)/
endef
OPENUF_SRCS := \
main.c config.c state.c crypto.c http.c announce.c \
inform/inform.c inform/payload.c inform/packet.c inform/response.c \
wlan/common.c wlan/uci.c wlan/radio.c wlan/provision.c \
wlan/legacy.c wlan/telemetry.c \
sysinfo.c clients.c lldp.c models.c
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/inform \
-I$(PKG_BUILD_DIR)/wlan \
-DENABLE_LOGGING=1
TARGET_LDFLAGS += -lmbedtls -lmbedcrypto -luci -ljson-c
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
-o $(PKG_BUILD_DIR)/openuf \
$(addprefix $(PKG_BUILD_DIR)/,$(OPENUF_SRCS))
endef
define Package/openuf/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openuf $(1)/usr/sbin/openuf
$(INSTALL_DIR) $(1)/etc/openuf
$(INSTALL_CONF) ./files/openuf.conf $(1)/etc/openuf/openuf.conf
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/openuf.init $(1)/etc/init.d/openuf
endef
$(eval $(call BuildPackage,openuf))