Marcel Telka
2023-11-21 edb9f17417fc91f653839e60b941983e5a3a4a7f
nut: switch to PyNUTClient from PyPI

1 files deleted
1 files added
6 files modified
91 ■■■■ changed files
components/sysutils/nut/Makefile 34 ●●●● patch | view | raw | blame | history
components/sysutils/nut/history 1 ●●●● patch | view | raw | blame | history
components/sysutils/nut/manifests/sample-manifest.p5m 2 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-libs-pynut.p5m 34 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-monitor-gui-py3qt5.p5m 1 ●●●● patch | view | raw | blame | history
components/sysutils/nut/nut.p5m 4 ●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/11-PyNUTClient.patch 13 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/pkg5 2 ●●● patch | view | raw | blame | history
components/sysutils/nut/Makefile
@@ -20,7 +20,7 @@
COMPONENT_NAME=    nut
COMPONENT_VERSION=    2.8.1
COMPONENT_REVISION=    2
COMPONENT_REVISION=    3
COMPONENT_SUMMARY=    Network UPS Tools (NUT)
COMPONENT_DESCRIPTION=    Network UPS Tools (NUT) is a versatile power-device monitoring toolkit to facilitate safe shutdowns
COMPONENT_SRC=    $(COMPONENT_NAME)-$(COMPONENT_VERSION)
@@ -42,7 +42,7 @@
# Drop *.8 man pages (we patch to regenerate them into *.1m - see patches/07-man.patch)
# Fix up upsmon.txt encoding that might have gone wrong into the 2.8.1 release tarball
COMPONENT_PREP_ACTION =    ( cd $(SOURCE_DIR) && ./autogen.sh && cd docs/man && rm -f *.8 && { dos2unix upsmon.txt > upsmon.txt.tmp && mv -f upsmon.txt.tmp upsmon.txt; }  )
COMPONENT_PREP_ACTION =    ( cd $(SOURCE_DIR) && PATH="$(PATH)" ./autogen.sh && cd docs/man && rm -f *.8 && { dos2unix upsmon.txt > upsmon.txt.tmp && mv -f upsmon.txt.tmp upsmon.txt; }  )
COMPONENT_PRE_CONFIGURE_ACTION =    ( $(CLONEY) $(SOURCE_DIR) $(@D) )
@@ -129,7 +129,7 @@
# NUT-Monitor GUI client
CONFIGURE_OPTIONS +=    --with-nut-monitor=yes
CONFIGURE_OPTIONS +=    --with-pynut=yes
CONFIGURE_OPTIONS +=    --with-pynut=no        # we use PyNUTClient from PyPI
CONFIGURE_OPTIONS +=    --with-python2=no
CONFIGURE_OPTIONS +=    --with-python=python$(PYTHON_VERSION)
@@ -148,45 +148,19 @@
CONFIGURE_OPTIONS +=    $(CONFIGURE_OPTIONS.$(BITS))
# NUT-Monitor UI has two similar implementations, for py2gtk and py3qt5.
# The PyNUT.py (general binding) module is written to work with both 2.x
# and 3.x interpreters as the same source file (patched for shebang and
# installed to different vendor/site locations several times in practice).
# Fiddle with packaging:
# * move man1m pages to target directory (see also patches/07-man.patch)
# * move python stuff to vendor-packages
# * make sure full python program name is in the shebang
#   (and note we can not use ...\1${PYVER} because it is
#    also numbers and SED gets confused about group \12 or so)
# * pre-compile PYC files
# * apply a little hack to comment away the import which
#   confuses pkgdepend (it looks for "import" lines and
#   disregards "try/except" around it)
COMPONENT_POST_INSTALL_ACTION += \
    $(MKDIR) $(PROTOUSRSHAREMANDIR)/man1m \
        && $(MV) $(PROTOUSRSHAREMANDIR)/man1/*.1m $(PROTOUSRSHAREMANDIR)/man1m/ \
        || { echo "FAILED to fix up man1m" >&2 ; exit 1; } ; \
    for PYVER in $(PYTHON_VERSIONS) ; do \
        $(MKDIR) "$(PROTOUSRLIBDIR)/python$${PYVER}/vendor-packages" \
            && $(MV) "$(PROTOUSRLIBDIR)/python$${PYVER}/site-packages/"* "$(PROTOUSRLIBDIR)/python$${PYVER}/vendor-packages/" \
            && find "$(PROTOUSRLIBDIR)/python$${PYVER}/vendor-packages/" -name '*.py' | while read F ; do \
                $(GSED) '/^\(\#\!.*\/python\)$$/ s/$$/'"$${PYVER}"'/' -i "$$F" || exit ; \
            done \
        && python$${PYVER} -m compileall "$(PROTOUSRLIBDIR)/python$${PYVER}/vendor-packages" || exit ; \
        case "$${PYVER}" in \
        2.*) python$${PYVER} -c "import pygtk;pygtk.require('2.0');import pynotify" >/dev/null || { \
                echo "Neutering import of pynotify in NUT-Monitor-py2gtk2 for this build with python$${PYVER}" >&2 ; \
                $(GSED) -i "$(PROTOUSRSHAREDIR)/nut/nut-monitor/app/NUT-Monitor-py2gtk2" \
                    -e 's,\(\s\)\(import pynotify\),\1return; \#\#\#NOT_HERE_\2,' || exit ; \
            } ; \
        esac ; \
    done;
# Manually added dependencies:
REQUIRED_PACKAGES += text/asciidoc
REQUIRED_PACKAGES += library/augeas-tools
# Auto-generated dependencies
PYTHON_REQUIRED_PACKAGES += library/python/pynutclient
PYTHON_REQUIRED_PACKAGES += library/python/pyqt5
PYTHON_REQUIRED_PACKAGES += runtime/python
REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
components/sysutils/nut/history
@@ -1 +1,2 @@
system/management/nut-common@2.7.4,5.11-2022.0.0.6 system/management/nut/common
system/management/nut/libs/pynut@2.8.1,5.11-2023.0.0.3 library/python/pynutclient
components/sysutils/nut/manifests/sample-manifest.p5m
@@ -137,8 +137,6 @@
file path=usr/lib/nut/cgi-bin/upsimage.cgi
file path=usr/lib/nut/cgi-bin/upsset.cgi
file path=usr/lib/nut/cgi-bin/upsstats.cgi
file path=usr/lib/python$(PYVER)/vendor-packages/PyNUT.py
file path=usr/lib/python$(PYVER)/vendor-packages/test_nutclient.py
file path=usr/sbin/upsd
file path=usr/sbin/upsdrvctl
file path=usr/sbin/upsdrvsvcctl
components/sysutils/nut/nut-libs-pynut.p5m
File was deleted
components/sysutils/nut/nut-monitor-gui-py3qt5.p5m
@@ -27,7 +27,6 @@
<transform dir path=usr/share/nut/nut-monitor/app/ui -> set group bin>
depend fmri=$(COMPONENT_FMRI)/nut-monitor-gui-common@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=library/python/pyqt5-sip type=require
dir path=usr/share/nut/nut-monitor/app group=bin
dir path=usr/share/nut/nut-monitor/app/ui group=bin
components/sysutils/nut/nut.p5m
@@ -37,7 +37,7 @@
depend fmri=$(COMPONENT_FMRI)/augeas@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=conditional predicate=library/augeas-tools
# If python3+QT5 are installed, then NUT packaging also requires
# its GUI client to be installed; similar for binding libs (used
# its GUI client to be installed; similar for PyNUTClient (used
# by the GUI app, but standalone generally)
depend fmri=$(COMPONENT_FMRI)/libs/pynut@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=conditional predicate=runtime/python-$(PYV)
depend fmri=$(COMPONENT_FMRI)/nut-monitor-gui-py3qt5@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=conditional predicate=library/python/pyqt5
depend fmri=library/python/pynutclient type=require
components/sysutils/nut/patches/11-PyNUTClient.patch
New file
@@ -0,0 +1,13 @@
Use PyNUTClient from PyPI
--- nut-2.8.1/scripts/python/app/NUT-Monitor-py3qt5.in.orig
+++ nut-2.8.1/scripts/python/app/NUT-Monitor-py3qt5.in
@@ -46,7 +46,7 @@
 import configparser
 import locale
 import gettext
-import PyNUT
+import PyNUTClient as PyNUT
 class interface :
components/sysutils/nut/pkg5
@@ -6,6 +6,7 @@
        "library/libtool/libltdl",
        "library/libusb-1",
        "library/neon",
        "library/python/pynutclient-39",
        "library/python/pyqt5-39",
        "library/security/openssl-31",
        "runtime/python-39",
@@ -35,7 +36,6 @@
        "system/management/nut/drivers/software",
        "system/management/nut/drivers/usb",
        "system/management/nut/drivers",
        "system/management/nut/libs/pynut",
        "system/management/nut/libs",
        "system/management/nut/nut-monitor-gui-common",
        "system/management/nut/nut-monitor-gui-py3qt5",