kea: ship admin-utils.sh and kea-shell Python modules
authorAlexandru Ardelean <redacted>
Sat, 30 May 2026 06:46:39 +0000 (09:46 +0300)
committerAlexandru Ardelean <redacted>
Mon, 1 Jun 2026 05:11:11 +0000 (08:11 +0300)
kea-admin and kea-shell were shipped without their helper script
and Python modules respectively, leaving both non-functional. Ship
the missing files, add +python3-light +python3-urllib +python3-openssl
to kea-shell, and rewrite its meson-baked host-absolute shebang and
sys.path.append to the on-target /usr/bin/python3 + $(PYTHON3_PKG_DIR).

Signed-off-by: Alexandru Ardelean <redacted>
net/kea/Makefile

index 332ef7c49fe056a46b1781db6d6808f2d3ecbc7c..415e4c3ce14f50d7278921939447533f279b5dc5 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kea
 PKG_VERSION:=3.0.2
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)
@@ -26,6 +26,9 @@ PKG_BUILD_FLAGS:=gc-sections
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/meson.mk
 
+PYTHON3_PKG_BUILD:=0
+include ../../lang/python/python3-package.mk
+
 define Package/kea/Default
   SECTION:=net
   CATEGORY:=Network
@@ -181,7 +184,7 @@ endef
 define Package/kea-shell
        $(call Package/kea/Default)
        TITLE+=shell
-       DEPENDS:=+kea-libs
+       DEPENDS:=+kea-libs +python3-light +python3-urllib +python3-openssl
 endef
 define Package/kea-shell/description
      This simple text client uses the REST interface to connect to the Kea
@@ -236,8 +239,10 @@ define Package/kea-dhcp-ddns/install
 endef
 
 define Package/kea-admin/install
-       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/kea/scripts
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/kea/scripts/admin-utils.sh \
+               $(1)/usr/share/kea/scripts/admin-utils.sh
 endef
 
 define Package/kea-hook-ha/install
@@ -269,8 +274,15 @@ define Package/kea-perfdhcp/install
 endef
 
 define Package/kea-shell/install
-       $(INSTALL_DIR) $(1)/usr/sbin
+       $(SED) '1s,^#!/.*python.*,#!/usr/bin/python3,' \
+               $(PKG_INSTALL_DIR)/usr/sbin/kea-shell
+       $(SED) "s,^sys.path.append.*,sys.path.append('$(PYTHON3_PKG_DIR)/kea')," \
+               $(PKG_INSTALL_DIR)/usr/sbin/kea-shell
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)$(PYTHON3_PKG_DIR)/kea
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bin/shell/kea_conn.py \
+               $(PKG_BUILD_DIR)/src/bin/shell/kea_connector3.py \
+               $(1)$(PYTHON3_PKG_DIR)/kea/
 endef
 
 define Package/kea-uci/install
git clone https://git.99rst.org/PROJECT