From dc6abfaaae4ee1657e2da9a7f8276425b9a95aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Sat, 6 Dec 2025 22:03:55 +0100 Subject: [PATCH] statd: Remove python-statd package Now statd handling the rebuilding of the python libraries by using the same script as buildroot uses for building python-packages. --- doc/developers-guide.md | 2 +- package/Config.in | 1 - package/python-statd/Config.in | 6 ------ package/python-statd/python-statd.hash | 1 - package/python-statd/python-statd.mk | 16 ---------------- package/statd/Config.in | 3 ++- package/statd/statd.mk | 20 +++++++++++++++++++- 7 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 package/python-statd/Config.in delete mode 100644 package/python-statd/python-statd.hash delete mode 100644 package/python-statd/python-statd.mk diff --git a/doc/developers-guide.md b/doc/developers-guide.md index 320ab2ca..592b2d7b 100644 --- a/doc/developers-guide.md +++ b/doc/developers-guide.md @@ -217,7 +217,7 @@ gathers data from local linux services and feeds it into sysrepo. To apply changes, rebuild the image: - make python-statd-rebuild statd-rebuild all + make statd-rebuild all Rebuilding the image and testing on target for every change during development process can be tedious. Instead, `yanger` allows remote diff --git a/package/Config.in b/package/Config.in index b0e9a8c5..bf0dcee4 100644 --- a/package/Config.in +++ b/package/Config.in @@ -32,7 +32,6 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/netbrowse/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/onieprom/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/podman/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/python-libyang/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/python-statd/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/python-yangdoc/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/skeleton-init-finit/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/show/Config.in" diff --git a/package/python-statd/Config.in b/package/python-statd/Config.in deleted file mode 100644 index 440eff0b..00000000 --- a/package/python-statd/Config.in +++ /dev/null @@ -1,6 +0,0 @@ -config BR2_PACKAGE_PYTHON_STATD - bool "python-statd" - select BR2_PACKAGE_HOST_PYTHON3 - select BR2_PACKAGE_DBUS_PYTHON - help - Python helpers for statd. diff --git a/package/python-statd/python-statd.hash b/package/python-statd/python-statd.hash deleted file mode 100644 index 7dbd2566..00000000 --- a/package/python-statd/python-statd.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 360336cbf0f228b12b7ca0996b33e442d97f496edcf2ec31b655e63631e7f96f LICENSE diff --git a/package/python-statd/python-statd.mk b/package/python-statd/python-statd.mk deleted file mode 100644 index e2d0d350..00000000 --- a/package/python-statd/python-statd.mk +++ /dev/null @@ -1,16 +0,0 @@ -PYTHON_STATD_VERSION = 1.0 -PYTHON_STATD_SITE_METHOD = local -PYTHON_STATD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/statd/python -PYTHON_STATD_LICENSE = BSD-3-Clause -PYTHON_STATD_LICENSE_FILES = LICENSE -PYTHON_STATD_DEPENDENCIES = host-python3 python3 host-python-poetry-core dbus-python -PYTHON_STATD_SETUP_TYPE = pep517 # poetry - -define PYTHON_STATD_MOVE_BINARIES - mkdir -p $(TARGET_DIR)/usr/libexec/statd - mv $(TARGET_DIR)/usr/bin/yanger $(TARGET_DIR)/usr/libexec/statd/ - mv $(TARGET_DIR)/usr/bin/cli-pretty $(TARGET_DIR)/usr/libexec/statd/ - mv $(TARGET_DIR)/usr/bin/ospf-status $(TARGET_DIR)/usr/libexec/statd/ -endef -PYTHON_STATD_POST_INSTALL_TARGET_HOOKS += PYTHON_STATD_MOVE_BINARIES - $(eval $(python-package)) diff --git a/package/statd/Config.in b/package/statd/Config.in index b401cbac..acec4cd7 100644 --- a/package/statd/Config.in +++ b/package/statd/Config.in @@ -5,7 +5,8 @@ config BR2_PACKAGE_STATD select BR2_PACKAGE_SYSREPO select BR2_PACKAGE_LIBSRX select BR2_PACKAGE_LIBITE - select BR2_PACKAGE_PYTHON_STATD + select BR2_PACKAGE_HOST_PYTHON3 + select BR2_PACKAGE_DBUS_PYTHON help Operational Status Daemon. Responsible for handling sysrepo operational run-time info. Such as interface state and address. diff --git a/package/statd/statd.mk b/package/statd/statd.mk index 9efd8515..0d676643 100644 --- a/package/statd/statd.mk +++ b/package/statd/statd.mk @@ -10,7 +10,9 @@ STATD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/statd STATD_LICENSE = BSD-3-Clause STATD_LICENSE_FILES = LICENSE STATD_REDISTRIBUTE = NO -STATD_DEPENDENCIES = sysrepo libev libsrx jansson python-statd libyang libite +STATD_DEPENDENCIES = sysrepo libev libsrx jansson libyang libite \ + host-python3 python3 host-python-pypa-build host-python-installer \ + host-python-poetry-core dbus-python STATD_AUTORECONF = YES define STATD_CONF_ENV @@ -25,6 +27,22 @@ else STATD_CONF_OPTS += --disable-containers endif +define STATD_BUILD_PYTHON + cd $(STATD_SITE)/python && \ + $(PKG_PYTHON_PEP517_ENV) $(HOST_DIR)/bin/python3 $(PKG_PYTHON_PEP517_BUILD_CMD) -o $(@D)/python/dist + mkdir -p $(TARGET_DIR)/usr/libexec/statd + cd $(@D)/python && \ + $(HOST_DIR)/bin/python3 $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/*.whl \ + --interpreter=/usr/bin/python3 \ + --script-kind=posix \ + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ + --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ + --scripts=$(TARGET_DIR)/usr/libexec/statd \ + --data=$(TARGET_DIR) +endef +STATD_POST_INSTALL_TARGET_HOOKS += STATD_BUILD_PYTHON + define STATD_INSTALL_EXTRA cp $(STATD_PKGDIR)/statd.conf $(FINIT_D)/available/ ln -sf ../available/statd.conf $(FINIT_D)/enabled/statd.conf