Package: release.debian.org
Severity: normal
X-Debbugs-Cc: n...@packages.debian.org
Control: affects -1 + src:nut
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package nut

[ Reason ]
nut-scanner tool is currently not working properly as it dynamically
load some libraries and it only looks for the .so files installed by the
corresponding -dev packages and not the runtime ones.

[ Impact ]
nut-scanner is a tool to automatically detect the UPS installed on the
system or network. Without this tool the users need to write the
configration by hand. nut is not completely broken, but it's less
convinient for the user

[ Tests ]
I installed the runtime libraries without the corresponding -dev package
and the tool is able to load the library and is not complaining anymore

[ Risks ]
The patch only changes the file name of the libraty from lib.so to
lib.so.SONAME, so as long as the SONAME is not changing there is no
risks 

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

[ Other info ]
This fix will be limited to trixie and upstream has a different fix in
a new release. 


unblock nut/2.8.1-5
diff --git a/debian/changelog b/debian/changelog
index 5820897..f2db884 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+nut (2.8.1-5) unstable; urgency=medium
+
+  * d/p/fixsoname.patch: Fix name of the dynamicly loaded libraties in
+    nut-scanner (Closes: #1070205)
+
+ -- Laurent Bigonville <bi...@debian.org>  Fri, 27 Jun 2025 23:04:07 +0200
+
 nut (2.8.1-4.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --git a/debian/patches/fixsoname.patch b/debian/patches/fixsoname.patch
new file mode 100644
index 0000000..ff32b00
--- /dev/null
+++ b/debian/patches/fixsoname.patch
@@ -0,0 +1,128 @@
+Description: Fix name of the dynamicly loaded libraties in nut-scanner
+ This is a temporary fix for Trixie, upstream implemented an other fix
+Author: Laurent Bigonville <bi...@debian.org>
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070205
+
+--- a/tools/nut-scanner/nutscan-init.c
++++ b/tools/nut-scanner/nutscan-init.c
+@@ -159,9 +159,9 @@ void nutscan_init(void)
+ 
+ #ifdef WITH_USB
+  #if WITH_LIBUSB_1_0
+-      libname = get_libname("libusb-1.0" SOEXT);
++      libname = get_libname("libusb-1.0" ".so.0");
+  #else
+-      libname = get_libname("libusb-0.1" SOEXT);
++      libname = get_libname("libusb-0.1" ".so.4");
+   #ifdef WIN32
+       /* TODO: Detect DLL name at build time, or rename it at install time? */
+       /* libusb-compat built for mingw per NUT instructions */
+@@ -185,9 +185,9 @@ void nutscan_init(void)
+                       "trying to load it with libtool default resolver",
+                       __func__, "LibUSB");
+  #if WITH_LIBUSB_1_0
+-              nutscan_avail_usb = nutscan_load_usb_library("libusb-1.0" 
SOEXT);
++              nutscan_avail_usb = nutscan_load_usb_library("libusb-1.0" 
".so.0");
+  #else
+-              nutscan_avail_usb = nutscan_load_usb_library("libusb-0.1" 
SOEXT);
++              nutscan_avail_usb = nutscan_load_usb_library("libusb-0.1" 
".so.4");
+   #ifdef WIN32
+               if (!nutscan_avail_usb) {
+                       nutscan_avail_usb = 
nutscan_load_usb_library("libusb-0-1-4" SOEXT);
+@@ -206,7 +206,7 @@ void nutscan_init(void)
+ #endif        /* WITH_USB */
+ 
+ #ifdef WITH_SNMP
+-      libname = get_libname("libnetsnmp" SOEXT);
++      libname = get_libname("libnetsnmp" ".so.40");
+  #ifdef WIN32
+       if (!libname) {
+               libname = get_libname("libnetsnmp-40" SOEXT);
+@@ -222,7 +222,7 @@ void nutscan_init(void)
+               upsdebugx(1, "%s: get_libname() did not resolve libname for %s, 
"
+                       "trying to load it with libtool default resolver",
+                       __func__, "LibSNMP");
+-              nutscan_avail_snmp = nutscan_load_snmp_library("libnetsnmp" 
SOEXT);
++              nutscan_avail_snmp = nutscan_load_snmp_library("libnetsnmp" 
".so.40");
+ #ifdef WIN32
+               if (!nutscan_avail_snmp) {
+                       nutscan_avail_snmp = 
nutscan_load_snmp_library("libnetsnmp-40" SOEXT);
+@@ -237,9 +237,9 @@ void nutscan_init(void)
+ #endif        /* WITH_SNMP */
+ 
+ #ifdef WITH_NEON
+-      libname = get_libname("libneon" SOEXT);
++      libname = get_libname("libneon" ".so.27");
+       if (!libname) {
+-              libname = get_libname("libneon-gnutls" SOEXT);
++              libname = get_libname("libneon-gnutls" ".so.27");
+       }
+  #ifdef WIN32
+       if (!libname) {
+@@ -259,9 +259,9 @@ void nutscan_init(void)
+               upsdebugx(1, "%s: get_libname() did not resolve libname for %s, 
"
+                       "trying to load it with libtool default resolver",
+                       __func__, "LibNeon");
+-              nutscan_avail_xml_http = nutscan_load_neon_library("libneon" 
SOEXT);
++              nutscan_avail_xml_http = nutscan_load_neon_library("libneon" 
".so.27");
+               if (!nutscan_avail_xml_http) {
+-                      nutscan_avail_xml_http = 
nutscan_load_neon_library("libneon-gnutls" SOEXT);
++                      nutscan_avail_xml_http = 
nutscan_load_neon_library("libneon-gnutls" ".so.27");
+               }
+ #ifdef WIN32
+               if (!nutscan_avail_xml_http) {
+@@ -280,7 +280,7 @@ void nutscan_init(void)
+ #endif        /* WITH_NEON */
+ 
+ #ifdef WITH_AVAHI
+-      libname = get_libname("libavahi-client" SOEXT);
++      libname = get_libname("libavahi-client" ".so.3");
+       if (libname) {
+               upsdebugx(1, "%s: get_libname() resolved '%s' for %s, loading 
it",
+                       __func__, libname, "LibAvahi");
+@@ -291,7 +291,7 @@ void nutscan_init(void)
+               upsdebugx(1, "%s: get_libname() did not resolve libname for %s, 
"
+                       "trying to load it with libtool default resolver",
+                       __func__, "LibAvahi");
+-              nutscan_avail_avahi = 
nutscan_load_avahi_library("libavahi-client" SOEXT);
++              nutscan_avail_avahi = 
nutscan_load_avahi_library("libavahi-client" ".so.3");
+       }
+       upsdebugx(1, "%s: %s to load the library for %s",
+               __func__, nutscan_avail_avahi ? "succeeded" : "failed", 
"LibAvahi");
+@@ -301,7 +301,7 @@ void nutscan_init(void)
+ #endif        /* WITH_AVAHI */
+ 
+ #ifdef WITH_FREEIPMI
+-      libname = get_libname("libfreeipmi" SOEXT);
++      libname = get_libname("libfreeipmi" ".so.17");
+       if (libname) {
+               upsdebugx(1, "%s: get_libname() resolved '%s' for %s, loading 
it",
+                       __func__, libname, "LibFreeIPMI");
+@@ -312,7 +312,7 @@ void nutscan_init(void)
+               upsdebugx(1, "%s: get_libname() did not resolve libname for %s, 
"
+                       "trying to load it with libtool default resolver",
+                       __func__, "LibFreeIPMI");
+-              nutscan_avail_ipmi = nutscan_load_ipmi_library("libfreeipmi" 
SOEXT);
++              nutscan_avail_ipmi = nutscan_load_ipmi_library("libfreeipmi" 
".so.17");
+       }
+       upsdebugx(1, "%s: %s to load the library for %s",
+               __func__, nutscan_avail_ipmi ? "succeeded" : "failed", 
"LibFreeIPMI");
+@@ -322,7 +322,7 @@ void nutscan_init(void)
+ #endif        /* WITH_FREEIPMI */
+ 
+ /* start of libupsclient for "old NUT" (vs. Avahi) protocol - unconditional */
+-      libname = get_libname("libupsclient" SOEXT);
++      libname = get_libname("libupsclient" ".so.6");
+ #ifdef WIN32
+       /* TODO: Detect DLL name at build time, or rename it at install time? */
+       /* e.g. see clients/Makefile.am for version-info value */
+@@ -343,7 +343,7 @@ void nutscan_init(void)
+               upsdebugx(1, "%s: get_libname() did not resolve libname for %s, 
"
+                       "trying to load it with libtool default resolver",
+                       __func__, "NUT Client library");
+-              nutscan_avail_nut = 
nutscan_load_upsclient_library("libupsclient" SOEXT);
++              nutscan_avail_nut = 
nutscan_load_upsclient_library("libupsclient" ".so.6");
+ #ifdef WIN32
+               if (!nutscan_avail_nut) {
+                       nutscan_avail_nut = 
nutscan_load_upsclient_library("libupsclient-6" SOEXT);
diff --git a/debian/patches/series b/debian/patches/series
index 9a96c26..f9dd54d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 0004-scripts-python-app-NUT-Monitor-NEWS.adoc-fix-typo-qt.patch
 0005-Set-the-DesktopFileName-in-scripts-python-app-NUT-Mo.patch
 NoDisplay-nut-monitor-py3qt5.patch
+fixsoname.patch

Reply via email to