From c54a93dcc001ca2d0ef83c80a8dba1cafc56563c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 22 Apr 2013 17:20:14 +0200 Subject: [PATCH 001/142] do not let upsmon run during update (#916472) - make binaries hardened (#955157) --- nut.spec | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/nut.spec b/nut.spec index 1a04979..83e25f4 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 11%{?dist} +Release: 12%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -67,6 +67,8 @@ BuildRequires: libusb-devel ExcludeArch: s390 s390x +%global restart_flag /var/run/%{name}/%{name}-restart-after-rpm-install + %description These programs are part of a developing project to monitor the assortment of UPSes that are found out there in the field. Many models have serial @@ -165,8 +167,8 @@ sh %{SOURCE4} >>include/config.h #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool - -make %{?_smp_mflags} +%global _hardened_build 1 +make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" %install rm -rf %{buildroot} @@ -225,6 +227,15 @@ ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : /usr/sbin/usermod -G dialout %{name} +# do not let upsmon run during upgrade rhbz#916472 +# phase 1: stop upsmon before upsd changes +if [ "$1" = "2" ]; then + rm -f %restart_flag + /bin/systemctl is-active nut-monitor.service >/dev/null 2>&1 && touch %restart_flag ||: + /bin/systemctl stop nut-monitor.service >/dev/null 2>&1 +fi + + %post /sbin/ldconfig udevadm control --reload ||: @@ -256,7 +267,16 @@ udevadm control --reload ||: %postun client /sbin/ldconfig -%systemd_postun_with_restart nut-monitor.service + +%posttrans +# phase 2: start upsmon again +if [ -e %restart_flag ]; then + /bin/systemctl restart nut-monitor.service >/dev/null 2>&1 || : + rm -f %restart_flag +else + # maybe we did not stop it - if we reinstalled just nut-client + /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : +fi %clean rm -rf %{buildroot} @@ -410,6 +430,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Apr 22 2013 Michal Hlavinka - 2.6.5-12 +- do not let upsmon run during update (#916472) +- make binaries hardened (#955157) + * Thu Feb 28 2013 Michal Hlavinka - 2.6.5-11 - clean pid file on exit (#916468) From dee53bd7238d3e15f2085c17b8609adf284fbc35 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 22 Apr 2013 17:58:52 +0200 Subject: [PATCH 002/142] do not let upsmon run during update (#916472) - make binaries hardened (#955157) --- nut.spec | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/nut.spec b/nut.spec index 1a04979..83e25f4 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 11%{?dist} +Release: 12%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -67,6 +67,8 @@ BuildRequires: libusb-devel ExcludeArch: s390 s390x +%global restart_flag /var/run/%{name}/%{name}-restart-after-rpm-install + %description These programs are part of a developing project to monitor the assortment of UPSes that are found out there in the field. Many models have serial @@ -165,8 +167,8 @@ sh %{SOURCE4} >>include/config.h #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool - -make %{?_smp_mflags} +%global _hardened_build 1 +make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" %install rm -rf %{buildroot} @@ -225,6 +227,15 @@ ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : /usr/sbin/usermod -G dialout %{name} +# do not let upsmon run during upgrade rhbz#916472 +# phase 1: stop upsmon before upsd changes +if [ "$1" = "2" ]; then + rm -f %restart_flag + /bin/systemctl is-active nut-monitor.service >/dev/null 2>&1 && touch %restart_flag ||: + /bin/systemctl stop nut-monitor.service >/dev/null 2>&1 +fi + + %post /sbin/ldconfig udevadm control --reload ||: @@ -256,7 +267,16 @@ udevadm control --reload ||: %postun client /sbin/ldconfig -%systemd_postun_with_restart nut-monitor.service + +%posttrans +# phase 2: start upsmon again +if [ -e %restart_flag ]; then + /bin/systemctl restart nut-monitor.service >/dev/null 2>&1 || : + rm -f %restart_flag +else + # maybe we did not stop it - if we reinstalled just nut-client + /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : +fi %clean rm -rf %{buildroot} @@ -410,6 +430,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Apr 22 2013 Michal Hlavinka - 2.6.5-12 +- do not let upsmon run during update (#916472) +- make binaries hardened (#955157) + * Thu Feb 28 2013 Michal Hlavinka - 2.6.5-11 - clean pid file on exit (#916468) From 1af2bd06c32b3675ed3091bc9e3dc89a04316da8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 11 Jun 2013 11:35:09 +0200 Subject: [PATCH 003/142] rebuild for new GD 2.1.0 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 83e25f4..125a73e 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 12%{?dist} +Release: 13%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -430,6 +430,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 11 2013 Remi Collet - 2.6.5-13 +- rebuild for new GD 2.1.0 + * Mon Apr 22 2013 Michal Hlavinka - 2.6.5-12 - do not let upsmon run during update (#916472) - make binaries hardened (#955157) From ac9052783574c1df9d2f98de889f20b3bcfcbf68 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 09:36:59 -0500 Subject: [PATCH 004/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 125a73e..045f7e2 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 13%{?dist} +Release: 14%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -430,6 +430,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 2.6.5-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Tue Jun 11 2013 Remi Collet - 2.6.5-13 - rebuild for new GD 2.1.0 From 40260657ac50f8cf2ae3baf9b2a2956963eb1050 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 3 Sep 2013 18:17:00 +0200 Subject: [PATCH 005/142] rebuilt with updated freeipmi --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 045f7e2..6d8dd05 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 14%{?dist} +Release: 15%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -430,6 +430,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Sep 03 2013 Michal Hlavinka - 2.6.5-15 +- rebuilt with updated freeipmi + * Sat Aug 03 2013 Fedora Release Engineering - 2.6.5-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 2ff1cacec59469455440cf0a7b62cce666eb853c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 24 Sep 2013 12:27:56 +0200 Subject: [PATCH 006/142] rebuilt with updated freeipmi (1.3.2) --- nut.spec | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nut.spec b/nut.spec index 6d8dd05..9b9b92a 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 15%{?dist} +Release: 16%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -430,6 +430,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Sep 24 2013 Michal Hlavinka - 2.6.5-16 +- rebuilt with updated freeipmi (1.3.2) + * Tue Sep 03 2013 Michal Hlavinka - 2.6.5-15 - rebuilt with updated freeipmi @@ -555,13 +558,13 @@ rm -rf %{buildroot} - fix issue where nut fails to restart because it did not finished termination yet and old instance blocks devices (#193058) -* Fri Jul 07 2010 Michal Hlavinka - 2.4.3-4 +* Wed Jul 07 2010 Michal Hlavinka - 2.4.3-4 - follow licensing guideline update * Fri Mar 26 2010 Michal Hlavinka - 2.4.3-3 - replace BUS with SUBSYSTEMS in udev rules (#573806) -* Mon Mar 23 2010 Michal Hlavinka - 2.4.3-2 +* Tue Mar 23 2010 Michal Hlavinka - 2.4.3-2 - reduced size of buffer to maximum size supported by low-speed USB devices - fixes #575334 @@ -840,7 +843,7 @@ rm -rf %{buildroot} - update to 0.45.2 - fix bug #57417 -* Mon Nov 27 2001 Than Ngo 0.45.2-1 +* Tue Nov 27 2001 Than Ngo 0.45.2-1 - update to 0.45.2 - clean up some patch files for 0.45.2 @@ -941,13 +944,13 @@ rm -rf %{buildroot} * Mon Dec 6 1999 (0.42.0-7) - removed overlapping files between the nut and nut-client rpms -* Mon Nov 23 1999 (0.42.0-6) +* Tue Nov 23 1999 (0.42.0-6) - stop ups before uninstalling -* Mon Nov 23 1999 (0.42.0-5) +* Tue Nov 23 1999 (0.42.0-5) - build against gd 1.6.3 -* Thu Nov 03 1999 (0.42.0-4) +* Wed Nov 03 1999 (0.42.0-4) - Initial build of nut (well almost). - Removed chmod from the make file so that the package does not have to be built as root..... From 0b850eb3a85b397c1415ee003920056bf379f019 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 27 Feb 2014 15:26:42 +0100 Subject: [PATCH 007/142] nut updated to 2.7.1 --- .gitignore | 1 + nut-2.6.5-dlfix.patch | 44 +++++++++++++++++++------------------- nut-2.6.5-foreground.patch | 44 +++++++++++++++++++------------------- nut-2.6.5-pthreadfix.patch | 12 +++++++---- nut-2.6.5-quickfix.patch | 8 +++---- nut-2.6.5-rmpidf.patch | 32 +++++++++++++-------------- nut.spec | 41 ++++++++++++++++++----------------- sources | 2 +- 8 files changed, 95 insertions(+), 89 deletions(-) diff --git a/.gitignore b/.gitignore index 8d08d5f..67b2231 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ nut-2.4.3.tar.gz /nut-2.6.3.tar.gz /nut-2.6.4.tar.gz /nut-2.6.5.tar.gz +/nut-2.7.1.tar.gz diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch index 9198f65..4375324 100644 --- a/nut-2.6.5-dlfix.patch +++ b/nut-2.6.5-dlfix.patch @@ -1,6 +1,6 @@ -diff -up nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_avahi.c ---- nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_avahi.c 2012-09-06 12:56:45.383206759 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_avahi.c +--- nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_avahi.c 2014-02-27 11:25:57.610869514 +0100 @@ -36,7 +36,7 @@ #include @@ -19,11 +19,11 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix nut-2.6.5/tools/nut-scan if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_ipmi.c ---- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-06 12:56:55.760402197 +0200 -@@ -30,7 +30,7 @@ - #define NUT_IPMI_DRV_NAME "nut-ipmipsu" +diff -up nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_ipmi.c +--- nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_ipmi.c 2014-02-27 11:32:20.393015238 +0100 +@@ -35,7 +35,7 @@ + #define IPMI_RETRANSMISSION_TIMEOUT_LENGTH_DEFAULT 250 /* dynamic link library stuff */ -static char * libname = "libfreeipmi"; @@ -31,7 +31,7 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scann static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -83,7 +83,7 @@ int nutscan_load_ipmi_library() +@@ -128,7 +128,7 @@ int nutscan_load_ipmi_library() return 0; } @@ -40,9 +40,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scann if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanner/scan_nut.c ---- nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_nut.c 2012-09-06 12:54:59.308897430 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.1/tools/nut-scanner/scan_nut.c +--- nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix 2013-10-30 14:47:15.000000000 +0100 ++++ nut-2.7.1/tools/nut-scanner/scan_nut.c 2014-02-27 11:25:57.611869522 +0100 @@ -26,7 +26,7 @@ #include @@ -52,7 +52,7 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanne static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -66,7 +66,7 @@ int nutscan_load_upsclient_library() +@@ -67,7 +67,7 @@ int nutscan_load_upsclient_library() return 0; } @@ -61,9 +61,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanne if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix nut-2.6.5/tools/nut-scanner/scan_snmp.c ---- nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_snmp.c 2012-09-06 12:57:16.250774817 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.1/tools/nut-scanner/scan_snmp.c +--- nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_snmp.c 2014-02-27 11:25:57.611869522 +0100 @@ -74,7 +74,7 @@ static int thread_count = 0; long g_usec_timeout ; @@ -82,9 +82,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix nut-2.6.5/tools/nut-scann if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix nut-2.6.5/tools/nut-scanner/scan_usb.c ---- nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_usb.c 2012-09-06 12:56:34.007987045 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.1/tools/nut-scanner/scan_usb.c +--- nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_usb.c 2014-02-27 11:25:57.611869522 +0100 @@ -28,7 +28,7 @@ #include @@ -103,9 +103,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix nut-2.6.5/tools/nut-scanne if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.6.5/tools/nut-scanner/scan_xml_http.c ---- nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_xml_http.c 2012-09-06 12:57:28.617991656 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.1/tools/nut-scanner/scan_xml_http.c +--- nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_xml_http.c 2014-02-27 11:25:57.611869522 +0100 @@ -33,7 +33,7 @@ #include diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch index 639cc54..ce1570c 100644 --- a/nut-2.6.5-foreground.patch +++ b/nut-2.6.5-foreground.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c ---- nut-2.6.5/clients/upsmon.c.foreground 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/clients/upsmon.c 2012-09-11 17:54:55.109343036 +0200 -@@ -1659,6 +1659,7 @@ static void help(const char *progname) +diff -up nut-2.7.1/clients/upsmon.c.foreground nut-2.7.1/clients/upsmon.c +--- nut-2.7.1/clients/upsmon.c.foreground 2013-07-26 21:41:10.000000000 +0200 ++++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:39:58.158784578 +0100 +@@ -1645,6 +1645,7 @@ static void help(const char *progname) printf(" - reload: reread configuration\n"); printf(" - stop: stop monitoring and exit\n"); printf(" -D raise debugging level\n"); @@ -9,7 +9,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c printf(" -h display this help\n"); printf(" -K checks POWERDOWNFLAG, sets exit code to 0 if set\n"); printf(" -p always run privileged (disable privileged parent)\n"); -@@ -1873,7 +1874,7 @@ static void check_parent(void) +@@ -1859,7 +1860,7 @@ static void check_parent(void) int main(int argc, char *argv[]) { const char *prog = xbasename(argv[0]); @@ -18,7 +18,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c printf("Network UPS Tools %s %s\n", prog, UPS_VERSION); -@@ -1884,7 +1885,7 @@ int main(int argc, char *argv[]) +@@ -1870,7 +1871,7 @@ int main(int argc, char *argv[]) run_as_user = xstrdup(RUN_AS_USER); @@ -27,7 +27,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c switch (i) { case 'c': if (!strncmp(optarg, "fsd", strlen(optarg))) -@@ -1901,6 +1902,9 @@ int main(int argc, char *argv[]) +@@ -1887,6 +1888,9 @@ int main(int argc, char *argv[]) case 'D': nut_debug_level++; break; @@ -37,7 +37,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c case 'f': free(configfile); configfile = xstrdup(optarg); -@@ -1976,9 +1980,9 @@ int main(int argc, char *argv[]) +@@ -1962,9 +1966,9 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } @@ -49,9 +49,9 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c upsdebugx(1, "debug level is '%d'", nut_debug_level); } -diff -up nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground nut-2.6.5/scripts/systemd/nut-monitor.service.in ---- nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground 2012-09-11 17:56:05.037920175 +0200 -+++ nut-2.6.5/scripts/systemd/nut-monitor.service.in 2012-09-11 17:56:05.038920183 +0200 +diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/scripts/systemd/nut-monitor.service.in +--- nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground 2014-02-27 11:39:58.141784438 +0100 ++++ nut-2.7.1/scripts/systemd/nut-monitor.service.in 2014-02-27 11:39:58.152784529 +0100 @@ -4,9 +4,8 @@ After=local-fs.target network.target nut [Service] @@ -64,9 +64,9 @@ diff -up nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground nut-2.6.5/s [Install] WantedBy=multi-user.target -diff -up nut-2.6.5/scripts/systemd/nut-server.service.in.foreground nut-2.6.5/scripts/systemd/nut-server.service.in ---- nut-2.6.5/scripts/systemd/nut-server.service.in.foreground 2012-09-11 17:56:19.850042294 +0200 -+++ nut-2.6.5/scripts/systemd/nut-server.service.in 2012-09-11 17:56:19.851042303 +0200 +diff -up nut-2.7.1/scripts/systemd/nut-server.service.in.foreground nut-2.7.1/scripts/systemd/nut-server.service.in +--- nut-2.7.1/scripts/systemd/nut-server.service.in.foreground 2013-07-26 21:41:11.000000000 +0200 ++++ nut-2.7.1/scripts/systemd/nut-server.service.in 2014-02-27 11:39:58.152784529 +0100 @@ -5,8 +5,8 @@ Requires=nut-driver.service Before=nut-monitor.service @@ -78,10 +78,10 @@ diff -up nut-2.6.5/scripts/systemd/nut-server.service.in.foreground nut-2.6.5/sc [Install] WantedBy=multi-user.target -diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c ---- nut-2.6.5/server/upsd.c.foreground 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/server/upsd.c 2012-09-11 17:54:55.109343036 +0200 -@@ -819,6 +819,7 @@ static void help(const char *progname) +diff -up nut-2.7.1/server/upsd.c.foreground nut-2.7.1/server/upsd.c +--- nut-2.7.1/server/upsd.c.foreground 2013-07-26 21:41:11.000000000 +0200 ++++ nut-2.7.1/server/upsd.c 2014-02-27 11:39:58.153784537 +0100 +@@ -827,6 +827,7 @@ static void help(const char *progname) printf(" - reload: reread configuration files\n"); printf(" - stop: stop process and exit\n"); printf(" -D raise debugging level\n"); @@ -89,7 +89,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c printf(" -h display this help\n"); printf(" -r chroots to \n"); printf(" -q raise log level threshold\n"); -@@ -882,7 +883,7 @@ void check_perms(const char *fn) +@@ -890,7 +891,7 @@ void check_perms(const char *fn) int main(int argc, char **argv) { @@ -98,7 +98,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c char *chroot_path = NULL; const char *user = RUN_AS_USER; struct passwd *new_uid = NULL; -@@ -898,7 +899,7 @@ int main(int argc, char **argv) +@@ -906,7 +907,7 @@ int main(int argc, char **argv) printf("Network UPS Tools %s %s\n", progname, UPS_VERSION); @@ -107,7 +107,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c switch (i) { case 'h': help(progname); -@@ -936,6 +937,10 @@ int main(int argc, char **argv) +@@ -944,6 +945,10 @@ int main(int argc, char **argv) nut_debug_level++; break; @@ -118,7 +118,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c case '4': opt_af = AF_INET; break; -@@ -1023,7 +1028,7 @@ int main(int argc, char **argv) +@@ -1031,7 +1036,7 @@ int main(int argc, char **argv) /* handle upsd.users */ user_load(); diff --git a/nut-2.6.5-pthreadfix.patch b/nut-2.6.5-pthreadfix.patch index 9aca92b..a471c99 100644 --- a/nut-2.6.5-pthreadfix.patch +++ b/nut-2.6.5-pthreadfix.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.6.5/tools/nut-scanner/nut-scanner.c ---- nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix 2012-09-06 13:25:03.856936357 +0200 -+++ nut-2.6.5/tools/nut-scanner/nut-scanner.c 2012-09-06 13:25:03.881936493 +0200 -@@ -434,22 +434,22 @@ display_help: +diff -up nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.7.1/tools/nut-scanner/nut-scanner.c +--- nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix 2014-02-27 11:37:57.045786437 +0100 ++++ nut-2.7.1/tools/nut-scanner/nut-scanner.c 2014-02-27 11:39:02.591326696 +0100 +@@ -532,25 +532,25 @@ display_help: } #ifdef HAVE_PTHREAD @@ -29,4 +29,8 @@ diff -up nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.6.5/tools/nu + if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) { pthread_join(thread[TYPE_IPMI],NULL); } +- if (allow_eaton_serial) { ++ if (allow_eaton_serial && thread[TYPE_EATON_SERIAL]) { + pthread_join(thread[TYPE_EATON_SERIAL],NULL); + } #endif /* HAVE_PTHREAD */ diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch index 8330518..d815df6 100644 --- a/nut-2.6.5-quickfix.patch +++ b/nut-2.6.5-quickfix.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/configure.in.quickfix nut-2.6.5/configure.in ---- nut-2.6.5/configure.in.quickfix 2012-08-10 14:19:55.924431026 +0200 -+++ nut-2.6.5/configure.in 2012-08-10 14:20:13.332566508 +0200 -@@ -986,9 +986,8 @@ dnl Override installation directory, wit +diff -up nut-2.7.1/configure.in.quickfix nut-2.7.1/configure.in +--- nut-2.7.1/configure.in.quickfix 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/configure.in 2014-02-27 11:25:57.608869497 +0100 +@@ -1027,9 +1027,8 @@ dnl Override installation directory, wit dnl prefix. This is needed for 'distcheck*' targets, otherwise dnl files will try to get intalled to the actual system directories if test -n "${systemdsystemunitdir}"; then diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index ada8d70..3041c6d 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/clients/upsmon.c.rmpidf nut-2.6.5/clients/upsmon.c ---- nut-2.6.5/clients/upsmon.c.rmpidf 2013-02-28 12:08:34.487394359 +0100 -+++ nut-2.6.5/clients/upsmon.c 2013-02-28 12:08:34.494394419 +0100 -@@ -2037,6 +2037,7 @@ int main(int argc, char *argv[]) +diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c +--- nut-2.7.1/clients/upsmon.c.rmpidf 2014-02-27 11:41:09.139369295 +0100 ++++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:41:09.145369344 +0100 +@@ -2027,6 +2027,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); upsmon_cleanup(); @@ -9,9 +9,9 @@ diff -up nut-2.6.5/clients/upsmon.c.rmpidf nut-2.6.5/clients/upsmon.c exit(EXIT_SUCCESS); } -diff -up nut-2.6.5/common/common.c.rmpidf nut-2.6.5/common/common.c ---- nut-2.6.5/common/common.c.rmpidf 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/common/common.c 2013-02-28 12:08:34.494394419 +0100 +diff -up nut-2.7.1/common/common.c.rmpidf nut-2.7.1/common/common.c +--- nut-2.7.1/common/common.c.rmpidf 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/common/common.c 2014-02-27 11:41:09.146369353 +0100 @@ -229,6 +229,20 @@ void writepid(const char *name) umask(mask); } @@ -33,10 +33,10 @@ diff -up nut-2.6.5/common/common.c.rmpidf nut-2.6.5/common/common.c /* open pidfn, get the pid, then send it sig */ int sendsignalfn(const char *pidfn, int sig) { -diff -up nut-2.6.5/include/common.h.rmpidf nut-2.6.5/include/common.h ---- nut-2.6.5/include/common.h.rmpidf 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/include/common.h 2013-02-28 12:08:34.495394429 +0100 -@@ -64,6 +64,9 @@ void chroot_start(const char *path); +diff -up nut-2.7.1/include/common.h.rmpidf nut-2.7.1/include/common.h +--- nut-2.7.1/include/common.h.rmpidf 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/include/common.h 2014-02-27 11:41:09.146369353 +0100 +@@ -70,6 +70,9 @@ void chroot_start(const char *path); /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); @@ -46,11 +46,11 @@ diff -up nut-2.6.5/include/common.h.rmpidf nut-2.6.5/include/common.h /* send a signal to another running process */ int sendsignal(const char *progname, int sig); -diff -up nut-2.6.5/server/upsd.c.rmpidf nut-2.6.5/server/upsd.c ---- nut-2.6.5/server/upsd.c.rmpidf 2013-02-28 12:08:37.967424582 +0100 -+++ nut-2.6.5/server/upsd.c 2013-02-28 12:08:37.982424720 +0100 -@@ -1040,6 +1040,7 @@ int main(int argc, char **argv) - } +diff -up nut-2.7.1/server/upsd.c.rmpidf nut-2.7.1/server/upsd.c +--- nut-2.7.1/server/upsd.c.rmpidf 2014-02-27 11:41:09.146369353 +0100 ++++ nut-2.7.1/server/upsd.c 2014-02-27 11:42:03.715818754 +0100 +@@ -1050,6 +1050,7 @@ int main(int argc, char **argv) + ssl_cleanup(); upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); + if (*pidfn) cleanpid(pidfn); diff --git a/nut.spec b/nut.spec index 9b9b92a..d56b630 100644 --- a/nut.spec +++ b/nut.spec @@ -12,12 +12,12 @@ Summary: Network UPS Tools Name: nut -Version: 2.6.5 -Release: 16%{?dist} +Version: 2.7.1 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.6/%{name}-%{version}.tar.gz +Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz Source3: nut-client.tmpfiles Source4: libs.sh Patch1: nut-2.6.3-tmpfiles.patch @@ -122,7 +122,7 @@ necessary to develop NUT client applications. %setup -q %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix -%patch4 -p1 -b .ipmifix +#%patch4 -p1 -b .ipmifix %patch5 -p1 -b .dlfix %patch6 -p1 -b .pthreadfix %patch7 -p1 -b .foreground @@ -159,8 +159,8 @@ autoreconf -i --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=/lib/udev \ - --libdir=%{_libdir} -# --with-doc \ asciidoc >= 8.6.3 is required + --libdir=%{_libdir} +# --with-doc # does not work in 2.7.1 sh %{SOURCE4} >>include/config.h @@ -300,25 +300,14 @@ rm -rf %{buildroot} %{_libdir}/libnutscan.so.* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list -%{_mandir}/man3/nutscan_add_device_to_device.3.gz -%{_mandir}/man3/nutscan_add_option_to_device.3.gz -%{_mandir}/man3/nutscan_cidr_to_ip.3.gz -%{_mandir}/man3/nutscan_display_parsable.3.gz -%{_mandir}/man3/nutscan_display_ups_conf.3.gz -%{_mandir}/man3/nutscan_free_device.3.gz -%{_mandir}/man3/nutscan_new_device.3.gz -%{_mandir}/man3/nutscan_scan_avahi.3.gz -%{_mandir}/man3/nutscan_scan_ipmi.3.gz -%{_mandir}/man3/nutscan_scan_nut.3.gz -%{_mandir}/man3/nutscan_scan_snmp.3.gz -%{_mandir}/man3/nutscan_scan_usb.3.gz -%{_mandir}/man3/nutscan_scan_xml_http.3.gz %{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/ups.conf.5.gz %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz +%{_mandir}/man8/al175.8.gz %{_mandir}/man8/apcsmart.8.gz %{_mandir}/man8/apcsmart-old.8.gz +%{_mandir}/man8/apcupsd-ups.8.gz %{_mandir}/man8/bcmxcp.8* %{_mandir}/man8/bcmxcp_usb.8.gz %{_mandir}/man8/belkin.8.gz @@ -327,7 +316,8 @@ rm -rf %{buildroot} %{_mandir}/man8/bestfortress.8.gz %{_mandir}/man8/bestups.8.gz %{_mandir}/man8/bestuferrups.8.gz -%{_mandir}/man8/blazer.8.gz +%{_mandir}/man8/blazer_ser.8.gz +%{_mandir}/man8/blazer_usb.8.gz %{_mandir}/man8/clone.8.gz %{_mandir}/man8/dummy-ups.8.gz %{_mandir}/man8/everups.8.gz @@ -347,6 +337,7 @@ rm -rf %{buildroot} %{_mandir}/man8/nut-ipmipsu.8.gz %{_mandir}/man8/nut-recorder.8.gz %{_mandir}/man8/nut-scanner.8.gz +%{_mandir}/man8/nutdrv_qx.8.gz %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz %{_mandir}/man8/powercom.8.gz @@ -354,6 +345,8 @@ rm -rf %{buildroot} %{_mandir}/man8/powerpanel.8.gz %{_mandir}/man8/rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz +%{_mandir}/man8/riello_ser.8.gz +%{_mandir}/man8/riello_usb.8.gz %{_mandir}/man8/safenet.8.gz %{_mandir}/man8/snmp-ups.8.gz %{_mandir}/man8/solis.8* @@ -387,6 +380,7 @@ rm -rf %{buildroot} %{_unitdir}/nut-monitor.service /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* +%{_libdir}/libnutclient.so.* %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz %{_mandir}/man8/upsc.8.gz @@ -424,12 +418,19 @@ rm -rf %{buildroot} %{_includedir}/* %{_mandir}/man3/upscli* %{_mandir}/man3/nutscan* +%{_mandir}/man3/nutclient* +%{_mandir}/man3/libnutclient* %{_libdir}/libupsclient.so +%{_libdir}/libnutclient.so %{_libdir}/libnutscan.so %{_libdir}/pkgconfig/libupsclient.pc +%{_libdir}/pkgconfig/libnutclient.pc %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Feb 27 2014 Michal Hlavinka - 2.7.1-1 +- nut updated to 2.7.1 + * Tue Sep 24 2013 Michal Hlavinka - 2.6.5-16 - rebuilt with updated freeipmi (1.3.2) diff --git a/sources b/sources index a333d82..c554961 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e6eac4fa04baff0d0a827d64efe81a7e nut-2.6.5.tar.gz +e64cf832063ecd6645683fc2ac2bd564 nut-2.7.1.tar.gz From d6655ef281dbeb55d604241b23e939b7e4582ea2 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 6 Mar 2014 15:01:57 +0100 Subject: [PATCH 008/142] fix undefined references in libupsclient (#1071919) --- nut-2.7.1-fixupslog.patch | 12 ++++++++++++ nut.spec | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 nut-2.7.1-fixupslog.patch diff --git a/nut-2.7.1-fixupslog.patch b/nut-2.7.1-fixupslog.patch new file mode 100644 index 0000000..5c778f6 --- /dev/null +++ b/nut-2.7.1-fixupslog.patch @@ -0,0 +1,12 @@ +diff -up nut-2.7.1/clients/Makefile.am.fixupslog nut-2.7.1/clients/Makefile.am +--- nut-2.7.1/clients/Makefile.am.fixupslog 2013-07-26 21:41:10.000000000 +0200 ++++ nut-2.7.1/clients/Makefile.am 2014-03-06 14:52:09.625634472 +0100 +@@ -45,7 +45,7 @@ upsstats_cgi_SOURCES = upsstats.c upscli + upsimagearg.h cgilib.c cgilib.h + + # not LDADD. +-libupsclient_la_SOURCES = upsclient.c upsclient.h ++libupsclient_la_SOURCES = upsclient.c ../common/common.c upsclient.h + libupsclient_la_LIBADD = ../common/libparseconf.la + if WITH_SSL + libupsclient_la_LIBADD += $(LIBSSL_LIBS) diff --git a/nut.spec b/nut.spec index d56b630..824e4a8 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.1 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -30,6 +30,9 @@ Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch +# libupsclient.so contains undefined reference to upslogx,upslog_with_errno,upsdebugx +# link it with common.c containing above functions, rhbz#1071919 +Patch10: nut-2.7.1-fixupslog.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -128,6 +131,7 @@ necessary to develop NUT client applications. %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf +%patch10 -p1 -b .fixupslog sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -428,6 +432,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Mar 06 2014 Michal Hlavinka - 2.7.1-2 +- fix undefined references in libupsclient (#1071919) + * Thu Feb 27 2014 Michal Hlavinka - 2.7.1-1 - nut updated to 2.7.1 From ef206e9d2f3fca4be167cbf2b519479efeb10040 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 6 Mar 2014 15:51:32 +0100 Subject: [PATCH 009/142] fix path of nut-driver executable (#1072076) - fix location of udev rules --- nut-2.7.1-systemdfix.patch | 13 +++++++++++++ nut.spec | 18 ++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 nut-2.7.1-systemdfix.patch diff --git a/nut-2.7.1-systemdfix.patch b/nut-2.7.1-systemdfix.patch new file mode 100644 index 0000000..42dcd7c --- /dev/null +++ b/nut-2.7.1-systemdfix.patch @@ -0,0 +1,13 @@ +diff -up nut-2.7.1/scripts/systemd/nut-driver.service.in.systemdfix nut-2.7.1/scripts/systemd/nut-driver.service.in +--- nut-2.7.1/scripts/systemd/nut-driver.service.in.systemdfix 2013-07-26 21:41:11.000000000 +0200 ++++ nut-2.7.1/scripts/systemd/nut-driver.service.in 2012-07-31 19:38:56.000000000 +0200 +@@ -4,7 +4,7 @@ After=local-fs.target network.target + StopWhenUnneeded=yes + + [Service] +-ExecStart=@DRVPATH@/upsdrvctl start +-ExecStop=@DRVPATH@/upsdrvctl stop ++ExecStart=@driverexecdir@/upsdrvctl start ++ExecStop=@driverexecdir@/upsdrvctl stop + Type=forking + diff --git a/nut.spec b/nut.spec index 824e4a8..aac92f6 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.1 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -33,6 +33,7 @@ Patch9: nut-2.6.5-rmpidf.patch # libupsclient.so contains undefined reference to upslogx,upslog_with_errno,upsdebugx # link it with common.c containing above functions, rhbz#1071919 Patch10: nut-2.7.1-fixupslog.patch +Patch11: nut-2.7.1-systemdfix.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -132,6 +133,7 @@ necessary to develop NUT client applications. %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf %patch10 -p1 -b .fixupslog +%patch11 -p1 -b .systemdfix sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -162,7 +164,7 @@ autoreconf -i --with-systemdsystemunitdir=%{_unitdir} \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ - --with-udev-dir=/lib/udev \ + --with-udev-dir=%{_usr}/lib/udev \ --libdir=%{_libdir} # --with-doc # does not work in 2.7.1 @@ -204,8 +206,8 @@ done popd #fix collision with virtualbox -mv %{buildroot}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/lib/udev/rules.d/62-nut-usbups.rules -mv %{buildroot}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/lib/udev/rules.d/62-nut-ipmipsu.rules +mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules +mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules # fix encoding for fe in ./docs/cables/powerware.txt @@ -292,8 +294,8 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users -%attr(644,root,root) /lib/udev/rules.d/62-nut-usbups.rules -%attr(644,root,root) /lib/udev/rules.d/62-nut-ipmipsu.rules +%attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules +%attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver.service @@ -432,6 +434,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Mar 06 2014 Michal Hlavinka - 2.7.1-3 +- fix path of nut-driver executable (#1072076) +- fix location of udev rules + * Thu Mar 06 2014 Michal Hlavinka - 2.7.1-2 - fix undefined references in libupsclient (#1071919) From f6becc5e5017e8bf97e682617ddd580f8c109171 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 17 Apr 2014 08:53:45 +0200 Subject: [PATCH 010/142] fix multilib issue (#831429) --- nut.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index aac92f6..04783b5 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.1 -Release: 3%{?dist} +Release: 4%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -145,6 +145,9 @@ do sed -i 's/\r\n*$//' $f done +# workaround for multilib conflicts - caused by patch changing modification time of scripts +find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} + %build autoreconf -i %configure \ @@ -434,6 +437,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Apr 17 2014 Michal Hlavinka - 2.7.1-4 +- fix multilib issue (#831429) + * Thu Mar 06 2014 Michal Hlavinka - 2.7.1-3 - fix path of nut-driver executable (#1072076) - fix location of udev rules From 26e358b74474e430fabec617a1711187ef8a0eb9 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 17 Apr 2014 09:47:25 +0200 Subject: [PATCH 011/142] fix multilib issue (#831429) --- nut.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 83e25f4..4b87d2c 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.6.5 -Release: 12%{?dist} +Release: 13%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -139,6 +139,9 @@ do sed -i 's/\r\n*$//' $f done +# workaround for multilib conflicts - caused by patch changing modification time of scripts +find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} + %build autoreconf -i %configure \ @@ -430,6 +433,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Apr 17 2014 Michal Hlavinka - 2.6.5-13 +- fix multilib issue (#831429) + * Mon Apr 22 2013 Michal Hlavinka - 2.6.5-12 - do not let upsmon run during update (#916472) - make binaries hardened (#955157) From 153ff17ed8ecddc1edc34d999e78a384eb366fb3 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 22 Apr 2014 15:50:06 +0200 Subject: [PATCH 012/142] nut updated to 2.7.2 --- .gitignore | 1 + nut-2.6.5-quickfix.patch | 6 +++--- nut-2.7.1-fixupslog.patch | 12 ------------ nut-2.7.1-systemdfix.patch | 13 ------------- nut.spec | 20 ++++++++++---------- sources | 2 +- 6 files changed, 15 insertions(+), 39 deletions(-) delete mode 100644 nut-2.7.1-fixupslog.patch delete mode 100644 nut-2.7.1-systemdfix.patch diff --git a/.gitignore b/.gitignore index 67b2231..e21a10c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ nut-2.4.3.tar.gz /nut-2.6.4.tar.gz /nut-2.6.5.tar.gz /nut-2.7.1.tar.gz +/nut-2.7.2.tar.gz diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch index d815df6..c5b8038 100644 --- a/nut-2.6.5-quickfix.patch +++ b/nut-2.6.5-quickfix.patch @@ -1,6 +1,6 @@ -diff -up nut-2.7.1/configure.in.quickfix nut-2.7.1/configure.in ---- nut-2.7.1/configure.in.quickfix 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/configure.in 2014-02-27 11:25:57.608869497 +0100 +diff -up nut-2.7.1/configure.ac.quickfix nut-2.7.1/configure.ac +--- nut-2.7.1/configure.ac.quickfix 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/configure.ac 2014-02-27 11:25:57.608869497 +0100 @@ -1027,9 +1027,8 @@ dnl Override installation directory, wit dnl prefix. This is needed for 'distcheck*' targets, otherwise dnl files will try to get intalled to the actual system directories diff --git a/nut-2.7.1-fixupslog.patch b/nut-2.7.1-fixupslog.patch deleted file mode 100644 index 5c778f6..0000000 --- a/nut-2.7.1-fixupslog.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up nut-2.7.1/clients/Makefile.am.fixupslog nut-2.7.1/clients/Makefile.am ---- nut-2.7.1/clients/Makefile.am.fixupslog 2013-07-26 21:41:10.000000000 +0200 -+++ nut-2.7.1/clients/Makefile.am 2014-03-06 14:52:09.625634472 +0100 -@@ -45,7 +45,7 @@ upsstats_cgi_SOURCES = upsstats.c upscli - upsimagearg.h cgilib.c cgilib.h - - # not LDADD. --libupsclient_la_SOURCES = upsclient.c upsclient.h -+libupsclient_la_SOURCES = upsclient.c ../common/common.c upsclient.h - libupsclient_la_LIBADD = ../common/libparseconf.la - if WITH_SSL - libupsclient_la_LIBADD += $(LIBSSL_LIBS) diff --git a/nut-2.7.1-systemdfix.patch b/nut-2.7.1-systemdfix.patch deleted file mode 100644 index 42dcd7c..0000000 --- a/nut-2.7.1-systemdfix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up nut-2.7.1/scripts/systemd/nut-driver.service.in.systemdfix nut-2.7.1/scripts/systemd/nut-driver.service.in ---- nut-2.7.1/scripts/systemd/nut-driver.service.in.systemdfix 2013-07-26 21:41:11.000000000 +0200 -+++ nut-2.7.1/scripts/systemd/nut-driver.service.in 2012-07-31 19:38:56.000000000 +0200 -@@ -4,7 +4,7 @@ After=local-fs.target network.target - StopWhenUnneeded=yes - - [Service] --ExecStart=@DRVPATH@/upsdrvctl start --ExecStop=@DRVPATH@/upsdrvctl stop -+ExecStart=@driverexecdir@/upsdrvctl start -+ExecStop=@driverexecdir@/upsdrvctl stop - Type=forking - diff --git a/nut.spec b/nut.spec index 04783b5..293bbcb 100644 --- a/nut.spec +++ b/nut.spec @@ -4,7 +4,7 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /var/run/nut -%global modeldir /sbin +%global modeldir /usr/sbin %if ! (0%{?fedora} > 12 || 0%{?rhel} > 6) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} @@ -12,8 +12,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.7.1 -Release: 4%{?dist} +Version: 2.7.2 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -30,10 +30,6 @@ Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -# libupsclient.so contains undefined reference to upslogx,upslog_with_errno,upsdebugx -# link it with common.c containing above functions, rhbz#1071919 -Patch10: nut-2.7.1-fixupslog.patch -Patch11: nut-2.7.1-systemdfix.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -132,8 +128,8 @@ necessary to develop NUT client applications. %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -%patch10 -p1 -b .fixupslog -%patch11 -p1 -b .systemdfix +#%patch10 -p1 -b .fixupslog +#%patch11 -p1 -b .systemdfix sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -142,7 +138,7 @@ sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in #fix crlf end of lines for f in docs/nut-qa.txt docs/website/css/ie-overrides.css docs/website/scripts/filter_png.js do - sed -i 's/\r\n*$//' $f + sed -i 's/\r\n*$//' $f ||: done # workaround for multilib conflicts - caused by patch changing modification time of scripts @@ -343,6 +339,7 @@ rm -rf %{buildroot} %{_mandir}/man8/mge-utalk.8.gz %{_mandir}/man8/mge-shut.8.gz %{_mandir}/man8/nutupsdrv.8.gz +%{_mandir}/man8/nutdrv_atcl_usb.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz %{_mandir}/man8/nut-recorder.8.gz %{_mandir}/man8/nut-scanner.8.gz @@ -437,6 +434,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Apr 22 2014 Michal Hlavinka - 2.7.2-1 +- nut updated to 2.7.2 + * Thu Apr 17 2014 Michal Hlavinka - 2.7.1-4 - fix multilib issue (#831429) diff --git a/sources b/sources index c554961..e01f451 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e64cf832063ecd6645683fc2ac2bd564 nut-2.7.1.tar.gz +c3568b42e058cfc385b46d25140dced4 nut-2.7.2.tar.gz From 0435df003113fb0aa4984736bd015b9731dc9f67 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 10:18:03 -0500 Subject: [PATCH 013/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 293bbcb..01edd93 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -434,6 +434,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 2.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Tue Apr 22 2014 Michal Hlavinka - 2.7.2-1 - nut updated to 2.7.2 From 8471d1bdb15920eaa82e231b9e1e460a85578db6 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 12:31:23 +0000 Subject: [PATCH 014/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 01edd93..efe90fc 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -434,6 +434,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 2.7.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 2.7.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From b7ef114c39b6be410b8dd5162af299af1fc989a0 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 20 Aug 2014 16:28:16 +0200 Subject: [PATCH 015/142] nut updated to 2.7.2 --- .gitignore | 2 + nut-2.6.5-dlfix.patch | 44 +++++++++--------- nut-2.6.5-foreground.patch | 44 +++++++++--------- nut-2.6.5-pthreadfix.patch | 12 +++-- nut-2.6.5-quickfix.patch | 8 ++-- nut-2.6.5-rmpidf.patch | 32 ++++++------- nut.spec | 94 ++++++++++++++++++++++++-------------- sources | 2 +- 8 files changed, 135 insertions(+), 103 deletions(-) diff --git a/.gitignore b/.gitignore index 8d08d5f..e21a10c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ nut-2.4.3.tar.gz /nut-2.6.3.tar.gz /nut-2.6.4.tar.gz /nut-2.6.5.tar.gz +/nut-2.7.1.tar.gz +/nut-2.7.2.tar.gz diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch index 9198f65..4375324 100644 --- a/nut-2.6.5-dlfix.patch +++ b/nut-2.6.5-dlfix.patch @@ -1,6 +1,6 @@ -diff -up nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_avahi.c ---- nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_avahi.c 2012-09-06 12:56:45.383206759 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_avahi.c +--- nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_avahi.c 2014-02-27 11:25:57.610869514 +0100 @@ -36,7 +36,7 @@ #include @@ -19,11 +19,11 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix nut-2.6.5/tools/nut-scan if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_ipmi.c ---- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-06 12:56:55.760402197 +0200 -@@ -30,7 +30,7 @@ - #define NUT_IPMI_DRV_NAME "nut-ipmipsu" +diff -up nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_ipmi.c +--- nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_ipmi.c 2014-02-27 11:32:20.393015238 +0100 +@@ -35,7 +35,7 @@ + #define IPMI_RETRANSMISSION_TIMEOUT_LENGTH_DEFAULT 250 /* dynamic link library stuff */ -static char * libname = "libfreeipmi"; @@ -31,7 +31,7 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scann static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -83,7 +83,7 @@ int nutscan_load_ipmi_library() +@@ -128,7 +128,7 @@ int nutscan_load_ipmi_library() return 0; } @@ -40,9 +40,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scann if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanner/scan_nut.c ---- nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_nut.c 2012-09-06 12:54:59.308897430 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.1/tools/nut-scanner/scan_nut.c +--- nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix 2013-10-30 14:47:15.000000000 +0100 ++++ nut-2.7.1/tools/nut-scanner/scan_nut.c 2014-02-27 11:25:57.611869522 +0100 @@ -26,7 +26,7 @@ #include @@ -52,7 +52,7 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanne static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -66,7 +66,7 @@ int nutscan_load_upsclient_library() +@@ -67,7 +67,7 @@ int nutscan_load_upsclient_library() return 0; } @@ -61,9 +61,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanne if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix nut-2.6.5/tools/nut-scanner/scan_snmp.c ---- nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_snmp.c 2012-09-06 12:57:16.250774817 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.1/tools/nut-scanner/scan_snmp.c +--- nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_snmp.c 2014-02-27 11:25:57.611869522 +0100 @@ -74,7 +74,7 @@ static int thread_count = 0; long g_usec_timeout ; @@ -82,9 +82,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix nut-2.6.5/tools/nut-scann if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix nut-2.6.5/tools/nut-scanner/scan_usb.c ---- nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_usb.c 2012-09-06 12:56:34.007987045 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.1/tools/nut-scanner/scan_usb.c +--- nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_usb.c 2014-02-27 11:25:57.611869522 +0100 @@ -28,7 +28,7 @@ #include @@ -103,9 +103,9 @@ diff -up nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix nut-2.6.5/tools/nut-scanne if (!dl_handle) { dl_error = lt_dlerror(); goto err; -diff -up nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.6.5/tools/nut-scanner/scan_xml_http.c ---- nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_xml_http.c 2012-09-06 12:57:28.617991656 +0200 +diff -up nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.1/tools/nut-scanner/scan_xml_http.c +--- nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix 2013-07-31 22:41:31.000000000 +0200 ++++ nut-2.7.1/tools/nut-scanner/scan_xml_http.c 2014-02-27 11:25:57.611869522 +0100 @@ -33,7 +33,7 @@ #include diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch index 639cc54..ce1570c 100644 --- a/nut-2.6.5-foreground.patch +++ b/nut-2.6.5-foreground.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c ---- nut-2.6.5/clients/upsmon.c.foreground 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/clients/upsmon.c 2012-09-11 17:54:55.109343036 +0200 -@@ -1659,6 +1659,7 @@ static void help(const char *progname) +diff -up nut-2.7.1/clients/upsmon.c.foreground nut-2.7.1/clients/upsmon.c +--- nut-2.7.1/clients/upsmon.c.foreground 2013-07-26 21:41:10.000000000 +0200 ++++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:39:58.158784578 +0100 +@@ -1645,6 +1645,7 @@ static void help(const char *progname) printf(" - reload: reread configuration\n"); printf(" - stop: stop monitoring and exit\n"); printf(" -D raise debugging level\n"); @@ -9,7 +9,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c printf(" -h display this help\n"); printf(" -K checks POWERDOWNFLAG, sets exit code to 0 if set\n"); printf(" -p always run privileged (disable privileged parent)\n"); -@@ -1873,7 +1874,7 @@ static void check_parent(void) +@@ -1859,7 +1860,7 @@ static void check_parent(void) int main(int argc, char *argv[]) { const char *prog = xbasename(argv[0]); @@ -18,7 +18,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c printf("Network UPS Tools %s %s\n", prog, UPS_VERSION); -@@ -1884,7 +1885,7 @@ int main(int argc, char *argv[]) +@@ -1870,7 +1871,7 @@ int main(int argc, char *argv[]) run_as_user = xstrdup(RUN_AS_USER); @@ -27,7 +27,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c switch (i) { case 'c': if (!strncmp(optarg, "fsd", strlen(optarg))) -@@ -1901,6 +1902,9 @@ int main(int argc, char *argv[]) +@@ -1887,6 +1888,9 @@ int main(int argc, char *argv[]) case 'D': nut_debug_level++; break; @@ -37,7 +37,7 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c case 'f': free(configfile); configfile = xstrdup(optarg); -@@ -1976,9 +1980,9 @@ int main(int argc, char *argv[]) +@@ -1962,9 +1966,9 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } @@ -49,9 +49,9 @@ diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c upsdebugx(1, "debug level is '%d'", nut_debug_level); } -diff -up nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground nut-2.6.5/scripts/systemd/nut-monitor.service.in ---- nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground 2012-09-11 17:56:05.037920175 +0200 -+++ nut-2.6.5/scripts/systemd/nut-monitor.service.in 2012-09-11 17:56:05.038920183 +0200 +diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/scripts/systemd/nut-monitor.service.in +--- nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground 2014-02-27 11:39:58.141784438 +0100 ++++ nut-2.7.1/scripts/systemd/nut-monitor.service.in 2014-02-27 11:39:58.152784529 +0100 @@ -4,9 +4,8 @@ After=local-fs.target network.target nut [Service] @@ -64,9 +64,9 @@ diff -up nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground nut-2.6.5/s [Install] WantedBy=multi-user.target -diff -up nut-2.6.5/scripts/systemd/nut-server.service.in.foreground nut-2.6.5/scripts/systemd/nut-server.service.in ---- nut-2.6.5/scripts/systemd/nut-server.service.in.foreground 2012-09-11 17:56:19.850042294 +0200 -+++ nut-2.6.5/scripts/systemd/nut-server.service.in 2012-09-11 17:56:19.851042303 +0200 +diff -up nut-2.7.1/scripts/systemd/nut-server.service.in.foreground nut-2.7.1/scripts/systemd/nut-server.service.in +--- nut-2.7.1/scripts/systemd/nut-server.service.in.foreground 2013-07-26 21:41:11.000000000 +0200 ++++ nut-2.7.1/scripts/systemd/nut-server.service.in 2014-02-27 11:39:58.152784529 +0100 @@ -5,8 +5,8 @@ Requires=nut-driver.service Before=nut-monitor.service @@ -78,10 +78,10 @@ diff -up nut-2.6.5/scripts/systemd/nut-server.service.in.foreground nut-2.6.5/sc [Install] WantedBy=multi-user.target -diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c ---- nut-2.6.5/server/upsd.c.foreground 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/server/upsd.c 2012-09-11 17:54:55.109343036 +0200 -@@ -819,6 +819,7 @@ static void help(const char *progname) +diff -up nut-2.7.1/server/upsd.c.foreground nut-2.7.1/server/upsd.c +--- nut-2.7.1/server/upsd.c.foreground 2013-07-26 21:41:11.000000000 +0200 ++++ nut-2.7.1/server/upsd.c 2014-02-27 11:39:58.153784537 +0100 +@@ -827,6 +827,7 @@ static void help(const char *progname) printf(" - reload: reread configuration files\n"); printf(" - stop: stop process and exit\n"); printf(" -D raise debugging level\n"); @@ -89,7 +89,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c printf(" -h display this help\n"); printf(" -r chroots to \n"); printf(" -q raise log level threshold\n"); -@@ -882,7 +883,7 @@ void check_perms(const char *fn) +@@ -890,7 +891,7 @@ void check_perms(const char *fn) int main(int argc, char **argv) { @@ -98,7 +98,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c char *chroot_path = NULL; const char *user = RUN_AS_USER; struct passwd *new_uid = NULL; -@@ -898,7 +899,7 @@ int main(int argc, char **argv) +@@ -906,7 +907,7 @@ int main(int argc, char **argv) printf("Network UPS Tools %s %s\n", progname, UPS_VERSION); @@ -107,7 +107,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c switch (i) { case 'h': help(progname); -@@ -936,6 +937,10 @@ int main(int argc, char **argv) +@@ -944,6 +945,10 @@ int main(int argc, char **argv) nut_debug_level++; break; @@ -118,7 +118,7 @@ diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c case '4': opt_af = AF_INET; break; -@@ -1023,7 +1028,7 @@ int main(int argc, char **argv) +@@ -1031,7 +1036,7 @@ int main(int argc, char **argv) /* handle upsd.users */ user_load(); diff --git a/nut-2.6.5-pthreadfix.patch b/nut-2.6.5-pthreadfix.patch index 9aca92b..a471c99 100644 --- a/nut-2.6.5-pthreadfix.patch +++ b/nut-2.6.5-pthreadfix.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.6.5/tools/nut-scanner/nut-scanner.c ---- nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix 2012-09-06 13:25:03.856936357 +0200 -+++ nut-2.6.5/tools/nut-scanner/nut-scanner.c 2012-09-06 13:25:03.881936493 +0200 -@@ -434,22 +434,22 @@ display_help: +diff -up nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.7.1/tools/nut-scanner/nut-scanner.c +--- nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix 2014-02-27 11:37:57.045786437 +0100 ++++ nut-2.7.1/tools/nut-scanner/nut-scanner.c 2014-02-27 11:39:02.591326696 +0100 +@@ -532,25 +532,25 @@ display_help: } #ifdef HAVE_PTHREAD @@ -29,4 +29,8 @@ diff -up nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.6.5/tools/nu + if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) { pthread_join(thread[TYPE_IPMI],NULL); } +- if (allow_eaton_serial) { ++ if (allow_eaton_serial && thread[TYPE_EATON_SERIAL]) { + pthread_join(thread[TYPE_EATON_SERIAL],NULL); + } #endif /* HAVE_PTHREAD */ diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch index 8330518..c5b8038 100644 --- a/nut-2.6.5-quickfix.patch +++ b/nut-2.6.5-quickfix.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/configure.in.quickfix nut-2.6.5/configure.in ---- nut-2.6.5/configure.in.quickfix 2012-08-10 14:19:55.924431026 +0200 -+++ nut-2.6.5/configure.in 2012-08-10 14:20:13.332566508 +0200 -@@ -986,9 +986,8 @@ dnl Override installation directory, wit +diff -up nut-2.7.1/configure.ac.quickfix nut-2.7.1/configure.ac +--- nut-2.7.1/configure.ac.quickfix 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/configure.ac 2014-02-27 11:25:57.608869497 +0100 +@@ -1027,9 +1027,8 @@ dnl Override installation directory, wit dnl prefix. This is needed for 'distcheck*' targets, otherwise dnl files will try to get intalled to the actual system directories if test -n "${systemdsystemunitdir}"; then diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index ada8d70..3041c6d 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/clients/upsmon.c.rmpidf nut-2.6.5/clients/upsmon.c ---- nut-2.6.5/clients/upsmon.c.rmpidf 2013-02-28 12:08:34.487394359 +0100 -+++ nut-2.6.5/clients/upsmon.c 2013-02-28 12:08:34.494394419 +0100 -@@ -2037,6 +2037,7 @@ int main(int argc, char *argv[]) +diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c +--- nut-2.7.1/clients/upsmon.c.rmpidf 2014-02-27 11:41:09.139369295 +0100 ++++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:41:09.145369344 +0100 +@@ -2027,6 +2027,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); upsmon_cleanup(); @@ -9,9 +9,9 @@ diff -up nut-2.6.5/clients/upsmon.c.rmpidf nut-2.6.5/clients/upsmon.c exit(EXIT_SUCCESS); } -diff -up nut-2.6.5/common/common.c.rmpidf nut-2.6.5/common/common.c ---- nut-2.6.5/common/common.c.rmpidf 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/common/common.c 2013-02-28 12:08:34.494394419 +0100 +diff -up nut-2.7.1/common/common.c.rmpidf nut-2.7.1/common/common.c +--- nut-2.7.1/common/common.c.rmpidf 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/common/common.c 2014-02-27 11:41:09.146369353 +0100 @@ -229,6 +229,20 @@ void writepid(const char *name) umask(mask); } @@ -33,10 +33,10 @@ diff -up nut-2.6.5/common/common.c.rmpidf nut-2.6.5/common/common.c /* open pidfn, get the pid, then send it sig */ int sendsignalfn(const char *pidfn, int sig) { -diff -up nut-2.6.5/include/common.h.rmpidf nut-2.6.5/include/common.h ---- nut-2.6.5/include/common.h.rmpidf 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/include/common.h 2013-02-28 12:08:34.495394429 +0100 -@@ -64,6 +64,9 @@ void chroot_start(const char *path); +diff -up nut-2.7.1/include/common.h.rmpidf nut-2.7.1/include/common.h +--- nut-2.7.1/include/common.h.rmpidf 2013-11-20 20:53:31.000000000 +0100 ++++ nut-2.7.1/include/common.h 2014-02-27 11:41:09.146369353 +0100 +@@ -70,6 +70,9 @@ void chroot_start(const char *path); /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); @@ -46,11 +46,11 @@ diff -up nut-2.6.5/include/common.h.rmpidf nut-2.6.5/include/common.h /* send a signal to another running process */ int sendsignal(const char *progname, int sig); -diff -up nut-2.6.5/server/upsd.c.rmpidf nut-2.6.5/server/upsd.c ---- nut-2.6.5/server/upsd.c.rmpidf 2013-02-28 12:08:37.967424582 +0100 -+++ nut-2.6.5/server/upsd.c 2013-02-28 12:08:37.982424720 +0100 -@@ -1040,6 +1040,7 @@ int main(int argc, char **argv) - } +diff -up nut-2.7.1/server/upsd.c.rmpidf nut-2.7.1/server/upsd.c +--- nut-2.7.1/server/upsd.c.rmpidf 2014-02-27 11:41:09.146369353 +0100 ++++ nut-2.7.1/server/upsd.c 2014-02-27 11:42:03.715818754 +0100 +@@ -1050,6 +1050,7 @@ int main(int argc, char **argv) + ssl_cleanup(); upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); + if (*pidfn) cleanpid(pidfn); diff --git a/nut.spec b/nut.spec index 4b87d2c..293bbcb 100644 --- a/nut.spec +++ b/nut.spec @@ -4,7 +4,7 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /var/run/nut -%global modeldir /sbin +%global modeldir /usr/sbin %if ! (0%{?fedora} > 12 || 0%{?rhel} > 6) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} @@ -12,12 +12,12 @@ Summary: Network UPS Tools Name: nut -Version: 2.6.5 -Release: 13%{?dist} +Version: 2.7.2 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.6/%{name}-%{version}.tar.gz +Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz Source3: nut-client.tmpfiles Source4: libs.sh Patch1: nut-2.6.3-tmpfiles.patch @@ -122,12 +122,14 @@ necessary to develop NUT client applications. %setup -q %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix -%patch4 -p1 -b .ipmifix +#%patch4 -p1 -b .ipmifix %patch5 -p1 -b .dlfix %patch6 -p1 -b .pthreadfix %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf +#%patch10 -p1 -b .fixupslog +#%patch11 -p1 -b .systemdfix sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -136,7 +138,7 @@ sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in #fix crlf end of lines for f in docs/nut-qa.txt docs/website/css/ie-overrides.css docs/website/scripts/filter_png.js do - sed -i 's/\r\n*$//' $f + sed -i 's/\r\n*$//' $f ||: done # workaround for multilib conflicts - caused by patch changing modification time of scripts @@ -161,9 +163,9 @@ autoreconf -i --with-systemdsystemunitdir=%{_unitdir} \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ - --with-udev-dir=/lib/udev \ - --libdir=%{_libdir} -# --with-doc \ asciidoc >= 8.6.3 is required + --with-udev-dir=%{_usr}/lib/udev \ + --libdir=%{_libdir} +# --with-doc # does not work in 2.7.1 sh %{SOURCE4} >>include/config.h @@ -203,8 +205,8 @@ done popd #fix collision with virtualbox -mv %{buildroot}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/lib/udev/rules.d/62-nut-usbups.rules -mv %{buildroot}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/lib/udev/rules.d/62-nut-ipmipsu.rules +mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules +mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules # fix encoding for fe in ./docs/cables/powerware.txt @@ -291,8 +293,8 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users -%attr(644,root,root) /lib/udev/rules.d/62-nut-usbups.rules -%attr(644,root,root) /lib/udev/rules.d/62-nut-ipmipsu.rules +%attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules +%attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver.service @@ -303,25 +305,14 @@ rm -rf %{buildroot} %{_libdir}/libnutscan.so.* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list -%{_mandir}/man3/nutscan_add_device_to_device.3.gz -%{_mandir}/man3/nutscan_add_option_to_device.3.gz -%{_mandir}/man3/nutscan_cidr_to_ip.3.gz -%{_mandir}/man3/nutscan_display_parsable.3.gz -%{_mandir}/man3/nutscan_display_ups_conf.3.gz -%{_mandir}/man3/nutscan_free_device.3.gz -%{_mandir}/man3/nutscan_new_device.3.gz -%{_mandir}/man3/nutscan_scan_avahi.3.gz -%{_mandir}/man3/nutscan_scan_ipmi.3.gz -%{_mandir}/man3/nutscan_scan_nut.3.gz -%{_mandir}/man3/nutscan_scan_snmp.3.gz -%{_mandir}/man3/nutscan_scan_usb.3.gz -%{_mandir}/man3/nutscan_scan_xml_http.3.gz %{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/ups.conf.5.gz %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz +%{_mandir}/man8/al175.8.gz %{_mandir}/man8/apcsmart.8.gz %{_mandir}/man8/apcsmart-old.8.gz +%{_mandir}/man8/apcupsd-ups.8.gz %{_mandir}/man8/bcmxcp.8* %{_mandir}/man8/bcmxcp_usb.8.gz %{_mandir}/man8/belkin.8.gz @@ -330,7 +321,8 @@ rm -rf %{buildroot} %{_mandir}/man8/bestfortress.8.gz %{_mandir}/man8/bestups.8.gz %{_mandir}/man8/bestuferrups.8.gz -%{_mandir}/man8/blazer.8.gz +%{_mandir}/man8/blazer_ser.8.gz +%{_mandir}/man8/blazer_usb.8.gz %{_mandir}/man8/clone.8.gz %{_mandir}/man8/dummy-ups.8.gz %{_mandir}/man8/everups.8.gz @@ -347,9 +339,11 @@ rm -rf %{buildroot} %{_mandir}/man8/mge-utalk.8.gz %{_mandir}/man8/mge-shut.8.gz %{_mandir}/man8/nutupsdrv.8.gz +%{_mandir}/man8/nutdrv_atcl_usb.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz %{_mandir}/man8/nut-recorder.8.gz %{_mandir}/man8/nut-scanner.8.gz +%{_mandir}/man8/nutdrv_qx.8.gz %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz %{_mandir}/man8/powercom.8.gz @@ -357,6 +351,8 @@ rm -rf %{buildroot} %{_mandir}/man8/powerpanel.8.gz %{_mandir}/man8/rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz +%{_mandir}/man8/riello_ser.8.gz +%{_mandir}/man8/riello_usb.8.gz %{_mandir}/man8/safenet.8.gz %{_mandir}/man8/snmp-ups.8.gz %{_mandir}/man8/solis.8* @@ -390,6 +386,7 @@ rm -rf %{buildroot} %{_unitdir}/nut-monitor.service /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* +%{_libdir}/libnutclient.so.* %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz %{_mandir}/man8/upsc.8.gz @@ -427,15 +424,44 @@ rm -rf %{buildroot} %{_includedir}/* %{_mandir}/man3/upscli* %{_mandir}/man3/nutscan* +%{_mandir}/man3/nutclient* +%{_mandir}/man3/libnutclient* %{_libdir}/libupsclient.so +%{_libdir}/libnutclient.so %{_libdir}/libnutscan.so %{_libdir}/pkgconfig/libupsclient.pc +%{_libdir}/pkgconfig/libnutclient.pc %{_libdir}/pkgconfig/libnutscan.pc %changelog -* Thu Apr 17 2014 Michal Hlavinka - 2.6.5-13 +* Tue Apr 22 2014 Michal Hlavinka - 2.7.2-1 +- nut updated to 2.7.2 + +* Thu Apr 17 2014 Michal Hlavinka - 2.7.1-4 - fix multilib issue (#831429) +* Thu Mar 06 2014 Michal Hlavinka - 2.7.1-3 +- fix path of nut-driver executable (#1072076) +- fix location of udev rules + +* Thu Mar 06 2014 Michal Hlavinka - 2.7.1-2 +- fix undefined references in libupsclient (#1071919) + +* Thu Feb 27 2014 Michal Hlavinka - 2.7.1-1 +- nut updated to 2.7.1 + +* Tue Sep 24 2013 Michal Hlavinka - 2.6.5-16 +- rebuilt with updated freeipmi (1.3.2) + +* Tue Sep 03 2013 Michal Hlavinka - 2.6.5-15 +- rebuilt with updated freeipmi + +* Sat Aug 03 2013 Fedora Release Engineering - 2.6.5-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jun 11 2013 Remi Collet - 2.6.5-13 +- rebuild for new GD 2.1.0 + * Mon Apr 22 2013 Michal Hlavinka - 2.6.5-12 - do not let upsmon run during update (#916472) - make binaries hardened (#955157) @@ -552,13 +578,13 @@ rm -rf %{buildroot} - fix issue where nut fails to restart because it did not finished termination yet and old instance blocks devices (#193058) -* Fri Jul 07 2010 Michal Hlavinka - 2.4.3-4 +* Wed Jul 07 2010 Michal Hlavinka - 2.4.3-4 - follow licensing guideline update * Fri Mar 26 2010 Michal Hlavinka - 2.4.3-3 - replace BUS with SUBSYSTEMS in udev rules (#573806) -* Mon Mar 23 2010 Michal Hlavinka - 2.4.3-2 +* Tue Mar 23 2010 Michal Hlavinka - 2.4.3-2 - reduced size of buffer to maximum size supported by low-speed USB devices - fixes #575334 @@ -837,7 +863,7 @@ rm -rf %{buildroot} - update to 0.45.2 - fix bug #57417 -* Mon Nov 27 2001 Than Ngo 0.45.2-1 +* Tue Nov 27 2001 Than Ngo 0.45.2-1 - update to 0.45.2 - clean up some patch files for 0.45.2 @@ -938,13 +964,13 @@ rm -rf %{buildroot} * Mon Dec 6 1999 (0.42.0-7) - removed overlapping files between the nut and nut-client rpms -* Mon Nov 23 1999 (0.42.0-6) +* Tue Nov 23 1999 (0.42.0-6) - stop ups before uninstalling -* Mon Nov 23 1999 (0.42.0-5) +* Tue Nov 23 1999 (0.42.0-5) - build against gd 1.6.3 -* Thu Nov 03 1999 (0.42.0-4) +* Wed Nov 03 1999 (0.42.0-4) - Initial build of nut (well almost). - Removed chmod from the make file so that the package does not have to be built as root..... diff --git a/sources b/sources index a333d82..e01f451 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e6eac4fa04baff0d0a827d64efe81a7e nut-2.6.5.tar.gz +c3568b42e058cfc385b46d25140dced4 nut-2.7.2.tar.gz From 097541dc32301eb8ba12cc406e10fadea9410bbd Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 27 Aug 2014 09:52:57 +0200 Subject: [PATCH 016/142] build without powerman as it is not available in epel7 --- nut.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index 293bbcb..0d27fdd 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -56,7 +56,7 @@ BuildRequires: net-snmp-devel BuildRequires: netpbm-devel BuildRequires: openssl-devel BuildRequires: pkgconfig -BuildRequires: powerman-devel +#BuildRequires: powerman-devel BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel @@ -148,6 +148,7 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} autoreconf -i %configure \ --with-all \ + --without-powerman \ --with-libltdl \ --without-hal \ --with-cgi \ @@ -347,7 +348,7 @@ rm -rf %{buildroot} %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz %{_mandir}/man8/powercom.8.gz -%{_mandir}/man8/powerman-pdu.8.gz +#%{_mandir}/man8/powerman-pdu.8.gz %{_mandir}/man8/powerpanel.8.gz %{_mandir}/man8/rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz @@ -434,6 +435,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Aug 26 2014 Michal Hlavinka - 2.7.2-2 +- build without powerman as it is not available in epel7 + * Tue Apr 22 2014 Michal Hlavinka - 2.7.2-1 - nut updated to 2.7.2 From 4a8e9a8d14e23b1978e8cbca77da3f661924d3d3 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 15 Oct 2014 13:34:08 +0200 Subject: [PATCH 017/142] spec cleanup --- nut-2.6.5-ipmifix.patch | 138 ---------------------------------------- 1 file changed, 138 deletions(-) delete mode 100644 nut-2.6.5-ipmifix.patch diff --git a/nut-2.6.5-ipmifix.patch b/nut-2.6.5-ipmifix.patch deleted file mode 100644 index db7bff8..0000000 --- a/nut-2.6.5-ipmifix.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -up nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix nut-2.6.5/drivers/nut-libfreeipmi.c ---- nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix 2012-07-31 19:38:59.000000000 +0200 -+++ nut-2.6.5/drivers/nut-libfreeipmi.c 2012-09-04 09:42:48.000000000 +0200 -@@ -49,6 +49,36 @@ - #include "nut-ipmi.h" - #include "dstate.h" - -+#ifdef HAVE_FREEIPMI_11X_12X -+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t -+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id -+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy -+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create -+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags -+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id -+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg -+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX -+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS -+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION -+#define IPMI_FRU_PARSE_AREA_TYPE_BOARD_INFO_AREA IPMI_FRU_AREA_TYPE_BOARD_INFO_AREA -+#define ipmi_fru_parse_field_t ipmi_fru_field_t -+#define ipmi_fru_parse_ctx_create ipmi_fru_ctx_create -+#define ipmi_fru_parse_ctx_set_flags ipmi_fru_ctx_set_flags -+#define ipmi_fru_parse_ctx_strerror ipmi_fru_ctx_strerror -+#define ipmi_fru_parse_ctx_errnum ipmi_fru_ctx_errnum -+#define ipmi_fru_parse_open_device_id ipmi_fru_open_device_id -+#define ipmi_fru_parse_ctx_errormsg ipmi_fru_ctx_errormsg -+#define ipmi_fru_parse_read_data_area ipmi_fru_read_data_area -+#define ipmi_fru_parse_type_length_field_to_string ipmi_fru_type_length_field_to_string -+#define ipmi_fru_parse_close_device_id ipmi_fru_close_device_id -+#define ipmi_fru_parse_ctx_destroy ipmi_fru_ctx_destroy -+#define ipmi_fru_parse_multirecord_power_supply_information ipmi_fru_multirecord_power_supply_information -+#define ipmi_fru_parse_board_info_area ipmi_fru_board_info_area -+#define ipmi_fru_parse_next ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_STRING_MAX IPMI_FRU_AREA_STRING_MAX -+#endif -+ - /* FreeIPMI defines */ - #define IPMI_FRU_STR_BUFLEN 1024 - /* haven't seen a motherboard with more than 2-3 so far, -diff -up nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix nut-2.6.5/m4/nut_check_libfreeipmi.m4 ---- nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/m4/nut_check_libfreeipmi.m4 2012-09-04 09:45:45.399328962 +0200 -@@ -66,15 +66,23 @@ if test -z "${nut_have_libfreeipmi_seen} - dnl when version cannot be tested (prior to 1.0.5, with no pkg-config) - dnl we have to check for some specific functions - AC_SEARCH_LIBS([ipmi_ctx_find_inband], [freeipmi], [], [nut_have_freeipmi=no]) -- AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [], [nut_have_freeipmi=no]) - - AC_SEARCH_LIBS([ipmi_monitoring_init], [ipmimonitoring], [nut_have_freeipmi_monitoring=yes], [nut_have_freeipmi_monitoring=no]) - AC_SEARCH_LIBS([ipmi_monitoring_sensor_read_record_id], [ipmimonitoring], [], [nut_have_freeipmi_monitoring=no]) - - dnl Check for FreeIPMI 1.1.X / 1.2.X which implies API changes! -- AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], []) -+ nut_have_freeipmi_old="${nut_have_freeipmi}" -+ AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no]) -+ AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no]) -+ AC_SEARCH_LIBS([ipmi_fru_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no]) - AC_SEARCH_LIBS([ipmi_sdr_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no]) - -+ if test "${nut_have_freeipmi}${nut_have_freeipmi_11x_12x}" = "yesyes"; then -+ AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available]) -+ elif test "${nut_have_freeipmi_old}" = "no"; then -+ nut_have_freeipmi="no" -+ fi -+ - if test "${nut_have_freeipmi}" = "yes"; then - nut_with_ipmi="yes" - nut_ipmi_lib="(FreeIPMI)" -@@ -84,10 +92,6 @@ if test -z "${nut_have_libfreeipmi_seen} - LIBIPMI_LIBS="${LIBS}" - fi - -- if test "${nut_have_freeipmi_11x_12x}" = "yes"; then -- AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available]) -- fi -- - if test "${nut_have_freeipmi_monitoring}" = "yes"; then - AC_DEFINE(HAVE_FREEIPMI_MONITORING, 1, [Define if FreeIPMI monitoring support is available]) - fi -diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix nut-2.6.5/tools/nut-scanner/scan_ipmi.c ---- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-04 09:42:35.000000000 +0200 -@@ -34,24 +34,50 @@ static char * libname = "libfreeipmi"; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - --static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx); --static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx); - #ifdef HAVE_FREEIPMI_11X_12X - static void (*nut_ipmi_sdr_ctx_destroy) (ipmi_sdr_ctx_t ctx); -+static int (*nut_ipmi_fru_close_device_id) (ipmi_fru_ctx_t ctx); -+static void (*nut_ipmi_fru_ctx_destroy) (ipmi_fru_ctx_t ctx); -+static ipmi_fru_ctx_t (*nut_ipmi_fru_ctx_create) (ipmi_ctx_t ipmi_ctx); -+static int (*nut_ipmi_fru_ctx_set_flags) (ipmi_fru_ctx_t ctx, unsigned int flags); -+static int (*nut_ipmi_fru_open_device_id) (ipmi_fru_ctx_t ctx, uint8_t fru_device_id); -+static char * (*nut_ipmi_fru_ctx_errormsg) (ipmi_fru_ctx_t ctx); -+static int (*nut_ipmi_fru_next) (ipmi_fru_ctx_t ctx); - #else /* HAVE_FREEIPMI_11X_12X */ -+static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx); -+static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx); - static void (*nut_ipmi_sdr_cache_ctx_destroy) (ipmi_sdr_cache_ctx_t ctx); - static void (*nut_ipmi_sdr_parse_ctx_destroy) (ipmi_sdr_parse_ctx_t ctx); --#endif /* HAVE_FREEIPMI_11X_12X */ - static ipmi_fru_parse_ctx_t (*nut_ipmi_fru_parse_ctx_create) (ipmi_ctx_t ipmi_ctx); - static int (*nut_ipmi_fru_parse_ctx_set_flags) (ipmi_fru_parse_ctx_t ctx, unsigned int flags); - static int (*nut_ipmi_fru_parse_open_device_id) (ipmi_fru_parse_ctx_t ctx, uint8_t fru_device_id); - static char * (*nut_ipmi_fru_parse_ctx_errormsg) (ipmi_fru_parse_ctx_t ctx); -+static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx); -+#endif /* HAVE_FREEIPMI_11X_12X */ -+ -+#ifndef ipmi_fru_parse_ctx_t -+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t -+#endif -+ -+#ifndef nut_ipmi_fru_parse_close_device_id -+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id -+#endif -+ -+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy -+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create -+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags -+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id -+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg -+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX -+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS -+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION -+ - static int (*nut_ipmi_fru_parse_read_data_area) (ipmi_fru_parse_ctx_t ctx, - unsigned int *area_type, - unsigned int *area_length, - void *areabuf, - unsigned int areabuflen); --static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx); - static ipmi_ctx_t (*nut_ipmi_ctx_create) (void); - static int (*nut_ipmi_ctx_find_inband) (ipmi_ctx_t ctx, - ipmi_driver_type_t *driver_type, From 4dc3498017e5e9c8842922b6217d038d22b79e2c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 16 Oct 2014 15:54:44 +0200 Subject: [PATCH 018/142] spec cleanup --- nut.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nut.spec b/nut.spec index efe90fc..d458c52 100644 --- a/nut.spec +++ b/nut.spec @@ -24,7 +24,6 @@ Patch1: nut-2.6.3-tmpfiles.patch #quick fix. TODO: fix it properly Patch3: nut-2.6.5-quickfix.patch -Patch4: nut-2.6.5-ipmifix.patch Patch5: nut-2.6.5-dlfix.patch Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch @@ -122,14 +121,13 @@ necessary to develop NUT client applications. %setup -q %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix -#%patch4 -p1 -b .ipmifix %patch5 -p1 -b .dlfix %patch6 -p1 -b .pthreadfix %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -#%patch10 -p1 -b .fixupslog -#%patch11 -p1 -b .systemdfix + + sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -272,6 +270,7 @@ udevadm control --reload ||: %postun client /sbin/ldconfig +%systemd_postun_with_restart nut-monitor.service %posttrans # phase 2: start upsmon again From 412da6374037eb8cf96254bb251667305772bfcb Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 23 Feb 2015 17:49:07 +0100 Subject: [PATCH 019/142] nut driver needs tmpfiles.d too (#1187286) --- nut-2.6.3-tmpfiles.patch | 19 +++++++++++++++---- nut-2.6.5-foreground.patch | 2 +- nut.spec | 15 ++++++++++++--- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 7fb2e24..8cf4bb0 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -1,11 +1,22 @@ -diff -up nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.6.4/scripts/systemd/nut-monitor.service.in ---- nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles 2012-05-02 23:35:36.000000000 +0200 -+++ nut-2.6.4/scripts/systemd/nut-monitor.service.in 2012-06-14 11:38:42.408504102 +0200 +diff -up nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-driver.service.in +--- nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles 2015-02-23 14:44:50.173188023 +0100 ++++ nut-2.7.2/scripts/systemd/nut-driver.service.in 2015-02-23 14:45:03.915137074 +0100 +@@ -4,6 +4,7 @@ After=local-fs.target network.target + StopWhenUnneeded=yes + + [Service] ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf + ExecStart=@SBINDIR@/upsdrvctl start + ExecStop=@SBINDIR@/upsdrvctl stop + Type=forking +diff -up nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-monitor.service.in +--- nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles 2014-02-14 09:56:53.000000000 +0100 ++++ nut-2.7.2/scripts/systemd/nut-monitor.service.in 2015-02-23 14:45:18.443083211 +0100 @@ -3,6 +3,7 @@ Description=Network UPS Tools - power de After=local-fs.target network.target nut-server.service [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf ExecStart=@SBINDIR@/upsmon PIDFile=@PIDPATH@/upsmon.pid Type=forking diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch index ce1570c..0504e62 100644 --- a/nut-2.6.5-foreground.patch +++ b/nut-2.6.5-foreground.patch @@ -55,7 +55,7 @@ diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/s @@ -4,9 +4,8 @@ After=local-fs.target network.target nut [Service] - ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf + ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf -ExecStart=@SBINDIR@/upsmon -PIDFile=@PIDPATH@/upsmon.pid -Type=forking diff --git a/nut.spec b/nut.spec index 0d27fdd..61ffad7 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -189,7 +189,7 @@ mkdir -p %{buildroot}%{modeldir} \ make install DESTDIR=%{buildroot} %if %{?fedora}0 > 140 || %{?rhel}0 > 60 - install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tmpfiles.d/nut-client.conf + install -p -D -m 644 %{SOURCE3} %{buildroot}/usr/lib/tmpfiles.d/nut-run.conf %endif rm -rf %{buildroot}%{_prefix}/html @@ -245,6 +245,7 @@ fi %post /sbin/ldconfig udevadm control --reload ||: +systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || : %systemd_post nut-driver.service nut-server.service %preun @@ -266,6 +267,7 @@ udevadm control --reload ||: %post client /sbin/ldconfig +systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || : %systemd_post nut-monitor.service %preun client @@ -294,12 +296,16 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users +%if %{?fedora}0 > 140 || %{?rhel}0 > 60 +/usr/lib/tmpfiles.d/nut-run.conf +%endif %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver.service %{_unitdir}/nut-server.service +%ghost %{piddir} %{_sbindir}/upsd %{_bindir}/nut-scanner %{_bindir}/upslog @@ -374,7 +380,7 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf %if %{?fedora}0 > 140 || %{?rhel}0 > 60 - %config(noreplace) %{_sysconfdir}/tmpfiles.d/nut-client.conf +/usr/lib/tmpfiles.d/nut-run.conf %endif %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups %ghost %{piddir} @@ -435,6 +441,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Feb 23 2015 Michal Hlavinka - 2.7.2-3 +- nut driver needs tmpfiles.d too (#1187286) + * Tue Aug 26 2014 Michal Hlavinka - 2.7.2-2 - build without powerman as it is not available in epel7 From 9314b026f08f70be21734b43094e019e65514cd0 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Mon, 6 Apr 2015 16:24:33 -0400 Subject: [PATCH 020/142] rebuild for libvpx 1.4.0 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index d458c52..c7217c4 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 3%{?dist} +Release: 4%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -433,6 +433,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Apr 6 2014 Tom Callaway - 2.7.2-4 +- rebuild against libvpx 1.4.0 + * Sun Aug 17 2014 Fedora Release Engineering - 2.7.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From 223a5467421aa3976432c4b7b8865db4b0b38302 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 14:58:22 -0400 Subject: [PATCH 021/142] fix changelog date --- nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index c7217c4..837dad9 100644 --- a/nut.spec +++ b/nut.spec @@ -433,7 +433,7 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog -* Mon Apr 6 2014 Tom Callaway - 2.7.2-4 +* Mon Apr 6 2015 Tom Callaway - 2.7.2-4 - rebuild against libvpx 1.4.0 * Sun Aug 17 2014 Fedora Release Engineering - 2.7.2-3 From 9b89e674667ffca746fe2e50b9efaf4c76db63ae Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:06:47 -0400 Subject: [PATCH 022/142] fix BR --- nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 837dad9..ff18012 100644 --- a/nut.spec +++ b/nut.spec @@ -61,7 +61,7 @@ BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel %ifnarch s390 s390x -BuildRequires: libusb-devel +BuildRequires: libusbx-devel %endif ExcludeArch: s390 s390x From bb77561444bf06ddd71ca754de3e25216be9f170 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:16:23 -0400 Subject: [PATCH 023/142] revert --- nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index ff18012..837dad9 100644 --- a/nut.spec +++ b/nut.spec @@ -61,7 +61,7 @@ BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel %ifnarch s390 s390x -BuildRequires: libusbx-devel +BuildRequires: libusb-devel %endif ExcludeArch: s390 s390x From 3b235a326d09aab124cfe5f6c9a2b5f68a9bb307 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:25:30 -0400 Subject: [PATCH 024/142] debug --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 837dad9..5f16de4 100644 --- a/nut.spec +++ b/nut.spec @@ -163,7 +163,10 @@ autoreconf -i --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ --libdir=%{_libdir} -# --with-doc # does not work in 2.7.1 +# --with-doc # does not work in 2.7.1 ||: +cat config.log + +exit 0 sh %{SOURCE4} >>include/config.h From aae62efcb70eb552af296480a1da462ae7204844 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:29:27 -0400 Subject: [PATCH 025/142] debug --- nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index 5f16de4..2e5afd5 100644 --- a/nut.spec +++ b/nut.spec @@ -162,8 +162,8 @@ autoreconf -i --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ - --libdir=%{_libdir} -# --with-doc # does not work in 2.7.1 ||: + --libdir=%{_libdir} ||: +# --with-doc # does not work in 2.7.1 cat config.log exit 0 From 64cdce1a9e573723af25f0a1ace5e500431942d0 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:38:01 -0400 Subject: [PATCH 026/142] fPIC --- nut.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nut.spec b/nut.spec index 2e5afd5..2aa4a18 100644 --- a/nut.spec +++ b/nut.spec @@ -144,6 +144,8 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i +export CFLAGS="%{optflags} -fPIC" +export CCFLAGS="%{optflags} -fPIC" %configure \ --with-all \ --with-libltdl \ @@ -162,11 +164,8 @@ autoreconf -i --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ - --libdir=%{_libdir} ||: + --libdir=%{_libdir} # --with-doc # does not work in 2.7.1 -cat config.log - -exit 0 sh %{SOURCE4} >>include/config.h From 6810be8ca82b0f694caff8f922494c2a2ada03d8 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 7 Apr 2015 15:46:15 -0400 Subject: [PATCH 027/142] disable hardened build --- nut.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index 2aa4a18..5f6942e 100644 --- a/nut.spec +++ b/nut.spec @@ -1,3 +1,6 @@ +# Does not build with hardened build enabled due to PIC +%global _hardened_build 0 + #TODO: split nut-client so it does not require python %global nut_uid 57 %global nut_gid 57 @@ -144,8 +147,6 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i -export CFLAGS="%{optflags} -fPIC" -export CCFLAGS="%{optflags} -fPIC" %configure \ --with-all \ --with-libltdl \ From 8d6ef40a5f5d78d77a0eea14fb8d6397c020e23d Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 23 Apr 2015 17:42:32 +0200 Subject: [PATCH 028/142] nut updated to 2.7.3 --- .gitignore | 1 + nut-2.6.5-quickfix.patch | 10 ++++------ nut.spec | 11 ++++++++--- sources | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index e21a10c..ec15165 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ nut-2.4.3.tar.gz /nut-2.6.5.tar.gz /nut-2.7.1.tar.gz /nut-2.7.2.tar.gz +/nut-2.7.3.tar.gz diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch index c5b8038..aa11fe6 100644 --- a/nut-2.6.5-quickfix.patch +++ b/nut-2.6.5-quickfix.patch @@ -1,14 +1,12 @@ -diff -up nut-2.7.1/configure.ac.quickfix nut-2.7.1/configure.ac ---- nut-2.7.1/configure.ac.quickfix 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/configure.ac 2014-02-27 11:25:57.608869497 +0100 -@@ -1027,9 +1027,8 @@ dnl Override installation directory, wit +diff -up nut-2.7.3/configure.ac.quickfix nut-2.7.3/configure.ac +--- nut-2.7.3/configure.ac.quickfix 2015-04-23 12:05:21.219228670 +0200 ++++ nut-2.7.3/configure.ac 2015-04-23 12:05:21.230228646 +0200 +@@ -1065,7 +1065,7 @@ dnl Override installation directory, wit dnl prefix. This is needed for 'distcheck*' targets, otherwise dnl files will try to get intalled to the actual system directories if test -n "${systemdsystemunitdir}"; then - systemdsystemshutdowndir="${libdir}/systemd/system-shutdown" + systemdsystemshutdowndir="/lib/systemd/system-shutdown" AC_MSG_RESULT(using ${systemdsystemunitdir}) -- systemdsystemunitdir="`echo ${systemdsystemunitdir} | sed 's/\/lib/\${libdir}/'`" else AC_MSG_RESULT(no) - fi diff --git a/nut.spec b/nut.spec index 5f6942e..48f0bc5 100644 --- a/nut.spec +++ b/nut.spec @@ -15,8 +15,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.7.2 -Release: 4%{?dist} +Version: 2.7.3 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -147,6 +147,8 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i +# prevent assignment of default value, it would break configure's tests +export LDFLAGS="-Wl,-z,now" %configure \ --with-all \ --with-libltdl \ @@ -206,7 +208,7 @@ done popd #fix collision with virtualbox -mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules +#mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules # fix encoding @@ -436,6 +438,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Apr 23 2015 Michal Hlavinka - 2.7.3-1 +- nut updated to 2.7.3 + * Mon Apr 6 2015 Tom Callaway - 2.7.2-4 - rebuild against libvpx 1.4.0 diff --git a/sources b/sources index e01f451..ee3e16e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c3568b42e058cfc385b46d25140dced4 nut-2.7.2.tar.gz +a1a7f747093663e1f39ab595b63b45e4 nut-2.7.3.tar.gz From 91dcbb61f1d3836e2872fd0dfe66c8f47d6de083 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 28 Apr 2015 10:00:45 +0200 Subject: [PATCH 029/142] start nut driver before the daemon --- nut-2.7.3-systemdfix.patch | 12 ++++++++++++ nut.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 nut-2.7.3-systemdfix.patch diff --git a/nut-2.7.3-systemdfix.patch b/nut-2.7.3-systemdfix.patch new file mode 100644 index 0000000..41887e6 --- /dev/null +++ b/nut-2.7.3-systemdfix.patch @@ -0,0 +1,12 @@ +diff -up nut-2.7.3/scripts/systemd/nut-server.service.in.systemdfix nut-2.7.3/scripts/systemd/nut-server.service.in +--- nut-2.7.3/scripts/systemd/nut-server.service.in.systemdfix 2015-04-28 09:59:05.567849447 +0200 ++++ nut-2.7.3/scripts/systemd/nut-server.service.in 2015-04-28 09:59:23.743808581 +0200 +@@ -4,7 +4,7 @@ After=local-fs.target network.target nut + # We don't Require drivers to be successfully started! This would be + # a change of behavior compared to init SysV, and could prevent from + # accessing successfully started, at least to audit a system. +-#Requires=nut-driver.service ++Wants=nut-driver.service + Before=nut-monitor.service + + [Service] diff --git a/nut.spec b/nut.spec index 48f0bc5..633172e 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -32,6 +32,7 @@ Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch +Patch10: nut-2.7.3-systemdfix.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -129,6 +130,7 @@ necessary to develop NUT client applications. %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf +%patch10 -p1 -b .systemdfix sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop @@ -438,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Apr 28 2015 Michal Hlavinka - 2.7.3-2 +- start nut driver before the daemon + * Thu Apr 23 2015 Michal Hlavinka - 2.7.3-1 - nut updated to 2.7.3 From b83609e44aca5d17b6009f0bd3371d65c25d3a0d Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sun, 3 May 2015 00:03:28 +0200 Subject: [PATCH 030/142] Rebuilt for GCC 5 C++11 ABI change --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 633172e..9f1153c 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat May 02 2015 Kalev Lember - 2.7.3-3 +- Rebuilt for GCC 5 C++11 ABI change + * Tue Apr 28 2015 Michal Hlavinka - 2.7.3-2 - start nut driver before the daemon From 3cf2ea1483d0745ef6756d34aade2f2341703a8e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 23:27:24 +0000 Subject: [PATCH 031/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 9f1153c..344a024 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 3%{?dist} +Release: 4%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 2.7.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Sat May 02 2015 Kalev Lember - 2.7.3-3 - Rebuilt for GCC 5 C++11 ABI change From d3ed363b624abda58ace62bb4ebdee67c695d60d Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 1 Dec 2015 16:25:54 -0500 Subject: [PATCH 032/142] rebuild for libvpx 1.5.0 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 344a024..5430f3a 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 4%{?dist} +Release: 5%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Dec 1 2015 Tom Callaway - 2.7.3-5 +- rebuild for libvpx 1.5.0 + * Wed Jun 17 2015 Fedora Release Engineering - 2.7.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From 75aa58ef26fd731c3c255a44b473e02741148142 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sat, 5 Dec 2015 13:53:26 +0100 Subject: [PATCH 033/142] Rebuilt for libfreeipmi soname bump --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 5430f3a..5c65577 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 5%{?dist} +Release: 6%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Dec 05 2015 Kalev Lember - 2.7.3-6 +- Rebuilt for libfreeipmi soname bump + * Tue Dec 1 2015 Tom Callaway - 2.7.3-5 - rebuild for libvpx 1.5.0 From 61c166bea20ea4bff43aaff079297538710e429c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 4 Feb 2016 10:59:55 +0000 Subject: [PATCH 034/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 5c65577..e0761d1 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.3 -Release: 6%{?dist} +Release: 7%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 2.7.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Sat Dec 05 2015 Kalev Lember - 2.7.3-6 - Rebuilt for libfreeipmi soname bump From 32c24a124f4cb1ebb47f1b6cfc7cd703929ad444 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Sat, 12 Mar 2016 00:30:27 +0100 Subject: [PATCH 035/142] nut updated to 2.7.4 --- .gitignore | 1 + nut-2.6.5-dlfix.patch | 135 +++++-------------------------------- nut-2.6.5-pthreadfix.patch | 36 ---------- nut-2.7.3-systemdfix.patch | 12 ---- nut.spec | 11 ++- sources | 2 +- 6 files changed, 24 insertions(+), 173 deletions(-) delete mode 100644 nut-2.6.5-pthreadfix.patch delete mode 100644 nut-2.7.3-systemdfix.patch diff --git a/.gitignore b/.gitignore index ec15165..01c65a3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ nut-2.4.3.tar.gz /nut-2.7.1.tar.gz /nut-2.7.2.tar.gz /nut-2.7.3.tar.gz +/nut-2.7.4.tar.gz diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch index 4375324..f93b5ea 100644 --- a/nut-2.6.5-dlfix.patch +++ b/nut-2.6.5-dlfix.patch @@ -1,126 +1,25 @@ -diff -up nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_avahi.c ---- nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_avahi.c 2014-02-27 11:25:57.610869514 +0100 -@@ -36,7 +36,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libavahi-client"; -+static char * libname = LIBAVAHI_CLIENT_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -99,7 +99,7 @@ int nutscan_load_avahi_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_ipmi.c ---- nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_ipmi.c 2014-02-27 11:32:20.393015238 +0100 -@@ -35,7 +35,7 @@ - #define IPMI_RETRANSMISSION_TIMEOUT_LENGTH_DEFAULT 250 - - /* dynamic link library stuff */ --static char * libname = "libfreeipmi"; -+static char * libname = LIBFREEIPMI_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -128,7 +128,7 @@ int nutscan_load_ipmi_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.1/tools/nut-scanner/scan_nut.c ---- nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix 2013-10-30 14:47:15.000000000 +0100 -+++ nut-2.7.1/tools/nut-scanner/scan_nut.c 2014-02-27 11:25:57.611869522 +0100 -@@ -26,7 +26,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libupsclient"; -+static char * libname = LIBUPSCLIENT_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -67,7 +67,7 @@ int nutscan_load_upsclient_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.1/tools/nut-scanner/scan_snmp.c ---- nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_snmp.c 2014-02-27 11:25:57.611869522 +0100 -@@ -74,7 +74,7 @@ static int thread_count = 0; - long g_usec_timeout ; - - /* dynamic link library stuff */ --static char * libname = "libnetsnmp"; -+static char * libname = LIBNETSNMP_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -119,7 +119,7 @@ int nutscan_load_snmp_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.1/tools/nut-scanner/scan_usb.c ---- nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_usb.c 2014-02-27 11:25:57.611869522 +0100 -@@ -28,7 +28,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libusb"; -+static char * libname = LIBUSB_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - static int (*nut_usb_close)(usb_dev_handle *dev); -@@ -58,7 +58,7 @@ int nutscan_load_usb_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.1/tools/nut-scanner/scan_xml_http.c ---- nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_xml_http.c 2014-02-27 11:25:57.611869522 +0100 -@@ -33,7 +33,7 @@ +diff -up nut-2.7.4/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_avahi.c +diff -up nut-2.7.4/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_ipmi.c +diff -up nut-2.7.4/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.4/tools/nut-scanner/scan_nut.c +diff -up nut-2.7.4/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.4/tools/nut-scanner/scan_snmp.c +diff -up nut-2.7.4/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.4/tools/nut-scanner/scan_usb.c +diff -up nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.4/tools/nut-scanner/scan_xml_http.c +--- nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix 2016-03-08 13:01:11.000000000 +0100 ++++ nut-2.7.4/tools/nut-scanner/scan_xml_http.c 2016-03-12 00:23:02.554826665 +0100 +@@ -37,7 +37,6 @@ #include /* dynamic link library stuff */ -static char * libname = "libneon"; -+static char * libname = LIBNEON_PATH; static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -64,7 +64,7 @@ int nutscan_load_neon_library() - return 0; - } +@@ -102,7 +101,7 @@ int nutscan_load_neon_library(const char -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; + return 1; + err: +- fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname, dl_error); ++ fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname_path, dl_error); + dl_handle = (void *)1; + lt_dlexit(); + return 0; diff --git a/nut-2.6.5-pthreadfix.patch b/nut-2.6.5-pthreadfix.patch deleted file mode 100644 index a471c99..0000000 --- a/nut-2.6.5-pthreadfix.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.7.1/tools/nut-scanner/nut-scanner.c ---- nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix 2014-02-27 11:37:57.045786437 +0100 -+++ nut-2.7.1/tools/nut-scanner/nut-scanner.c 2014-02-27 11:39:02.591326696 +0100 -@@ -532,25 +532,25 @@ display_help: - } - - #ifdef HAVE_PTHREAD -- if( allow_usb && nutscan_avail_usb ) { -+ if( allow_usb && nutscan_avail_usb && thread[TYPE_USB]) { - pthread_join(thread[TYPE_USB],NULL); - } -- if( allow_snmp && nutscan_avail_snmp ) { -+ if( allow_snmp && nutscan_avail_snmp && thread[TYPE_SNMP]) { - pthread_join(thread[TYPE_SNMP],NULL); - } -- if( allow_xml && nutscan_avail_xml_http ) { -+ if( allow_xml && nutscan_avail_xml_http && thread[TYPE_XML]) { - pthread_join(thread[TYPE_XML],NULL); - } -- if( allow_oldnut && nutscan_avail_nut ) { -+ if( allow_oldnut && nutscan_avail_nut && thread[TYPE_NUT]) { - pthread_join(thread[TYPE_NUT],NULL); - } -- if( allow_avahi && nutscan_avail_avahi ) { -+ if( allow_avahi && nutscan_avail_avahi && thread[TYPE_AVAHI]) { - pthread_join(thread[TYPE_AVAHI],NULL); - } -- if( allow_ipmi && nutscan_avail_ipmi ) { -+ if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) { - pthread_join(thread[TYPE_IPMI],NULL); - } -- if (allow_eaton_serial) { -+ if (allow_eaton_serial && thread[TYPE_EATON_SERIAL]) { - pthread_join(thread[TYPE_EATON_SERIAL],NULL); - } - #endif /* HAVE_PTHREAD */ diff --git a/nut-2.7.3-systemdfix.patch b/nut-2.7.3-systemdfix.patch deleted file mode 100644 index 41887e6..0000000 --- a/nut-2.7.3-systemdfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up nut-2.7.3/scripts/systemd/nut-server.service.in.systemdfix nut-2.7.3/scripts/systemd/nut-server.service.in ---- nut-2.7.3/scripts/systemd/nut-server.service.in.systemdfix 2015-04-28 09:59:05.567849447 +0200 -+++ nut-2.7.3/scripts/systemd/nut-server.service.in 2015-04-28 09:59:23.743808581 +0200 -@@ -4,7 +4,7 @@ After=local-fs.target network.target nut - # We don't Require drivers to be successfully started! This would be - # a change of behavior compared to init SysV, and could prevent from - # accessing successfully started, at least to audit a system. --#Requires=nut-driver.service -+Wants=nut-driver.service - Before=nut-monitor.service - - [Service] diff --git a/nut.spec b/nut.spec index e0761d1..2cfa812 100644 --- a/nut.spec +++ b/nut.spec @@ -15,8 +15,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.7.3 -Release: 7%{?dist} +Version: 2.7.4 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -28,11 +28,9 @@ Patch1: nut-2.6.3-tmpfiles.patch #quick fix. TODO: fix it properly Patch3: nut-2.6.5-quickfix.patch Patch5: nut-2.6.5-dlfix.patch -Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -Patch10: nut-2.7.3-systemdfix.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -126,11 +124,9 @@ necessary to develop NUT client applications. %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix %patch5 -p1 -b .dlfix -%patch6 -p1 -b .pthreadfix %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -%patch10 -p1 -b .systemdfix sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop @@ -440,6 +436,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Mar 12 2016 Michal Hlavinka - 2.7.4-1 +- nut updated to 2.7.4 + * Thu Feb 04 2016 Fedora Release Engineering - 2.7.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index ee3e16e..b1483aa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a1a7f747093663e1f39ab595b63b45e4 nut-2.7.3.tar.gz +3ba53656933d7471f95140b32a5b8d5c nut-2.7.4.tar.gz From 91e73784db7e2bb79ef483a5e47d3ba83b56e6f4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 08:04:37 +0000 Subject: [PATCH 036/142] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 2cfa812..5d22b66 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -436,6 +436,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 2.7.4-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Sat Mar 12 2016 Michal Hlavinka - 2.7.4-1 - nut updated to 2.7.4 From 43c04986c937bf9ccdd322e9d0e260e7d4b63101 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 11 Aug 2016 18:02:32 +0200 Subject: [PATCH 037/142] make sure tmpfiles creation is executped before ups driver (#1365904,#1349362) --- nut-2.6.3-tmpfiles.patch | 17 ++++++++++++++--- nut.spec | 5 ++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 7fb2e24..087d369 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -1,6 +1,17 @@ -diff -up nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.6.4/scripts/systemd/nut-monitor.service.in ---- nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles 2012-05-02 23:35:36.000000000 +0200 -+++ nut-2.6.4/scripts/systemd/nut-monitor.service.in 2012-06-14 11:38:42.408504102 +0200 +diff -up nut-2.7.4/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.4/scripts/systemd/nut-driver.service.in +--- nut-2.7.4/scripts/systemd/nut-driver.service.in.tmpfiles 2016-08-11 16:58:00.759001400 +0200 ++++ nut-2.7.4/scripts/systemd/nut-driver.service.in 2016-08-11 16:58:38.619248466 +0200 +@@ -4,6 +4,7 @@ After=local-fs.target network.target + StopWhenUnneeded=yes + + [Service] ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf + ExecStart=@SBINDIR@/upsdrvctl start + ExecStop=@SBINDIR@/upsdrvctl stop + Type=forking +diff -up nut-2.7.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.4/scripts/systemd/nut-monitor.service.in +--- nut-2.7.4/scripts/systemd/nut-monitor.service.in.tmpfiles 2015-12-29 09:42:34.000000000 +0100 ++++ nut-2.7.4/scripts/systemd/nut-monitor.service.in 2016-08-11 16:57:48.121918934 +0200 @@ -3,6 +3,7 @@ Description=Network UPS Tools - power de After=local-fs.target network.target nut-server.service diff --git a/nut.spec b/nut.spec index 5d22b66..6a1b498 100644 --- a/nut.spec +++ b/nut.spec @@ -16,7 +16,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -436,6 +436,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Aug 11 2016 Michal Hlavinka - 2.7.4-3 +- make sure tmpfiles creation is executped before ups driver (#1365904,#1349362) + * Tue Jul 19 2016 Fedora Release Engineering - 2.7.4-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From f5e8b59a7ac6e0f254faf3d6b3b3d1a2db957780 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Thu, 15 Sep 2016 21:46:26 +0200 Subject: [PATCH 038/142] Disable powerman support, powerman was retired on Fedora --- nut.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 6a1b498..d2845b3 100644 --- a/nut.spec +++ b/nut.spec @@ -8,6 +8,8 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /var/run/nut %global modeldir /usr/sbin +# powerman is retired on Fedora, therefore disable it by default +%bcond_with powerman %if ! (0%{?fedora} > 12 || 0%{?rhel} > 6) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} @@ -16,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 3%{?dist} +Release: 4%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -57,7 +59,9 @@ BuildRequires: net-snmp-devel BuildRequires: netpbm-devel BuildRequires: openssl-devel BuildRequires: pkgconfig +%if %{with powerman} BuildRequires: powerman-devel +%endif BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel @@ -149,6 +153,9 @@ autoreconf -i export LDFLAGS="-Wl,-z,now" %configure \ --with-all \ +%if %{without powerman} + --without-powerman \ +%endif --with-libltdl \ --without-hal \ --with-cgi \ @@ -349,7 +356,9 @@ rm -rf %{buildroot} %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz %{_mandir}/man8/powercom.8.gz +%if %{with powerman} %{_mandir}/man8/powerman-pdu.8.gz +%endif %{_mandir}/man8/powerpanel.8.gz %{_mandir}/man8/rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz @@ -436,6 +445,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Sep 15 2016 Till Maas - 2.7.4-4 +- Disable powerman support, powerman was retired on Fedora + * Thu Aug 11 2016 Michal Hlavinka - 2.7.4-3 - make sure tmpfiles creation is executped before ups driver (#1365904,#1349362) From 5b55cc8deb771832f78769b224f51e5a697b3f11 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Thu, 15 Sep 2016 21:47:08 +0200 Subject: [PATCH 039/142] Remove unused patches --- nut-2.2.1-conf.patch | 13 ------------- nut-2.6.0-usbget.patch | 28 ---------------------------- 2 files changed, 41 deletions(-) delete mode 100644 nut-2.2.1-conf.patch delete mode 100644 nut-2.6.0-usbget.patch diff --git a/nut-2.2.1-conf.patch b/nut-2.2.1-conf.patch deleted file mode 100644 index beebdf6..0000000 --- a/nut-2.2.1-conf.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: nut/conf/upssched.conf.sample.in -=================================================================== ---- nut/conf/upssched.conf.sample.in (revision 2057) -+++ nut/conf/upssched.conf.sample.in (revision 2070) -@@ -14,7 +14,7 @@ - # A shell script with a big case..esac construct should work nicely for this. - # An example has been provided to help you get started. - --CMDSCRIPT @BINDIR@/upssched-cmd -+CMDSCRIPT @bindir@/upssched-cmd - - # ============================================================================ - # diff --git a/nut-2.6.0-usbget.patch b/nut-2.6.0-usbget.patch deleted file mode 100644 index 2d9242a..0000000 --- a/nut-2.6.0-usbget.patch +++ /dev/null @@ -1,28 +0,0 @@ -Index: /trunk/drivers/libhid.c -=================================================================== ---- trunk/drivers/libhid.c (revision 2719) -+++ trunk/drivers/libhid.c (revision 2893) -@@ -142,5 +142,4 @@ - int id = pData->ReportID; - int r; -- unsigned char buf[SMALLBUF]; - - if (rbuf->ts[id] + age > time(NULL)) { -@@ -150,15 +149,12 @@ - } - -- r = comm_driver->get_report(udev, id, buf, sizeof(buf)); -+ r = comm_driver->get_report(udev, id, rbuf->data[id], rbuf->len[id]); - if (r <= 0) { - return -1; - } - -- /* broken report descriptors are common, so store whatever we can */ -- memcpy(rbuf->data[id], buf, (r < rbuf->len[id]) ? r : rbuf->len[id]); -- - if (rbuf->len[id] != r) { - upsdebugx(2, "%s: expected %d bytes, but got %d instead", __func__, rbuf->len[id], r); -- upsdebug_hex(3, "Report[err]", buf, r); -+ upsdebug_hex(3, "Report[err]", rbuf->data[id], r); - } else { - upsdebug_hex(3, "Report[get]", rbuf->data[id], rbuf->len[id]); From 274d5184cce39e5d011b3353755bbb7064ce097b Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 11 Nov 2016 17:06:13 +0100 Subject: [PATCH 040/142] use %_tmpfilesdir macro (#1394009) --- nut.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index d2845b3..2192e3a 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 4%{?dist} +Release: 5%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -196,7 +196,7 @@ mkdir -p %{buildroot}%{modeldir} \ make install DESTDIR=%{buildroot} %if %{?fedora}0 > 140 || %{?rhel}0 > 60 - install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tmpfiles.d/nut-client.conf + install -p -D -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/nut-client.conf %endif rm -rf %{buildroot}%{_prefix}/html @@ -384,7 +384,7 @@ rm -rf %{buildroot} %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf %if %{?fedora}0 > 140 || %{?rhel}0 > 60 - %config(noreplace) %{_sysconfdir}/tmpfiles.d/nut-client.conf + %config(noreplace) %{_tmpfilesdir}/nut-client.conf %endif %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups %ghost %{piddir} @@ -445,6 +445,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Nov 11 2016 Michal Hlavinka - 2.7.4-5 +- use %%_tmpfilesdir macro (#1394009) + * Thu Sep 15 2016 Till Maas - 2.7.4-4 - Disable powerman support, powerman was retired on Fedora From 2de1898467a6449269c6374bd5100c3dda01f946 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 1 Feb 2017 19:26:19 +0100 Subject: [PATCH 041/142] Rebuild (libwebp) --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 2192e3a..a749ae4 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 5%{?dist} +Release: 6%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -445,6 +445,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Feb 01 2017 Sandro Mani - 2.7.4-6 +- Rebuild (libwebp) + * Fri Nov 11 2016 Michal Hlavinka - 2.7.4-5 - use %%_tmpfilesdir macro (#1394009) From 89398326b01c838e1113b4e4085de0ab678e194b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 00:24:14 +0000 Subject: [PATCH 042/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index a749ae4..dd8bd4e 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 6%{?dist} +Release: 7%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -445,6 +445,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 2.7.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Wed Feb 01 2017 Sandro Mani - 2.7.4-6 - Rebuild (libwebp) From ecd6fdf42b3d78528833ca8f6558f2192694fa1c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 24 May 2017 13:30:31 +0200 Subject: [PATCH 043/142] fix location of tmpfiles.d in service files (#1399602) --- nut-2.6.3-tmpfiles.patch | 4 ++-- nut.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 087d369..0b45e1c 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -5,7 +5,7 @@ diff -up nut-2.7.4/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.4/scri StopWhenUnneeded=yes [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf ExecStart=@SBINDIR@/upsdrvctl start ExecStop=@SBINDIR@/upsdrvctl stop Type=forking @@ -16,7 +16,7 @@ diff -up nut-2.7.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.4/scr After=local-fs.target network.target nut-server.service [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf ExecStart=@SBINDIR@/upsmon PIDFile=@PIDPATH@/upsmon.pid Type=forking diff --git a/nut.spec b/nut.spec index dd8bd4e..3e4f2cd 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 7%{?dist} +Release: 8%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -445,6 +445,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed May 24 2017 Michal Hlavinka - 2.7.4-8 +- fix location of tmpfiles.d in service files (#1399602) + * Sat Feb 11 2017 Fedora Release Engineering - 2.7.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 076835845e84241e9152dd6a98d388b5417cf4ce Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 24 May 2017 13:46:12 +0200 Subject: [PATCH 044/142] update following patch --- nut-2.6.5-foreground.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch index ce1570c..4064b86 100644 --- a/nut-2.6.5-foreground.patch +++ b/nut-2.6.5-foreground.patch @@ -55,7 +55,7 @@ diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/s @@ -4,9 +4,8 @@ After=local-fs.target network.target nut [Service] - ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf + ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf -ExecStart=@SBINDIR@/upsmon -PIDFile=@PIDPATH@/upsmon.pid -Type=forking From 00c608028fc1d8674260e7684e07165b6be04e8d Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 22 Jun 2017 12:11:35 +0200 Subject: [PATCH 045/142] enable nss crypto (#1463071) --- nut.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 3e4f2cd..77926b1 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 8%{?dist} +Release: 9%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -65,6 +65,7 @@ BuildRequires: powerman-devel BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel +BuildRequires: nss-devel %ifnarch s390 s390x BuildRequires: libusb-devel @@ -157,6 +158,7 @@ export LDFLAGS="-Wl,-z,now" --without-powerman \ %endif --with-libltdl \ + --with-nss \ --without-hal \ --with-cgi \ --datadir=%{_datadir}/%{name} \ @@ -445,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jun 22 2017 Michal Hlavinka - 2.7.4-9 +- enable nss crypto (#1463071) + * Wed May 24 2017 Michal Hlavinka - 2.7.4-8 - fix location of tmpfiles.d in service files (#1399602) From af0741e2011c4e74b9a22656c64f8c8c9b615ddf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 01:21:34 +0000 Subject: [PATCH 046/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 77926b1..d7a23c6 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 9%{?dist} +Release: 10%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -447,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 2.7.4-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Thu Jun 22 2017 Michal Hlavinka - 2.7.4-9 - enable nss crypto (#1463071) From 2cfc72967715bd8008272dc4a695fda26d43c91d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 04:10:12 +0000 Subject: [PATCH 047/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index d7a23c6..24c74ae 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 10%{?dist} +Release: 11%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -447,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 2.7.4-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 2.7.4-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 6f70070a2881d8ab209caebdd9fab40f03a2a3b1 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 30 Aug 2017 12:05:31 +0200 Subject: [PATCH 048/142] rebuild for freeipmi update --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 24c74ae..cff2949 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 11%{?dist} +Release: 12%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -447,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Aug 30 2017 Michal Hlavinka - 2.7.4-12 +- rebuild for freeipmi update + * Thu Aug 03 2017 Fedora Release Engineering - 2.7.4-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 494b2075773b58a4ab09e6612cd91511c16f546a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 7 Nov 2017 16:33:21 +0100 Subject: [PATCH 049/142] Remove old crufty coreutils requires Signed-off-by: Igor Gnatenko --- nut.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index cff2949..da95376 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 12%{?dist} +Release: 13%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -35,9 +35,9 @@ Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Requires(pre): shadow-utils udev -Requires(post): fileutils chkconfig systemd-units +Requires(post): coreutils chkconfig systemd-units Requires(preun): systemd-units -Requires(postun): fileutils chkconfig systemd-units +Requires(postun): coreutils chkconfig systemd-units Obsoletes: nut-hal < 2.6.0-7 BuildRequires: autoconf @@ -447,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Nov 07 2017 Igor Gnatenko - 2.7.4-13 +- Remove old crufty coreutils requires + * Wed Aug 30 2017 Michal Hlavinka - 2.7.4-12 - rebuild for freeipmi update From f4583adfb40ac011fc36370faf278c85bccf27c0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 8 Feb 2018 08:34:22 +0000 Subject: [PATCH 050/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index da95376..781f2c2 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 13%{?dist} +Release: 14%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -447,6 +447,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Feb 08 2018 Fedora Release Engineering - 2.7.4-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Tue Nov 07 2017 Igor Gnatenko - 2.7.4-13 - Remove old crufty coreutils requires From 5deb951b81fb319f6692733a7f4d25d909228d98 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 07:23:25 +0100 Subject: [PATCH 051/142] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- nut.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/nut.spec b/nut.spec index 781f2c2..f3f7bc2 100644 --- a/nut.spec +++ b/nut.spec @@ -294,9 +294,6 @@ else /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : fi -%clean -rm -rf %{buildroot} - %files %defattr(-,root,root,-) %doc COPYING LICENSE-GPL2 LICENSE-GPL3 ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS From 51d283e2d579d3ceced74bac80c13f61ff56334c Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 14 Feb 2018 17:17:24 +0100 Subject: [PATCH 052/142] Update Python 2 dependency declarations to new packaging standards --- nut.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index f3f7bc2..7e82d3a 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 14%{?dist} +Release: 15%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -62,7 +62,7 @@ BuildRequires: pkgconfig %if %{with powerman} BuildRequires: powerman-devel %endif -BuildRequires: python-devel +BuildRequires: python2-devel BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel BuildRequires: nss-devel @@ -444,6 +444,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Feb 14 2018 Iryna Shcherbina - 2.7.4-15 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + * Thu Feb 08 2018 Fedora Release Engineering - 2.7.4-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 1281c745aea31e971e76128053eb16b4e22676c6 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 7 Mar 2018 16:40:19 +0100 Subject: [PATCH 053/142] add gcc buildrequire --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 7e82d3a..8d8ba85 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 15%{?dist} +Release: 16%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -47,6 +47,7 @@ BuildRequires: dbus-glib-devel BuildRequires: elfutils-devel BuildRequires: fontconfig-devel BuildRequires: freetype-devel +BuildRequires: gcc BuildRequires: gd-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel @@ -444,6 +445,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Mar 07 2018 Michal Hlavinka - 2.7.4-16 +- add gcc buildrequire + * Wed Feb 14 2018 Iryna Shcherbina - 2.7.4-15 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) From 69892ba5b79d86cabd3a8eb00ae75bada18b850a Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Tue, 17 Apr 2018 10:40:36 +0200 Subject: [PATCH 054/142] Remove unrecognized configure option --without-hal --- nut.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/nut.spec b/nut.spec index 8d8ba85..71b3a41 100644 --- a/nut.spec +++ b/nut.spec @@ -160,7 +160,6 @@ export LDFLAGS="-Wl,-z,now" %endif --with-libltdl \ --with-nss \ - --without-hal \ --with-cgi \ --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ From b62a6d2d82bda4c50c12f1d75e9d4f2b9ad90b3b Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Tue, 17 Apr 2018 10:41:43 +0200 Subject: [PATCH 055/142] Explicitely disable tcpwrapper support --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index 71b3a41..7d8103c 100644 --- a/nut.spec +++ b/nut.spec @@ -160,6 +160,7 @@ export LDFLAGS="-Wl,-z,now" %endif --with-libltdl \ --with-nss \ + --without-wrap \ --with-cgi \ --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ From 41b09c38c891eea95cc9dbb27c923f586568ae90 Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Tue, 17 Apr 2018 10:46:18 +0200 Subject: [PATCH 056/142] Remove unneeded CRLF EOL fix --- nut.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nut.spec b/nut.spec index 7d8103c..fc13535 100644 --- a/nut.spec +++ b/nut.spec @@ -140,12 +140,6 @@ sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/ sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in -#fix crlf end of lines -for f in docs/nut-qa.txt docs/website/css/ie-overrides.css docs/website/scripts/filter_png.js -do - sed -i 's/\r\n*$//' $f ||: -done - # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} From 397e5c41fef4ffa65c33786e79b47f9907e76af9 Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Tue, 17 Apr 2018 10:48:52 +0200 Subject: [PATCH 057/142] Add BR: cppunit-devel --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index fc13535..3d5331a 100644 --- a/nut.spec +++ b/nut.spec @@ -67,6 +67,7 @@ BuildRequires: python2-devel BuildRequires: desktop-file-utils BuildRequires: freeipmi-devel BuildRequires: nss-devel +BuildRequires: cppunit-devel %ifnarch s390 s390x BuildRequires: libusb-devel From 691b15bd516c278d420c807aa0455f64cb004796 Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Tue, 17 Apr 2018 11:32:54 +0200 Subject: [PATCH 058/142] Add changelog entry --- nut.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 3d5331a..194cd66 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 16%{?dist} +Release: 17%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -440,6 +440,12 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Apr 17 2018 Xavier Bachelot - 2.7.4-17 +- Remove unrecognized configure option --without-hal +- Explicitely disable tcpwrapper support +- Remove unneeded CRLF EOL fix +- Add BR: cppunit-devel + * Wed Mar 07 2018 Michal Hlavinka - 2.7.4-16 - add gcc buildrequire From f1e0af421985b2a2e5a6833edfd330ce238bc768 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 11 May 2018 14:46:40 +0200 Subject: [PATCH 059/142] rebuilt with updated freeipmi --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 61ffad7..c518055 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.2 -Release: 3%{?dist} +Release: 4%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -441,6 +441,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri May 11 2018 Michal Hlavinka - 2.7.2-4 +- rebuilt with updated freeipmi + * Mon Feb 23 2015 Michal Hlavinka - 2.7.2-3 - nut driver needs tmpfiles.d too (#1187286) From d745e84a4bc2f17297f2a794c75d22ae800b5ba8 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 10 Jul 2018 02:12:51 -0500 Subject: [PATCH 060/142] Remove needless use of %defattr --- nut.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nut.spec b/nut.spec index 194cd66..59e7933 100644 --- a/nut.spec +++ b/nut.spec @@ -291,7 +291,6 @@ else fi %files -%defattr(-,root,root,-) %doc COPYING LICENSE-GPL2 LICENSE-GPL3 ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf @@ -407,7 +406,6 @@ fi %{_datadir}/applications/nut-monitor.desktop %files cgi -%defattr(-,root,root,-) %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf %config(noreplace) %attr(600,nut,root) %{_sysconfdir}/ups/upsset.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/upsstats.html @@ -421,12 +419,10 @@ fi %{_mandir}/man8/upsset.cgi.8.gz %files xml -%defattr(-,root,root) %{modeldir}/netxml-ups %doc %{_mandir}/man8/netxml-ups.8.gz %files devel -%defattr(-,root,root,-) %{_includedir}/* %{_mandir}/man3/upscli* %{_mandir}/man3/nutscan* From 12a28d2b1ff566fd91f5d57b8a1c9a0ecc9ff760 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 14:34:46 +0000 Subject: [PATCH 061/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 59e7933..7a9cebe 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 17%{?dist} +Release: 18%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -436,6 +436,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 2.7.4-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Apr 17 2018 Xavier Bachelot - 2.7.4-17 - Remove unrecognized configure option --without-hal - Explicitely disable tcpwrapper support From 4364ace5680f455ad1e8e62c9824f78e5e5c4f26 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 19 Jul 2018 20:56:44 +0200 Subject: [PATCH 062/142] add BuildRequires: gcc-c++ Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index 7a9cebe..dcedc24 100644 --- a/nut.spec +++ b/nut.spec @@ -40,6 +40,7 @@ Requires(preun): systemd-units Requires(postun): coreutils chkconfig systemd-units Obsoletes: nut-hal < 2.6.0-7 +BuildRequires: gcc-c++ BuildRequires: autoconf BuildRequires: automake BuildRequires: avahi-devel From 51d7394f5a47bbb26797e2d3edfefd9d879f1187 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 24 Jul 2018 14:53:51 -0700 Subject: [PATCH 063/142] Rebuild for new net-snmp --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index dcedc24..da25627 100644 --- a/nut.spec +++ b/nut.spec @@ -18,7 +18,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 18%{?dist} +Release: 19%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -437,6 +437,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jul 24 2018 Adam Williamson - 2.7.4-19 +- Rebuild for new net-snmp + * Fri Jul 13 2018 Fedora Release Engineering - 2.7.4-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From d7d9d2abad1ce013373ba36ef32dcc9cd71c6cac Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 29 Jul 2018 23:12:05 +0200 Subject: [PATCH 064/142] =?UTF-8?q?%{python=5Fsitelib}=20=E2=86=92=20%{pyt?= =?UTF-8?q?hon2=5Fsitelib}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index da25627..e44131b 100644 --- a/nut.spec +++ b/nut.spec @@ -401,7 +401,7 @@ fi %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz %{_bindir}/nut-monitor -%{python_sitelib}/PyNUT.* +%{python2_sitelib}/PyNUT.* %{_datadir}/nut %{_datadir}/pixmaps/nut-monitor.png %{_datadir}/applications/nut-monitor.desktop From b48267cde39f7dc1238ce8dccc915a4588207f50 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 16 Oct 2018 15:33:01 +0100 Subject: [PATCH 065/142] Updates dependencies, modernise spec, use %%license, Python build fixes --- nut.spec | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/nut.spec b/nut.spec index e44131b..ea7599c 100644 --- a/nut.spec +++ b/nut.spec @@ -11,15 +11,10 @@ # powerman is retired on Fedora, therefore disable it by default %bcond_with powerman -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 6) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif - Summary: Network UPS Tools Name: nut Version: 2.7.4 Release: 19%{?dist} -Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -34,21 +29,24 @@ Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -Requires(pre): shadow-utils udev -Requires(post): coreutils chkconfig systemd-units -Requires(preun): systemd-units -Requires(postun): coreutils chkconfig systemd-units +Requires(pre): shadow-utils systemd-udev +Requires(post): coreutils systemd +Requires(preun): systemd +Requires(postun): coreutils systemd Obsoletes: nut-hal < 2.6.0-7 -BuildRequires: gcc-c++ BuildRequires: autoconf BuildRequires: automake BuildRequires: avahi-devel +BuildRequires: cppunit-devel BuildRequires: dbus-glib-devel +BuildRequires: desktop-file-utils BuildRequires: elfutils-devel BuildRequires: fontconfig-devel +BuildRequires: freeipmi-devel BuildRequires: freetype-devel BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel @@ -59,16 +57,14 @@ BuildRequires: libXpm-devel BuildRequires: neon-devel BuildRequires: net-snmp-devel BuildRequires: netpbm-devel +BuildRequires: nss-devel BuildRequires: openssl-devel BuildRequires: pkgconfig %if %{with powerman} BuildRequires: powerman-devel %endif BuildRequires: python2-devel -BuildRequires: desktop-file-utils -BuildRequires: freeipmi-devel -BuildRequires: nss-devel -BuildRequires: cppunit-devel +BuildRequires: python2-setuptools %ifnarch s390 s390x BuildRequires: libusb-devel @@ -86,11 +82,10 @@ capability has been harnessed where possible to allow for safe shutdowns, live status tracking on web pages, and more. %package client -Group: Applications/System Summary: Network UPS Tools client monitoring utilities -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(pre): shadow-utils udev +Requires(post): systemd +Requires(preun): systemd +Requires(pre): shadow-utils systemd-udev #only for python and gui part #Requires: @@ -100,7 +95,6 @@ ups that the client host has access to, but where the UPS is physically attached to a different computer on the network. %package cgi -Group: Applications/System Summary: CGI utilities for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} webserver Requires(pre): shadow-utils udev @@ -110,7 +104,6 @@ This package includes CGI programs for accessing UPS status via a web browser. %package xml -Group: Applications/System Summary: XML UPS driver for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} @@ -119,7 +112,6 @@ This package adds the netxml-ups driver, that allows NUT to monitor a XML capable UPS. %package devel -Group: Development/Libraries Summary: Development files for NUT Client Requires: %{name}-client = %{version}-%{release} webserver openssl-devel @@ -138,6 +130,7 @@ necessary to develop NUT client applications. sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop +sed -i 's|env python|env python2|' scripts/python/app/NUT-Monitor sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in @@ -183,8 +176,6 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{modeldir} \ %{buildroot}%{_sysconfdir}/udev/rules.d \ %{buildroot}%{_sysconfdir}/ups \ @@ -224,7 +215,7 @@ do done # install PyNUT -install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python_sitelib}/PyNUT.py +install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python2_sitelib}/PyNUT.py # install nut-monitor mkdir -p %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps install -p -m 755 scripts/python/app/NUT-Monitor %{buildroot}%{_datadir}/nut/nut-monitor/nut-monitor @@ -292,7 +283,8 @@ else fi %files -%doc COPYING LICENSE-GPL2 LICENSE-GPL3 ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS +%license COPYING LICENSE-GPL2 LICENSE-GPL3 +%doc ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf @@ -373,8 +365,7 @@ fi %{_mandir}/man8/usbhid-ups.8.gz %files client -%doc COPYING LICENSE-GPL2 LICENSE-GPL3 -%defattr(-,root,root) +%license COPYING LICENSE-GPL2 LICENSE-GPL3 %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf @@ -437,6 +428,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sun Oct 14 2018 Peter Robinson 2.7.4-20 +- Updates dependencies, modernise spec, use %%license +- Python build fixes + * Tue Jul 24 2018 Adam Williamson - 2.7.4-19 - Rebuild for new net-snmp From 42985ff562559d837c5e008f2fc9baaf122c212a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 16 Oct 2018 11:55:26 -0600 Subject: [PATCH 066/142] Cleanup and modernize spec Fix ownership/permissions of /var/run/nut (bug #1584330, #1580082) Fix python shbangs --- nut-client.tmpfiles | 2 +- nut.spec | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/nut-client.tmpfiles b/nut-client.tmpfiles index 56f12eb..8db0516 100644 --- a/nut-client.tmpfiles +++ b/nut-client.tmpfiles @@ -1 +1 @@ -D /var/run/nut 0750 nut nut - +D /var/run/nut 0770 root nut - diff --git a/nut.spec b/nut.spec index ea7599c..85935c5 100644 --- a/nut.spec +++ b/nut.spec @@ -1,5 +1,4 @@ -# Does not build with hardened build enabled due to PIC -%global _hardened_build 0 +%global _hardened_build 1 #TODO: split nut-client so it does not require python %global nut_uid 57 @@ -14,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 19%{?dist} +Release: 21%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -65,6 +64,7 @@ BuildRequires: powerman-devel %endif BuildRequires: python2-devel BuildRequires: python2-setuptools +BuildRequires: /usr/bin/pathfix.py %ifnarch s390 s390x BuildRequires: libusb-devel @@ -128,13 +128,15 @@ necessary to develop NUT client applications. %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf - sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python2|' scripts/python/app/NUT-Monitor sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in +# Fix python shbangs +pathfix.py -pni "%{__python2} %{py2_shbang_opts}" scripts/python scripts/python/app/NUT-Monitor + # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} @@ -172,8 +174,7 @@ sh %{SOURCE4} >>include/config.h #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool -%global _hardened_build 1 -make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" +%make_build LDFLAGS="%{__global_ldflags}" %install mkdir -p %{buildroot}%{modeldir} \ @@ -183,9 +184,9 @@ mkdir -p %{buildroot}%{modeldir} \ %{buildroot}%{_localstatedir}/lib/ups \ %{buildroot}%{_libexecdir} -make install DESTDIR=%{buildroot} +%make_install -%if %{?fedora}0 > 140 || %{?rhel}0 > 60 +%if 0%{?fedora} || 0%{?rhel} > 6 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/nut-client.conf %endif @@ -195,7 +196,7 @@ rm -rf docs/man find docs/ -name 'Makefile*' -delete pushd conf; -make install DESTDIR=%{buildroot} +%make_install for file in %{buildroot}%{_sysconfdir}/ups/*.sample do mv $file %{buildroot}%{_sysconfdir}/ups/`basename $file .sample` @@ -369,11 +370,12 @@ fi %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf -%if %{?fedora}0 > 140 || %{?rhel}0 > 60 - %config(noreplace) %{_tmpfilesdir}/nut-client.conf +%if 0%{?fedora} || 0%{?rhel} > 6 + %{_tmpfilesdir}/nut-client.conf %endif %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups -%ghost %{piddir} +# upsmon.pid is written as root, so root needs access for now +%ghost %attr(770,root,nut) %{piddir} %{_bindir}/upsc %{_bindir}/upscmd %{_bindir}/upsrw @@ -428,6 +430,11 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Oct 16 2018 Orion Poplawski - 2.7.4-21 +- Cleanup and modernize spec +- Fix ownership/permissions of /var/run/nut (bug #1584330, #1580082) +- Fix python shbangs + * Sun Oct 14 2018 Peter Robinson 2.7.4-20 - Updates dependencies, modernise spec, use %%license - Python build fixes From 128086ff93eed6c66540f193c43bde4a28b43d26 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 16:38:42 +0000 Subject: [PATCH 067/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 85935c5..ae9346f 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 21%{?dist} +Release: 22%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -430,6 +430,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 2.7.4-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Oct 16 2018 Orion Poplawski - 2.7.4-21 - Cleanup and modernize spec - Fix ownership/permissions of /var/run/nut (bug #1584330, #1580082) From 6eddf6d6491c90098bbff5bec28f9a5efcb6b77f Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 25 Mar 2019 22:47:31 +0100 Subject: [PATCH 068/142] add misssing requires for nut-monitor --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index ae9346f..cb84328 100644 --- a/nut.spec +++ b/nut.spec @@ -86,6 +86,7 @@ Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd Requires(pre): shadow-utils systemd-udev +Requires: pygtk2, pygtk2-libglade #only for python and gui part #Requires: From e7cad986509890fc329a3de764181252c42ddff9 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 25 Mar 2019 23:41:39 +0100 Subject: [PATCH 069/142] add missing requirements for nut monitor fix file descriptor leak for notifycmd --- nut-2.7.4-cloexec.patch | 82 +++++++++++++++++++++++++++++++++++++++++ nut.spec | 8 +++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 nut-2.7.4-cloexec.patch diff --git a/nut-2.7.4-cloexec.patch b/nut-2.7.4-cloexec.patch new file mode 100644 index 0000000..1061e17 --- /dev/null +++ b/nut-2.7.4-cloexec.patch @@ -0,0 +1,82 @@ +--- nut-2.7.4/common/parseconf.c.cloexec 2018-12-07 15:56:22.989381441 -0800 ++++ nut-2.7.4/common/parseconf.c 2018-12-07 16:48:33.912337591 -0800 +@@ -83,6 +83,7 @@ + #include + #include + #include ++#include + + #include "parseconf.h" + +@@ -443,6 +444,9 @@ + return 0; + } + ++ /* prevent fd leaking to child processes */ ++ fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC); ++ + return 1; /* OK */ + } + +--- nut-2.7.4/clients/upsmon.c.cloexec 2018-12-07 16:22:42.185376803 -0800 ++++ nut-2.7.4/clients/upsmon.c 2018-12-07 17:18:44.662093479 -0800 +@@ -24,6 +24,8 @@ + #include + #include + #include ++#include ++#include + + #include "upsclient.h" + #include "upsmon.h" +@@ -1432,6 +1434,9 @@ + /* we're definitely connected now */ + setflag(&ups->status, ST_CONNECTED); + ++ /* prevent connection leaking to NOTIFYCMD */ ++ fcntl(upscli_fd(&ups->conn), F_SETFD, FD_CLOEXEC); ++ + /* now try to authenticate to upsd */ + + ret = do_upsd_auth(ups); +@@ -1715,6 +1720,9 @@ + } + + close(pipefd[0]); ++ ++ /* prevent pipe leaking to NOTIFYCMD */ ++ fcntl(pipefd[1], F_SETFD, FD_CLOEXEC); + } + + static void delete_ups(utype_t *target) +--- nut-2.7.4/clients/upssched.c.cloexec 2018-12-07 17:09:13.081914570 -0800 ++++ nut-2.7.4/clients/upssched.c 2018-12-07 18:28:54.380512191 -0800 +@@ -46,6 +46,8 @@ + #include + #include + #include ++#include ++#include + + #include "upssched.h" + #include "timehead.h" +@@ -297,6 +299,9 @@ + if (ret < 0) + fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG); + ++ /* don't leak socket to CMDSCRIPT */ ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++ + return fd; + } + +@@ -370,6 +375,9 @@ + return; + } + ++ /* don't leak connection to CMDSCRIPT */ ++ fcntl(acc, F_SETFD, FD_CLOEXEC); ++ + /* enable nonblocking I/O */ + + ret = fcntl(acc, F_GETFL, 0); diff --git a/nut.spec b/nut.spec index cb84328..4ecee65 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 22%{?dist} +Release: 23%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -27,6 +27,7 @@ Patch5: nut-2.6.5-dlfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch +Patch10: nut-2.7.4-cloexec.patch Requires(pre): shadow-utils systemd-udev Requires(post): coreutils systemd @@ -128,6 +129,7 @@ necessary to develop NUT client applications. %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf +%patch10 -p1 -b .cloexec sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python2|' scripts/python/app/NUT-Monitor @@ -431,6 +433,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Mar 25 2019 Michal Hlavinka - 2.7.4-23 +- add missing requirements for nut monitor +- fix file descriptor leak for notifycmd + * Fri Feb 01 2019 Fedora Release Engineering - 2.7.4-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 6d6c4240b6c9a3f8172adba6a25c30a3ca8bf66b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 22:41:08 +0000 Subject: [PATCH 070/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 4ecee65..e937742 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -433,6 +433,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 2.7.4-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Mon Mar 25 2019 Michal Hlavinka - 2.7.4-23 - add missing requirements for nut monitor - fix file descriptor leak for notifycmd From cedf9ce5494a2a484f337cedc16622af0b201aa0 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 3 Oct 2019 16:17:01 +0200 Subject: [PATCH 071/142] drop python 2 requirements including nut-monitor app --- nut.spec | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/nut.spec b/nut.spec index e937742..af8a58a 100644 --- a/nut.spec +++ b/nut.spec @@ -1,4 +1,6 @@ %global _hardened_build 1 +#global with_python2 0 +%bcond_with python2 #TODO: split nut-client so it does not require python %global nut_uid 57 @@ -13,7 +15,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -63,8 +65,8 @@ BuildRequires: pkgconfig %if %{with powerman} BuildRequires: powerman-devel %endif -BuildRequires: python2-devel -BuildRequires: python2-setuptools +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: /usr/bin/pathfix.py %ifnarch s390 s390x @@ -132,13 +134,13 @@ necessary to develop NUT client applications. %patch10 -p1 -b .cloexec sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop -sed -i 's|env python|env python2|' scripts/python/app/NUT-Monitor +sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in # Fix python shbangs -pathfix.py -pni "%{__python2} %{py2_shbang_opts}" scripts/python scripts/python/app/NUT-Monitor +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/python scripts/python/app/NUT-Monitor # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} @@ -219,8 +221,9 @@ do done # install PyNUT -install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python2_sitelib}/PyNUT.py +install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python3_sitelib}/PyNUT.py # install nut-monitor +%if %{with python2} mkdir -p %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps install -p -m 755 scripts/python/app/NUT-Monitor %{buildroot}%{_datadir}/nut/nut-monitor/nut-monitor install -p -m 644 scripts/python/app/gui-1.3.glade %{buildroot}%{_datadir}/nut/nut-monitor @@ -228,6 +231,7 @@ install -p -m 644 scripts/python/app/pixmaps/* %{buildroot}%{_datadir}/nut/nut-m install -p -D scripts/python/app/nut-monitor.png %{buildroot}%{_datadir}/pixmaps/nut-monitor.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications scripts/python/app/nut-monitor.desktop ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor +%endif %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ @@ -396,11 +400,13 @@ fi %{_mandir}/man8/upsrw.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz -%{_bindir}/nut-monitor -%{python2_sitelib}/PyNUT.* +%{python3_sitelib}/ %{_datadir}/nut +%if %{with python2} +%{_bindir}/nut-monitor %{_datadir}/pixmaps/nut-monitor.png %{_datadir}/applications/nut-monitor.desktop +%endif %files cgi %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf @@ -433,6 +439,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Oct 03 2019 Michal Hlavinka - 2.7.4-25 +- drop python 2 requirements including nut-monitor app + * Thu Jul 25 2019 Fedora Release Engineering - 2.7.4-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 2ef3bf834eb57e279115f479ead0058f919dec5c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 4 Oct 2019 09:45:54 +0200 Subject: [PATCH 072/142] drop pygtk2 requirements --- nut.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index af8a58a..7ac1d95 100644 --- a/nut.spec +++ b/nut.spec @@ -15,7 +15,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 25%{?dist} +Release: 26%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -89,8 +89,10 @@ Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd Requires(pre): shadow-utils systemd-udev +%if %{with python2} Requires: pygtk2, pygtk2-libglade #only for python and gui part +%endif #Requires: %description client @@ -439,6 +441,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Oct 04 2019 Michal Hlavinka - 2.7.4-26 +- drop pygtk2 requirements + * Thu Oct 03 2019 Michal Hlavinka - 2.7.4-25 - drop python 2 requirements including nut-monitor app From 102a89ce81d7990bceb3772b8838b02ba5b915c0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 19:21:07 +0000 Subject: [PATCH 073/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 7ac1d95..bea8c13 100644 --- a/nut.spec +++ b/nut.spec @@ -15,7 +15,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 26%{?dist} +Release: 27%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -441,6 +441,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 2.7.4-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Fri Oct 04 2019 Michal Hlavinka - 2.7.4-26 - drop pygtk2 requirements From 19a1c7c1632b77f55aae9b6286d096a95c30b1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 26 May 2020 02:54:31 +0200 Subject: [PATCH 074/142] Rebuilt for Python 3.9 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index bea8c13..87990d2 100644 --- a/nut.spec +++ b/nut.spec @@ -15,7 +15,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 27%{?dist} +Release: 28%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -441,6 +441,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue May 26 2020 Miro Hrončok - 2.7.4-28 +- Rebuilt for Python 3.9 + * Wed Jan 29 2020 Fedora Release Engineering - 2.7.4-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 8b3ec16975a8e652d075e88f93d09b00ac94c68c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 26 May 2020 13:22:19 +0200 Subject: [PATCH 075/142] nut updated to 2.7.4 --- nut-2.6.5-dlfix.patch | 135 +++++-------------------------------- nut-2.6.5-pthreadfix.patch | 36 ---------- nut-2.6.5-quickfix.patch | 10 ++- nut.spec | 48 ++++++++----- 4 files changed, 51 insertions(+), 178 deletions(-) delete mode 100644 nut-2.6.5-pthreadfix.patch diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch index 4375324..f93b5ea 100644 --- a/nut-2.6.5-dlfix.patch +++ b/nut-2.6.5-dlfix.patch @@ -1,126 +1,25 @@ -diff -up nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_avahi.c ---- nut-2.7.1/tools/nut-scanner/scan_avahi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_avahi.c 2014-02-27 11:25:57.610869514 +0100 -@@ -36,7 +36,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libavahi-client"; -+static char * libname = LIBAVAHI_CLIENT_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -99,7 +99,7 @@ int nutscan_load_avahi_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.1/tools/nut-scanner/scan_ipmi.c ---- nut-2.7.1/tools/nut-scanner/scan_ipmi.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_ipmi.c 2014-02-27 11:32:20.393015238 +0100 -@@ -35,7 +35,7 @@ - #define IPMI_RETRANSMISSION_TIMEOUT_LENGTH_DEFAULT 250 - - /* dynamic link library stuff */ --static char * libname = "libfreeipmi"; -+static char * libname = LIBFREEIPMI_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -128,7 +128,7 @@ int nutscan_load_ipmi_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.1/tools/nut-scanner/scan_nut.c ---- nut-2.7.1/tools/nut-scanner/scan_nut.c.dlfix 2013-10-30 14:47:15.000000000 +0100 -+++ nut-2.7.1/tools/nut-scanner/scan_nut.c 2014-02-27 11:25:57.611869522 +0100 -@@ -26,7 +26,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libupsclient"; -+static char * libname = LIBUPSCLIENT_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -67,7 +67,7 @@ int nutscan_load_upsclient_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.1/tools/nut-scanner/scan_snmp.c ---- nut-2.7.1/tools/nut-scanner/scan_snmp.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_snmp.c 2014-02-27 11:25:57.611869522 +0100 -@@ -74,7 +74,7 @@ static int thread_count = 0; - long g_usec_timeout ; - - /* dynamic link library stuff */ --static char * libname = "libnetsnmp"; -+static char * libname = LIBNETSNMP_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -119,7 +119,7 @@ int nutscan_load_snmp_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.1/tools/nut-scanner/scan_usb.c ---- nut-2.7.1/tools/nut-scanner/scan_usb.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_usb.c 2014-02-27 11:25:57.611869522 +0100 -@@ -28,7 +28,7 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libusb"; -+static char * libname = LIBUSB_PATH; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - static int (*nut_usb_close)(usb_dev_handle *dev); -@@ -58,7 +58,7 @@ int nutscan_load_usb_library() - return 0; - } - -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; -diff -up nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.1/tools/nut-scanner/scan_xml_http.c ---- nut-2.7.1/tools/nut-scanner/scan_xml_http.c.dlfix 2013-07-31 22:41:31.000000000 +0200 -+++ nut-2.7.1/tools/nut-scanner/scan_xml_http.c 2014-02-27 11:25:57.611869522 +0100 -@@ -33,7 +33,7 @@ +diff -up nut-2.7.4/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_avahi.c +diff -up nut-2.7.4/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_ipmi.c +diff -up nut-2.7.4/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.4/tools/nut-scanner/scan_nut.c +diff -up nut-2.7.4/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.4/tools/nut-scanner/scan_snmp.c +diff -up nut-2.7.4/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.4/tools/nut-scanner/scan_usb.c +diff -up nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.4/tools/nut-scanner/scan_xml_http.c +--- nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix 2016-03-08 13:01:11.000000000 +0100 ++++ nut-2.7.4/tools/nut-scanner/scan_xml_http.c 2016-03-12 00:23:02.554826665 +0100 +@@ -37,7 +37,6 @@ #include /* dynamic link library stuff */ -static char * libname = "libneon"; -+static char * libname = LIBNEON_PATH; static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; -@@ -64,7 +64,7 @@ int nutscan_load_neon_library() - return 0; - } +@@ -102,7 +101,7 @@ int nutscan_load_neon_library(const char -- dl_handle = lt_dlopenext(libname); -+ dl_handle = lt_dlopen(libname); - if (!dl_handle) { - dl_error = lt_dlerror(); - goto err; + return 1; + err: +- fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname, dl_error); ++ fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname_path, dl_error); + dl_handle = (void *)1; + lt_dlexit(); + return 0; diff --git a/nut-2.6.5-pthreadfix.patch b/nut-2.6.5-pthreadfix.patch deleted file mode 100644 index a471c99..0000000 --- a/nut-2.6.5-pthreadfix.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.7.1/tools/nut-scanner/nut-scanner.c ---- nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix 2014-02-27 11:37:57.045786437 +0100 -+++ nut-2.7.1/tools/nut-scanner/nut-scanner.c 2014-02-27 11:39:02.591326696 +0100 -@@ -532,25 +532,25 @@ display_help: - } - - #ifdef HAVE_PTHREAD -- if( allow_usb && nutscan_avail_usb ) { -+ if( allow_usb && nutscan_avail_usb && thread[TYPE_USB]) { - pthread_join(thread[TYPE_USB],NULL); - } -- if( allow_snmp && nutscan_avail_snmp ) { -+ if( allow_snmp && nutscan_avail_snmp && thread[TYPE_SNMP]) { - pthread_join(thread[TYPE_SNMP],NULL); - } -- if( allow_xml && nutscan_avail_xml_http ) { -+ if( allow_xml && nutscan_avail_xml_http && thread[TYPE_XML]) { - pthread_join(thread[TYPE_XML],NULL); - } -- if( allow_oldnut && nutscan_avail_nut ) { -+ if( allow_oldnut && nutscan_avail_nut && thread[TYPE_NUT]) { - pthread_join(thread[TYPE_NUT],NULL); - } -- if( allow_avahi && nutscan_avail_avahi ) { -+ if( allow_avahi && nutscan_avail_avahi && thread[TYPE_AVAHI]) { - pthread_join(thread[TYPE_AVAHI],NULL); - } -- if( allow_ipmi && nutscan_avail_ipmi ) { -+ if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) { - pthread_join(thread[TYPE_IPMI],NULL); - } -- if (allow_eaton_serial) { -+ if (allow_eaton_serial && thread[TYPE_EATON_SERIAL]) { - pthread_join(thread[TYPE_EATON_SERIAL],NULL); - } - #endif /* HAVE_PTHREAD */ diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch index c5b8038..aa11fe6 100644 --- a/nut-2.6.5-quickfix.patch +++ b/nut-2.6.5-quickfix.patch @@ -1,14 +1,12 @@ -diff -up nut-2.7.1/configure.ac.quickfix nut-2.7.1/configure.ac ---- nut-2.7.1/configure.ac.quickfix 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/configure.ac 2014-02-27 11:25:57.608869497 +0100 -@@ -1027,9 +1027,8 @@ dnl Override installation directory, wit +diff -up nut-2.7.3/configure.ac.quickfix nut-2.7.3/configure.ac +--- nut-2.7.3/configure.ac.quickfix 2015-04-23 12:05:21.219228670 +0200 ++++ nut-2.7.3/configure.ac 2015-04-23 12:05:21.230228646 +0200 +@@ -1065,7 +1065,7 @@ dnl Override installation directory, wit dnl prefix. This is needed for 'distcheck*' targets, otherwise dnl files will try to get intalled to the actual system directories if test -n "${systemdsystemunitdir}"; then - systemdsystemshutdowndir="${libdir}/systemd/system-shutdown" + systemdsystemshutdowndir="/lib/systemd/system-shutdown" AC_MSG_RESULT(using ${systemdsystemunitdir}) -- systemdsystemunitdir="`echo ${systemdsystemunitdir} | sed 's/\/lib/\${libdir}/'`" else AC_MSG_RESULT(no) - fi diff --git a/nut.spec b/nut.spec index c518055..11cbd05 100644 --- a/nut.spec +++ b/nut.spec @@ -1,3 +1,7 @@ +%global _hardened_build 1 +%global with_python2 1 +%bcond_with python2 + #TODO: split nut-client so it does not require python %global nut_uid 57 %global nut_gid 57 @@ -12,8 +16,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.7.2 -Release: 4%{?dist} +Version: 2.7.4 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -26,10 +30,10 @@ Patch1: nut-2.6.3-tmpfiles.patch Patch3: nut-2.6.5-quickfix.patch Patch4: nut-2.6.5-ipmifix.patch Patch5: nut-2.6.5-dlfix.patch -Patch6: nut-2.6.5-pthreadfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch +Patch10: nut-2.7.4-cloexec.patch Requires(pre): shadow-utils udev Requires(post): fileutils chkconfig systemd-units @@ -40,10 +44,15 @@ Obsoletes: nut-hal < 2.6.0-7 BuildRequires: autoconf BuildRequires: automake BuildRequires: avahi-devel +BuildRequires: cppunit-devel BuildRequires: dbus-glib-devel +BuildRequires: desktop-file-utils BuildRequires: elfutils-devel BuildRequires: fontconfig-devel +BuildRequires: freeipmi-devel BuildRequires: freetype-devel +BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel @@ -54,13 +63,11 @@ BuildRequires: libXpm-devel BuildRequires: neon-devel BuildRequires: net-snmp-devel BuildRequires: netpbm-devel +BuildRequires: nss-devel BuildRequires: openssl-devel BuildRequires: pkgconfig #BuildRequires: powerman-devel BuildRequires: python-devel -BuildRequires: desktop-file-utils -BuildRequires: freeipmi-devel - %ifnarch s390 s390x BuildRequires: libusb-devel %endif @@ -79,9 +86,10 @@ live status tracking on web pages, and more. %package client Group: Applications/System Summary: Network UPS Tools client monitoring utilities -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(pre): shadow-utils udev +Requires(post): systemd +Requires(preun): systemd +Requires(pre): shadow-utils systemd-udev +Requires: pygtk2, pygtk2-libglade #only for python and gui part #Requires: @@ -122,14 +130,14 @@ necessary to develop NUT client applications. %setup -q %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix -#%patch4 -p1 -b .ipmifix %patch5 -p1 -b .dlfix -%patch6 -p1 -b .pthreadfix %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf #%patch10 -p1 -b .fixupslog #%patch11 -p1 -b .systemdfix +%patch10 -p1 -b .cloexec + sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in @@ -146,6 +154,8 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i +# prevent assignment of default value, it would break configure's tests +export LDFLAGS="-Wl,-z,now" %configure \ --with-all \ --without-powerman \ @@ -165,7 +175,7 @@ autoreconf -i --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ - --libdir=%{_libdir} + --libdir=%{_libdir} # --with-doc # does not work in 2.7.1 sh %{SOURCE4} >>include/config.h @@ -206,7 +216,6 @@ done popd #fix collision with virtualbox -mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules # fix encoding @@ -290,8 +299,8 @@ fi rm -rf %{buildroot} %files -%defattr(-,root,root,-) -%doc COPYING LICENSE-GPL2 LICENSE-GPL3 ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS +%license COPYING LICENSE-GPL2 LICENSE-GPL3 +%doc ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf @@ -374,8 +383,7 @@ rm -rf %{buildroot} %{_mandir}/man8/usbhid-ups.8.gz %files client -%doc COPYING LICENSE-GPL2 LICENSE-GPL3 -%defattr(-,root,root) +%license COPYING LICENSE-GPL2 LICENSE-GPL3 %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf @@ -383,7 +391,8 @@ rm -rf %{buildroot} /usr/lib/tmpfiles.d/nut-run.conf %endif %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups -%ghost %{piddir} +# upsmon.pid is written as root, so root needs access for now +%ghost %attr(770,root,nut) %{piddir} %{_bindir}/upsc %{_bindir}/upscmd %{_bindir}/upsrw @@ -441,6 +450,9 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue May 26 2020 Michal Hlavinka - 2.7.4-1 +- nut updated to 2.7.4 + * Fri May 11 2018 Michal Hlavinka - 2.7.2-4 - rebuilt with updated freeipmi From e51245f2b576bdaecf173987954855fea900eb7a Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 26 May 2020 13:28:56 +0200 Subject: [PATCH 076/142] update sources --- .gitignore | 1 + nut-2.7.4-cloexec.patch | 82 +++++++++++++++++++++++++++++++++++++++++ nut.spec | 2 - sources | 2 +- 4 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 nut-2.7.4-cloexec.patch diff --git a/.gitignore b/.gitignore index e21a10c..4a36018 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ nut-2.4.3.tar.gz /nut-2.6.5.tar.gz /nut-2.7.1.tar.gz /nut-2.7.2.tar.gz +/nut-2.7.4.tar.gz diff --git a/nut-2.7.4-cloexec.patch b/nut-2.7.4-cloexec.patch new file mode 100644 index 0000000..1061e17 --- /dev/null +++ b/nut-2.7.4-cloexec.patch @@ -0,0 +1,82 @@ +--- nut-2.7.4/common/parseconf.c.cloexec 2018-12-07 15:56:22.989381441 -0800 ++++ nut-2.7.4/common/parseconf.c 2018-12-07 16:48:33.912337591 -0800 +@@ -83,6 +83,7 @@ + #include + #include + #include ++#include + + #include "parseconf.h" + +@@ -443,6 +444,9 @@ + return 0; + } + ++ /* prevent fd leaking to child processes */ ++ fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC); ++ + return 1; /* OK */ + } + +--- nut-2.7.4/clients/upsmon.c.cloexec 2018-12-07 16:22:42.185376803 -0800 ++++ nut-2.7.4/clients/upsmon.c 2018-12-07 17:18:44.662093479 -0800 +@@ -24,6 +24,8 @@ + #include + #include + #include ++#include ++#include + + #include "upsclient.h" + #include "upsmon.h" +@@ -1432,6 +1434,9 @@ + /* we're definitely connected now */ + setflag(&ups->status, ST_CONNECTED); + ++ /* prevent connection leaking to NOTIFYCMD */ ++ fcntl(upscli_fd(&ups->conn), F_SETFD, FD_CLOEXEC); ++ + /* now try to authenticate to upsd */ + + ret = do_upsd_auth(ups); +@@ -1715,6 +1720,9 @@ + } + + close(pipefd[0]); ++ ++ /* prevent pipe leaking to NOTIFYCMD */ ++ fcntl(pipefd[1], F_SETFD, FD_CLOEXEC); + } + + static void delete_ups(utype_t *target) +--- nut-2.7.4/clients/upssched.c.cloexec 2018-12-07 17:09:13.081914570 -0800 ++++ nut-2.7.4/clients/upssched.c 2018-12-07 18:28:54.380512191 -0800 +@@ -46,6 +46,8 @@ + #include + #include + #include ++#include ++#include + + #include "upssched.h" + #include "timehead.h" +@@ -297,6 +299,9 @@ + if (ret < 0) + fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG); + ++ /* don't leak socket to CMDSCRIPT */ ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++ + return fd; + } + +@@ -370,6 +375,9 @@ + return; + } + ++ /* don't leak connection to CMDSCRIPT */ ++ fcntl(acc, F_SETFD, FD_CLOEXEC); ++ + /* enable nonblocking I/O */ + + ret = fcntl(acc, F_GETFL, 0); diff --git a/nut.spec b/nut.spec index 11cbd05..01ba0af 100644 --- a/nut.spec +++ b/nut.spec @@ -134,8 +134,6 @@ necessary to develop NUT client applications. %patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -#%patch10 -p1 -b .fixupslog -#%patch11 -p1 -b .systemdfix %patch10 -p1 -b .cloexec sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop diff --git a/sources b/sources index e01f451..58940c6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c3568b42e058cfc385b46d25140dced4 nut-2.7.2.tar.gz +SHA512 (nut-2.7.4.tar.gz) = 320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a From 625fa20c1a9dcce79f8a12513c8c5377509c1322 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 18 May 2020 12:37:58 -0600 Subject: [PATCH 077/142] Add upstream patch for OpenSSL 1.1.0 support, enable for Fedora >= 33 --- 504.patch | 333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ nut.spec | 11 +- 2 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 504.patch diff --git a/504.patch b/504.patch new file mode 100644 index 0000000..71e1bf4 --- /dev/null +++ b/504.patch @@ -0,0 +1,333 @@ +From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Mon, 27 Nov 2017 21:10:13 +0100 +Subject: [PATCH 1/7] Add support for openssl-1.1.0 + +--- + clients/upsclient.c | 4 ++++ + m4/nut_check_libopenssl.m4 | 5 +++-- + server/netssl.c | 4 ++++ + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index b90587b00..fc5e7523c 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -316,7 +316,11 @@ int upscli_init(int certverify, const char *certpath, + + #ifdef WITH_OPENSSL + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++#else ++ OPENSSL_init_ssl(0, NULL); ++#endif + SSL_load_error_strings(); + + ssl_method = TLSv1_client_method(); +diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 +index 1b875077b..5f29f4a38 100644 +--- a/m4/nut_check_libopenssl.m4 ++++ b/m4/nut_check_libopenssl.m4 +@@ -57,8 +57,9 @@ if test -z "${nut_have_libopenssl_seen}"; then + AC_MSG_RESULT([${LIBS}]) + + dnl check if openssl is usable +- AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) +- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no]) ++ AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) ++ AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) ++ AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) + + if test "${nut_have_openssl}" = "yes"; then + nut_with_ssl="yes" +diff --git a/server/netssl.c b/server/netssl.c +index c2f409899..0f9a70acf 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -388,7 +388,11 @@ void ssl_init(void) + #ifdef WITH_OPENSSL + + SSL_load_error_strings(); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++#else ++ OPENSSL_init_ssl(0, NULL); ++#endif + + if ((ssl_method = TLSv1_server_method()) == NULL) { + ssl_debug(); + +From b15656efb2575647ca0e0b6439b6380373767b8f Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Tue, 28 Nov 2017 20:00:52 +0100 +Subject: [PATCH 2/7] Allow TLSv1 and higher (not just TLSv1) + +--- + clients/upsclient.c | 30 +++++++++++++++++------------- + server/netssl.c | 26 +++++++++++++++----------- + 2 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index fc5e7523c..bd951e854 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -299,11 +299,6 @@ int upscli_init(int certverify, const char *certpath, + { + #ifdef WITH_OPENSSL + int ret, ssl_mode = SSL_VERIFY_NONE; +-#if OPENSSL_VERSION_NUMBER >= 0x10000000L +- const SSL_METHOD *ssl_method; +-#else +- SSL_METHOD *ssl_method; +-#endif + #elif defined(WITH_NSS) /* WITH_OPENSSL */ + SECStatus status; + #endif /* WITH_OPENSSL | WITH_NSS */ +@@ -315,26 +310,35 @@ int upscli_init(int certverify, const char *certpath, + } + + #ifdef WITH_OPENSSL ++ ++ SSL_load_error_strings(); + + #if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++ ++ ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + #else + OPENSSL_init_ssl(0, NULL); +-#endif +- SSL_load_error_strings(); + +- ssl_method = TLSv1_client_method(); +- +- if (!ssl_method) { +- return 0; +- } ++ ssl_ctx = SSL_CTX_new(TLS_client_method()); ++#endif + +- ssl_ctx = SSL_CTX_new(ssl_method); + if (!ssl_ctx) { + upslogx(LOG_ERR, "Can not initialize SSL context"); + return -1; + } + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ /* set minimum protocol TLSv1 */ ++ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++#else ++ ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION); ++ if (ret != 1) { ++ upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1"); ++ return -1; ++ } ++#endif ++ + if (!certpath) { + if (certverify == 1) { + upslogx(LOG_ERR, "Can not verify certificate if any is specified"); +diff --git a/server/netssl.c b/server/netssl.c +index 0f9a70acf..98680d25e 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -371,13 +371,7 @@ void ssl_init(void) + { + #ifdef WITH_NSS + SECStatus status; +-#elif defined(WITH_OPENSSL) +-#if OPENSSL_VERSION_NUMBER >= 0x10000000L +- const SSL_METHOD *ssl_method; +-#else +- SSL_METHOD *ssl_method; +-#endif +-#endif /* WITH_NSS|WITH_OPENSSL */ ++#endif /* WITH_NSS */ + + if (!certfile) { + return; +@@ -388,21 +382,31 @@ void ssl_init(void) + #ifdef WITH_OPENSSL + + SSL_load_error_strings(); ++ + #if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++ ++ ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + #else + OPENSSL_init_ssl(0, NULL); ++ ++ ssl_ctx = SSL_CTX_new(TLS_server_method()); + #endif + +- if ((ssl_method = TLSv1_server_method()) == NULL) { ++ if (!ssl_ctx) { + ssl_debug(); +- fatalx(EXIT_FAILURE, "TLSv1_server_method failed"); ++ fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); + } + +- if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ /* set minimum protocol TLSv1 */ ++ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++#else ++ if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) { + ssl_debug(); +- fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); ++ fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)"); + } ++#endif + + if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) { + ssl_debug(); + +From 5a8308aef9884017754fb70620c8ded34fa44290 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Tue, 28 Nov 2017 22:01:41 +0100 +Subject: [PATCH 3/7] Fix check for empty string + +--- + clients/upssched.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clients/upssched.c b/clients/upssched.c +index 97b3ed42d..3fdf118ed 100644 +--- a/clients/upssched.c ++++ b/clients/upssched.c +@@ -794,7 +794,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd, + } + + if (!strcmp(cmd, "EXECUTE")) { +- if (ca1 == '\0') { ++ if (ca1[0] == '\0') { + upslogx(LOG_ERR, "Empty EXECUTE command argument"); + return; + } + +From 5ecfb0ffe3d89a5116dd287ff2c3f60de67ecbb9 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Fri, 1 Dec 2017 12:24:00 +0100 +Subject: [PATCH 4/7] Report TLS handshake in debug mode + +--- + clients/upsclient.c | 2 +- + server/netssl.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index bd951e854..b7dd8f424 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -745,7 +745,7 @@ static int upscli_sslinit(UPSCONN_t *ups, int verifycert) + switch(res) + { + case 1: +- upsdebugx(3, "SSL connected"); ++ upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl)); + break; + case 0: + upslog_with_errno(1, "SSL_connect do not accept handshake."); +diff --git a/server/netssl.c b/server/netssl.c +index 98680d25e..6ae13e8d3 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -275,7 +275,7 @@ void net_starttls(nut_ctype_t *client, int numarg, const char **arg) + { + case 1: + client->ssl_connected = 1; +- upsdebugx(3, "SSL connected"); ++ upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl)); + break; + + case 0: + +From ab0c8b41c0530d3706e4997257939026cfd29ccc Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:31:21 +0100 +Subject: [PATCH 5/7] Update nut_check_libopenssl.m4 + +--- + m4/nut_check_libopenssl.m4 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 +index 5f29f4a38..7eb401cd9 100644 +--- a/m4/nut_check_libopenssl.m4 ++++ b/m4/nut_check_libopenssl.m4 +@@ -57,9 +57,8 @@ if test -z "${nut_have_libopenssl_seen}"; then + AC_MSG_RESULT([${LIBS}]) + + dnl check if openssl is usable +- AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) +- AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) +- AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) ++ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) ++ AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no]) + + if test "${nut_have_openssl}" = "yes"; then + nut_with_ssl="yes" + +From 1dc34a5da7308f0f85537a6761fefb3ff3098863 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:34:53 +0100 +Subject: [PATCH 6/7] Update upsclient.c + +--- + clients/upsclient.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index b7dd8f424..541664f36 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -311,15 +311,12 @@ int upscli_init(int certverify, const char *certpath, + + #ifdef WITH_OPENSSL + +- SSL_load_error_strings(); +- + #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ SSL_load_error_strings(); + SSL_library_init(); + + ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + #else +- OPENSSL_init_ssl(0, NULL); +- + ssl_ctx = SSL_CTX_new(TLS_client_method()); + #endif + + +From 108c31c9b170da2ee34a25fd373d21837d4d10a3 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:37:42 +0100 +Subject: [PATCH 7/7] Update netssl.c + +--- + server/netssl.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/server/netssl.c b/server/netssl.c +index 6ae13e8d3..cf9419edf 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -381,15 +381,12 @@ void ssl_init(void) + + #ifdef WITH_OPENSSL + +- SSL_load_error_strings(); +- + #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ SSL_load_error_strings(); + SSL_library_init(); + + ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + #else +- OPENSSL_init_ssl(0, NULL); +- + ssl_ctx = SSL_CTX_new(TLS_server_method()); + #endif + diff --git a/nut.spec b/nut.spec index 87990d2..018f70a 100644 --- a/nut.spec +++ b/nut.spec @@ -1,5 +1,4 @@ %global _hardened_build 1 -#global with_python2 0 %bcond_with python2 #TODO: split nut-client so it does not require python @@ -15,12 +14,14 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 28%{?dist} +Release: 29%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz Source3: nut-client.tmpfiles Source4: libs.sh +# Upstream support for OpenSSL-1.1.0, TLS > 1.0 +Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch Patch1: nut-2.6.3-tmpfiles.patch #quick fix. TODO: fix it properly @@ -127,6 +128,7 @@ necessary to develop NUT client applications. %prep %setup -q +%patch0 -p1 -b .openssl %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix %patch5 -p1 -b .dlfix @@ -157,7 +159,9 @@ export LDFLAGS="-Wl,-z,now" --without-powerman \ %endif --with-libltdl \ +%if (0%{?fedora} && 0%{?fedora} < 33) || 0%{?el8} --with-nss \ +%endif --without-wrap \ --with-cgi \ --datadir=%{_datadir}/%{name} \ @@ -441,6 +445,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue May 26 2020 Orion Poplawski - 2.7.4-29 +- Add upstream patch for OpenSSL 1.1.0 support, enable for Fedora >= 33 + * Tue May 26 2020 Miro Hrončok - 2.7.4-28 - Rebuilt for Python 3.9 From 457d12308e43283b942217248954a6a5a08781ab Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 18 May 2020 15:07:42 -0600 Subject: [PATCH 078/142] Drop old udev requires/scriptlet --- nut.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nut.spec b/nut.spec index 018f70a..257de26 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 29%{?dist} +Release: 30%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -32,7 +32,7 @@ Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch -Requires(pre): shadow-utils systemd-udev +Requires(pre): shadow-utils Requires(post): coreutils systemd Requires(preun): systemd Requires(postun): coreutils systemd @@ -89,7 +89,7 @@ live status tracking on web pages, and more. Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd -Requires(pre): shadow-utils systemd-udev +Requires(pre): shadow-utils %if %{with python2} Requires: pygtk2, pygtk2-libglade #only for python and gui part @@ -104,7 +104,7 @@ attached to a different computer on the network. %package cgi Summary: CGI utilities for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} webserver -Requires(pre): shadow-utils udev +Requires(pre): shadow-utils %description cgi This package includes CGI programs for accessing UPS status via a web @@ -255,7 +255,6 @@ fi %post /sbin/ldconfig -udevadm control --reload ||: %systemd_post nut-driver.service nut-server.service %preun @@ -445,6 +444,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue May 26 2020 Orion Poplawski - 2.7.4-30 +- Drop old udev requires/scriptlet + * Tue May 26 2020 Orion Poplawski - 2.7.4-29 - Add upstream patch for OpenSSL 1.1.0 support, enable for Fedora >= 33 From a95181eec440caf499a569df3c4c3779d80aeb9a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 18 May 2020 15:07:42 -0600 Subject: [PATCH 079/142] Drop old udev requires/scriptlet Add upstream patch for TLS > 1.0 support Cleanup spec Conflicts: nut.spec --- 504.patch | 333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ nut.spec | 41 +++---- 2 files changed, 350 insertions(+), 24 deletions(-) create mode 100644 504.patch diff --git a/504.patch b/504.patch new file mode 100644 index 0000000..71e1bf4 --- /dev/null +++ b/504.patch @@ -0,0 +1,333 @@ +From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Mon, 27 Nov 2017 21:10:13 +0100 +Subject: [PATCH 1/7] Add support for openssl-1.1.0 + +--- + clients/upsclient.c | 4 ++++ + m4/nut_check_libopenssl.m4 | 5 +++-- + server/netssl.c | 4 ++++ + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index b90587b00..fc5e7523c 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -316,7 +316,11 @@ int upscli_init(int certverify, const char *certpath, + + #ifdef WITH_OPENSSL + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++#else ++ OPENSSL_init_ssl(0, NULL); ++#endif + SSL_load_error_strings(); + + ssl_method = TLSv1_client_method(); +diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 +index 1b875077b..5f29f4a38 100644 +--- a/m4/nut_check_libopenssl.m4 ++++ b/m4/nut_check_libopenssl.m4 +@@ -57,8 +57,9 @@ if test -z "${nut_have_libopenssl_seen}"; then + AC_MSG_RESULT([${LIBS}]) + + dnl check if openssl is usable +- AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) +- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no]) ++ AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) ++ AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) ++ AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) + + if test "${nut_have_openssl}" = "yes"; then + nut_with_ssl="yes" +diff --git a/server/netssl.c b/server/netssl.c +index c2f409899..0f9a70acf 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -388,7 +388,11 @@ void ssl_init(void) + #ifdef WITH_OPENSSL + + SSL_load_error_strings(); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++#else ++ OPENSSL_init_ssl(0, NULL); ++#endif + + if ((ssl_method = TLSv1_server_method()) == NULL) { + ssl_debug(); + +From b15656efb2575647ca0e0b6439b6380373767b8f Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Tue, 28 Nov 2017 20:00:52 +0100 +Subject: [PATCH 2/7] Allow TLSv1 and higher (not just TLSv1) + +--- + clients/upsclient.c | 30 +++++++++++++++++------------- + server/netssl.c | 26 +++++++++++++++----------- + 2 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index fc5e7523c..bd951e854 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -299,11 +299,6 @@ int upscli_init(int certverify, const char *certpath, + { + #ifdef WITH_OPENSSL + int ret, ssl_mode = SSL_VERIFY_NONE; +-#if OPENSSL_VERSION_NUMBER >= 0x10000000L +- const SSL_METHOD *ssl_method; +-#else +- SSL_METHOD *ssl_method; +-#endif + #elif defined(WITH_NSS) /* WITH_OPENSSL */ + SECStatus status; + #endif /* WITH_OPENSSL | WITH_NSS */ +@@ -315,26 +310,35 @@ int upscli_init(int certverify, const char *certpath, + } + + #ifdef WITH_OPENSSL ++ ++ SSL_load_error_strings(); + + #if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++ ++ ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + #else + OPENSSL_init_ssl(0, NULL); +-#endif +- SSL_load_error_strings(); + +- ssl_method = TLSv1_client_method(); +- +- if (!ssl_method) { +- return 0; +- } ++ ssl_ctx = SSL_CTX_new(TLS_client_method()); ++#endif + +- ssl_ctx = SSL_CTX_new(ssl_method); + if (!ssl_ctx) { + upslogx(LOG_ERR, "Can not initialize SSL context"); + return -1; + } + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ /* set minimum protocol TLSv1 */ ++ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++#else ++ ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION); ++ if (ret != 1) { ++ upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1"); ++ return -1; ++ } ++#endif ++ + if (!certpath) { + if (certverify == 1) { + upslogx(LOG_ERR, "Can not verify certificate if any is specified"); +diff --git a/server/netssl.c b/server/netssl.c +index 0f9a70acf..98680d25e 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -371,13 +371,7 @@ void ssl_init(void) + { + #ifdef WITH_NSS + SECStatus status; +-#elif defined(WITH_OPENSSL) +-#if OPENSSL_VERSION_NUMBER >= 0x10000000L +- const SSL_METHOD *ssl_method; +-#else +- SSL_METHOD *ssl_method; +-#endif +-#endif /* WITH_NSS|WITH_OPENSSL */ ++#endif /* WITH_NSS */ + + if (!certfile) { + return; +@@ -388,21 +382,31 @@ void ssl_init(void) + #ifdef WITH_OPENSSL + + SSL_load_error_strings(); ++ + #if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); ++ ++ ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + #else + OPENSSL_init_ssl(0, NULL); ++ ++ ssl_ctx = SSL_CTX_new(TLS_server_method()); + #endif + +- if ((ssl_method = TLSv1_server_method()) == NULL) { ++ if (!ssl_ctx) { + ssl_debug(); +- fatalx(EXIT_FAILURE, "TLSv1_server_method failed"); ++ fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); + } + +- if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ /* set minimum protocol TLSv1 */ ++ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ++#else ++ if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) { + ssl_debug(); +- fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); ++ fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)"); + } ++#endif + + if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) { + ssl_debug(); + +From 5a8308aef9884017754fb70620c8ded34fa44290 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Tue, 28 Nov 2017 22:01:41 +0100 +Subject: [PATCH 3/7] Fix check for empty string + +--- + clients/upssched.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clients/upssched.c b/clients/upssched.c +index 97b3ed42d..3fdf118ed 100644 +--- a/clients/upssched.c ++++ b/clients/upssched.c +@@ -794,7 +794,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd, + } + + if (!strcmp(cmd, "EXECUTE")) { +- if (ca1 == '\0') { ++ if (ca1[0] == '\0') { + upslogx(LOG_ERR, "Empty EXECUTE command argument"); + return; + } + +From 5ecfb0ffe3d89a5116dd287ff2c3f60de67ecbb9 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Fri, 1 Dec 2017 12:24:00 +0100 +Subject: [PATCH 4/7] Report TLS handshake in debug mode + +--- + clients/upsclient.c | 2 +- + server/netssl.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index bd951e854..b7dd8f424 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -745,7 +745,7 @@ static int upscli_sslinit(UPSCONN_t *ups, int verifycert) + switch(res) + { + case 1: +- upsdebugx(3, "SSL connected"); ++ upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl)); + break; + case 0: + upslog_with_errno(1, "SSL_connect do not accept handshake."); +diff --git a/server/netssl.c b/server/netssl.c +index 98680d25e..6ae13e8d3 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -275,7 +275,7 @@ void net_starttls(nut_ctype_t *client, int numarg, const char **arg) + { + case 1: + client->ssl_connected = 1; +- upsdebugx(3, "SSL connected"); ++ upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl)); + break; + + case 0: + +From ab0c8b41c0530d3706e4997257939026cfd29ccc Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:31:21 +0100 +Subject: [PATCH 5/7] Update nut_check_libopenssl.m4 + +--- + m4/nut_check_libopenssl.m4 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 +index 5f29f4a38..7eb401cd9 100644 +--- a/m4/nut_check_libopenssl.m4 ++++ b/m4/nut_check_libopenssl.m4 +@@ -57,9 +57,8 @@ if test -z "${nut_have_libopenssl_seen}"; then + AC_MSG_RESULT([${LIBS}]) + + dnl check if openssl is usable +- AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) +- AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) +- AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) ++ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) ++ AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no]) + + if test "${nut_have_openssl}" = "yes"; then + nut_with_ssl="yes" + +From 1dc34a5da7308f0f85537a6761fefb3ff3098863 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:34:53 +0100 +Subject: [PATCH 6/7] Update upsclient.c + +--- + clients/upsclient.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/clients/upsclient.c b/clients/upsclient.c +index b7dd8f424..541664f36 100644 +--- a/clients/upsclient.c ++++ b/clients/upsclient.c +@@ -311,15 +311,12 @@ int upscli_init(int certverify, const char *certpath, + + #ifdef WITH_OPENSSL + +- SSL_load_error_strings(); +- + #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ SSL_load_error_strings(); + SSL_library_init(); + + ssl_ctx = SSL_CTX_new(SSLv23_client_method()); + #else +- OPENSSL_init_ssl(0, NULL); +- + ssl_ctx = SSL_CTX_new(TLS_client_method()); + #endif + + +From 108c31c9b170da2ee34a25fd373d21837d4d10a3 Mon Sep 17 00:00:00 2001 +From: Arjen de Korte +Date: Sun, 24 Feb 2019 18:37:42 +0100 +Subject: [PATCH 7/7] Update netssl.c + +--- + server/netssl.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/server/netssl.c b/server/netssl.c +index 6ae13e8d3..cf9419edf 100644 +--- a/server/netssl.c ++++ b/server/netssl.c +@@ -381,15 +381,12 @@ void ssl_init(void) + + #ifdef WITH_OPENSSL + +- SSL_load_error_strings(); +- + #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ SSL_load_error_strings(); + SSL_library_init(); + + ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + #else +- OPENSSL_init_ssl(0, NULL); +- + ssl_ctx = SSL_CTX_new(TLS_server_method()); + #endif + diff --git a/nut.spec b/nut.spec index 01ba0af..37cb990 100644 --- a/nut.spec +++ b/nut.spec @@ -7,23 +7,21 @@ %global nut_gid 57 %global cgidir /var/www/nut-cgi-bin -%global piddir /var/run/nut +%global piddir /run/nut %global modeldir /usr/sbin -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 6) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif - Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz Source3: nut-client.tmpfiles Source4: libs.sh +# Upstream support for OpenSSL-1.1.0, TLS > 1.0 +Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch Patch1: nut-2.6.3-tmpfiles.patch #quick fix. TODO: fix it properly @@ -35,10 +33,10 @@ Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch -Requires(pre): shadow-utils udev -Requires(post): fileutils chkconfig systemd-units -Requires(preun): systemd-units -Requires(postun): fileutils chkconfig systemd-units +Requires(pre): shadow-utils +Requires(post): coreutils systemd +Requires(preun): systemd +Requires(postun): coreutils systemd Obsoletes: nut-hal < 2.6.0-7 BuildRequires: autoconf @@ -63,7 +61,6 @@ BuildRequires: libXpm-devel BuildRequires: neon-devel BuildRequires: net-snmp-devel BuildRequires: netpbm-devel -BuildRequires: nss-devel BuildRequires: openssl-devel BuildRequires: pkgconfig #BuildRequires: powerman-devel @@ -88,7 +85,7 @@ Group: Applications/System Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd -Requires(pre): shadow-utils systemd-udev +Requires(pre): shadow-utils Requires: pygtk2, pygtk2-libglade #only for python and gui part #Requires: @@ -102,7 +99,7 @@ attached to a different computer on the network. Group: Applications/System Summary: CGI utilities for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} webserver -Requires(pre): shadow-utils udev +Requires(pre): shadow-utils %description cgi This package includes CGI programs for accessing UPS status via a web @@ -128,6 +125,7 @@ necessary to develop NUT client applications. %prep %setup -q +%patch0 -p1 -b .openssl %patch1 -p1 -b .tmpfiles %patch3 -p1 -b .quickfix %patch5 -p1 -b .dlfix @@ -182,11 +180,9 @@ sh %{SOURCE4} >>include/config.h sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %global _hardened_build 1 -make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" +%make_build CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{modeldir} \ %{buildroot}%{_sysconfdir}/udev/rules.d \ %{buildroot}%{_sysconfdir}/ups \ @@ -194,7 +190,7 @@ mkdir -p %{buildroot}%{modeldir} \ %{buildroot}%{_localstatedir}/lib/ups \ %{buildroot}%{_libexecdir} -make install DESTDIR=%{buildroot} +%make_install %if %{?fedora}0 > 140 || %{?rhel}0 > 60 install -p -D -m 644 %{SOURCE3} %{buildroot}/usr/lib/tmpfiles.d/nut-run.conf @@ -251,7 +247,6 @@ fi %post /sbin/ldconfig -udevadm control --reload ||: systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || : %systemd_post nut-driver.service nut-server.service @@ -293,9 +288,6 @@ else /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : fi -%clean -rm -rf %{buildroot} - %files %license COPYING LICENSE-GPL2 LICENSE-GPL3 %doc ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS @@ -415,7 +407,6 @@ rm -rf %{buildroot} %{_datadir}/applications/nut-monitor.desktop %files cgi -%defattr(-,root,root,-) %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf %config(noreplace) %attr(600,nut,root) %{_sysconfdir}/ups/upsset.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/upsstats.html @@ -429,12 +420,10 @@ rm -rf %{buildroot} %{_mandir}/man8/upsset.cgi.8.gz %files xml -%defattr(-,root,root) %{modeldir}/netxml-ups %doc %{_mandir}/man8/netxml-ups.8.gz %files devel -%defattr(-,root,root,-) %{_includedir}/* %{_mandir}/man3/upscli* %{_mandir}/man3/nutscan* @@ -448,6 +437,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue May 26 2020 Orion Poplawski - 2.7.4-2 +- Drop old udev requires/scriptlet +- Add upstream patch for TLS > 1.0 support + * Tue May 26 2020 Michal Hlavinka - 2.7.4-1 - nut updated to 2.7.4 From 0c577010f8681523b63d4cc60bc6cfa5a20c9f77 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 2 Jun 2020 19:25:24 +0200 Subject: [PATCH 080/142] update nut run directories --- nut-2.6.3-tmpfiles.patch | 4 ++-- nut-2.6.5-foreground.patch | 2 +- nut-client.tmpfiles | 2 +- nut.spec | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 8cf4bb0..ee0d7e1 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -5,7 +5,7 @@ diff -up nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.2/scri StopWhenUnneeded=yes [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf ExecStart=@SBINDIR@/upsdrvctl start ExecStop=@SBINDIR@/upsdrvctl stop Type=forking @@ -16,7 +16,7 @@ diff -up nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.2/scr After=local-fs.target network.target nut-server.service [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf ExecStart=@SBINDIR@/upsmon PIDFile=@PIDPATH@/upsmon.pid Type=forking diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch index 0504e62..b97e8c4 100644 --- a/nut-2.6.5-foreground.patch +++ b/nut-2.6.5-foreground.patch @@ -55,7 +55,7 @@ diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/s @@ -4,9 +4,8 @@ After=local-fs.target network.target nut [Service] - ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf + ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf -ExecStart=@SBINDIR@/upsmon -PIDFile=@PIDPATH@/upsmon.pid -Type=forking diff --git a/nut-client.tmpfiles b/nut-client.tmpfiles index 56f12eb..c91e2eb 100644 --- a/nut-client.tmpfiles +++ b/nut-client.tmpfiles @@ -1 +1 @@ -D /var/run/nut 0750 nut nut - +D /run/nut 0750 nut nut - diff --git a/nut.spec b/nut.spec index 37cb990..7a7f960 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ @@ -437,6 +437,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 02 2020 Michal Hlavinka - 2.7.4-3 +- update nut run directories + * Tue May 26 2020 Orion Poplawski - 2.7.4-2 - Drop old udev requires/scriptlet - Add upstream patch for TLS > 1.0 support From c06083e69185565f70c0cf67a43c3be4a6bf7226 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 2 Jun 2020 19:57:29 +0200 Subject: [PATCH 081/142] update tmpfiles nut run directory --- nut-client.tmpfiles | 2 +- nut.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nut-client.tmpfiles b/nut-client.tmpfiles index 8db0516..df35b88 100644 --- a/nut-client.tmpfiles +++ b/nut-client.tmpfiles @@ -1 +1 @@ -D /var/run/nut 0770 root nut - +D /run/nut 0770 root nut - diff --git a/nut.spec b/nut.spec index 257de26..9af3a05 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 30%{?dist} +Release: 31%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -444,6 +444,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 02 2020 Michal Hlavinka - 2.7.4-31 +- update tmpfiles nut run directory + * Tue May 26 2020 Orion Poplawski - 2.7.4-30 - Drop old udev requires/scriptlet From be873096855f49c24c29799d4f25936e6b418cc6 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 2 Jun 2020 20:09:33 +0200 Subject: [PATCH 082/142] nut user needs tty group for wall (#1774591) --- nut.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nut.spec b/nut.spec index 9af3a05..6cf29f3 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 31%{?dist} +Release: 32%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -242,7 +242,7 @@ ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} # do not let upsmon run during upgrade rhbz#916472 # phase 1: stop upsmon before upsd changes @@ -267,12 +267,12 @@ fi %pre client /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} %pre cgi /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} %post client /sbin/ldconfig @@ -444,6 +444,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 02 2020 Michal Hlavinka - 2.7.4-32 +- nut user needs tty group for wall (#1774591) + * Tue Jun 02 2020 Michal Hlavinka - 2.7.4-31 - update tmpfiles nut run directory From 24127d18ecaf0729fc177122cbfb903376141486 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 21 Jul 2020 23:59:27 -0600 Subject: [PATCH 083/142] - Do not link nut_scanner against libcommon. --- nut-link.patch | 12 ++++++++++++ nut.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 nut-link.patch diff --git a/nut-link.patch b/nut-link.patch new file mode 100644 index 0000000..a26f6a5 --- /dev/null +++ b/nut-link.patch @@ -0,0 +1,12 @@ +diff -Nrup a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am +--- a/tools/nut-scanner/Makefile.am 2015-12-29 05:08:34.000000000 -0700 ++++ b/tools/nut-scanner/Makefile.am 2020-01-07 15:26:14.134932956 -0700 +@@ -21,7 +21,7 @@ libnutscan_la_CFLAGS = -I$(top_srcdir)/c + + nut_scanner_SOURCES = nut-scanner.c + nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include +-nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la ++nut_scanner_LDADD = libnutscan.la + + if WITH_SSL + libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) diff --git a/nut.spec b/nut.spec index 6cf29f3..dbb1fe7 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 32%{?dist} +Release: 33%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -31,6 +31,7 @@ Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch +Patch11: nut-link.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -136,6 +137,7 @@ necessary to develop NUT client applications. %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf %patch10 -p1 -b .cloexec +%patch11 -p1 -b .link sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor @@ -444,6 +446,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jul 21 2020 Jeff Law - 2.7.4-33 +- Do not link nut_scanner against libcommon. + * Tue Jun 02 2020 Michal Hlavinka - 2.7.4-32 - nut user needs tty group for wall (#1774591) From d0c40659688d94e1ba93f1cb84cac1c6e8597dc9 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 22 Jul 2020 00:21:05 -0600 Subject: [PATCH 084/142] Revert "- Do not link nut_scanner against libcommon." This reverts commit 24127d18ecaf0729fc177122cbfb903376141486. --- nut-link.patch | 12 ------------ nut.spec | 7 +------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 nut-link.patch diff --git a/nut-link.patch b/nut-link.patch deleted file mode 100644 index a26f6a5..0000000 --- a/nut-link.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nrup a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am ---- a/tools/nut-scanner/Makefile.am 2015-12-29 05:08:34.000000000 -0700 -+++ b/tools/nut-scanner/Makefile.am 2020-01-07 15:26:14.134932956 -0700 -@@ -21,7 +21,7 @@ libnutscan_la_CFLAGS = -I$(top_srcdir)/c - - nut_scanner_SOURCES = nut-scanner.c - nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include --nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la -+nut_scanner_LDADD = libnutscan.la - - if WITH_SSL - libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) diff --git a/nut.spec b/nut.spec index dbb1fe7..6cf29f3 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 33%{?dist} +Release: 32%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -31,7 +31,6 @@ Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch -Patch11: nut-link.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -137,7 +136,6 @@ necessary to develop NUT client applications. %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf %patch10 -p1 -b .cloexec -%patch11 -p1 -b .link sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor @@ -446,9 +444,6 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog -* Tue Jul 21 2020 Jeff Law - 2.7.4-33 -- Do not link nut_scanner against libcommon. - * Tue Jun 02 2020 Michal Hlavinka - 2.7.4-32 - nut user needs tty group for wall (#1774591) From beee923bc53da4ed6b25d938003755d31527958f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 11:59:39 +0000 Subject: [PATCH 085/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 6cf29f3..71815cf 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 32%{?dist} +Release: 33%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -444,6 +444,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 2.7.4-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Jun 02 2020 Michal Hlavinka - 2.7.4-32 - nut user needs tty group for wall (#1774591) From 7c2f27590b26afd74a033a3b753d3381be54603f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 06:34:34 +0000 Subject: [PATCH 086/142] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 71815cf..eed26f6 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 33%{?dist} +Release: 34%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -444,6 +444,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 2.7.4-34 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Jul 28 2020 Fedora Release Engineering - 2.7.4-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From e056aaaff8118dd751704332146c629beaa59343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 2 Sep 2020 10:28:01 +0200 Subject: [PATCH 087/142] Resolves: #1865077 - FTBFS in Fedora 33 --- nut-2.7.4-nutscanner-FTBFS.patch | 20 ++++++++++++++++++++ nut.spec | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nut-2.7.4-nutscanner-FTBFS.patch diff --git a/nut-2.7.4-nutscanner-FTBFS.patch b/nut-2.7.4-nutscanner-FTBFS.patch new file mode 100644 index 0000000..fcb4f37 --- /dev/null +++ b/nut-2.7.4-nutscanner-FTBFS.patch @@ -0,0 +1,20 @@ +diff -urNp a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am +--- a/tools/nut-scanner/Makefile.am 2020-09-02 10:16:27.304816091 +0200 ++++ b/tools/nut-scanner/Makefile.am 2020-09-02 10:17:58.119811844 +0200 +@@ -14,14 +14,14 @@ libnutscan_la_SOURCES = scan_nut.c scan_ + scan_avahi.c scan_eaton_serial.c nutscan-serial.c \ + ../../drivers/serial.c \ + ../../drivers/bcmxcp_ser.c \ +- ../../common/common.c ++ ../../common/common.c ../../common/str.c + libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) + libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0 + libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL_CFLAGS) -I$(top_srcdir)/drivers + + nut_scanner_SOURCES = nut-scanner.c + nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include +-nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la ++nut_scanner_LDADD = libnutscan.la + + if WITH_SSL + libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) diff --git a/nut.spec b/nut.spec index eed26f6..2377eae 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 34%{?dist} +Release: 35%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -31,6 +31,7 @@ Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch +Patch11: nut-2.7.4-nutscanner-FTBFS.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -136,6 +137,7 @@ necessary to develop NUT client applications. %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf %patch10 -p1 -b .cloexec +%patch11 -p1 -b .nutscanner-FTBFS sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor @@ -444,6 +446,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Sep 02 2020 Josef Ridky - 2.7.4-35 +- Resolves: #1865077 - FTBFS in Fedora 33 +- Rebuilt for new release of net-snmp + * Sat Aug 01 2020 Fedora Release Engineering - 2.7.4-34 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 82e198976ee447ef93d49c637eb3d08a3ce189c6 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 15 Sep 2020 14:11:00 -0600 Subject: [PATCH 088/142] Force C++14 as this code is not C++17 ready --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 2377eae..f0af699 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 35%{?dist} +Release: 36%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -153,6 +153,7 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i +export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" # prevent assignment of default value, it would break configure's tests export LDFLAGS="-Wl,-z,now" %configure \ @@ -446,6 +447,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Sep 15 2020 Jeff Law - 2.7.4-36 +- Force C++14 as this code is not C++17 ready + * Wed Sep 02 2020 Josef Ridky - 2.7.4-35 - Resolves: #1865077 - FTBFS in Fedora 33 - Rebuilt for new release of net-snmp From d6f674e2d5b0ec5ed6a7a6cb77507db1d77d217d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Jan 2021 06:05:39 +0000 Subject: [PATCH 089/142] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index f0af699..7239e84 100644 --- a/nut.spec +++ b/nut.spec @@ -39,6 +39,7 @@ Requires(preun): systemd Requires(postun): coreutils systemd Obsoletes: nut-hal < 2.6.0-7 +BuildRequires: make BuildRequires: autoconf BuildRequires: automake BuildRequires: avahi-devel From b05fc4a3e4d306aa4fc54c7e9d7463c7413ef234 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 21:47:42 +0000 Subject: [PATCH 090/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 7239e84..915e27b 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 36%{?dist} +Release: 37%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -448,6 +448,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 2.7.4-37 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Sep 15 2020 Jeff Law - 2.7.4-36 - Force C++14 as this code is not C++17 ready From 4fe949d473644207a3d90be8cae78ed92db8fc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 2 Mar 2021 16:13:17 +0100 Subject: [PATCH 091/142] Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 915e27b..b7e3f95 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 37%{?dist} +Release: 38%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -448,6 +448,10 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.7.4-38 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + * Tue Jan 26 2021 Fedora Release Engineering - 2.7.4-37 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 4db73a7664a75b8062da58314bb1851aa651e8f2 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 4 Jun 2021 20:13:20 +0200 Subject: [PATCH 092/142] Rebuilt for Python 3.10 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index b7e3f95..0b70251 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 38%{?dist} +Release: 39%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -448,6 +448,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Jun 04 2021 Python Maint - 2.7.4-39 +- Rebuilt for Python 3.10 + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.7.4-38 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. From c8d877dae3c8e3cae50fd3f5d696781c04912f2c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 8 Jun 2021 14:08:15 +0200 Subject: [PATCH 093/142] drop snmp-ups support for DES, as required net-snmp no longer supports it --- nut-2.7.4-scratchdes.patch | 16 ++++++++++++++++ nut.spec | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 nut-2.7.4-scratchdes.patch diff --git a/nut-2.7.4-scratchdes.patch b/nut-2.7.4-scratchdes.patch new file mode 100644 index 0000000..eb793d2 --- /dev/null +++ b/nut-2.7.4-scratchdes.patch @@ -0,0 +1,16 @@ +diff -up nut-2.7.4/drivers/snmp-ups.c.scratchdes nut-2.7.4/drivers/snmp-ups.c +--- nut-2.7.4/drivers/snmp-ups.c.scratchdes 2021-06-08 13:56:32.608702337 +0200 ++++ nut-2.7.4/drivers/snmp-ups.c 2021-06-08 13:56:32.622702201 +0200 +@@ -471,11 +471,7 @@ void nut_snmp_init(const char *type, con + + privProtocol = testvar(SU_VAR_PRIVPROT) ? getval(SU_VAR_PRIVPROT) : "DES"; + +- if (strcmp(privProtocol, "DES") == 0) { +- g_snmp_sess.securityPrivProto = usmDESPrivProtocol; +- g_snmp_sess.securityPrivProtoLen = sizeof(usmDESPrivProtocol)/sizeof(oid); +- } +- else if (strcmp(privProtocol, "AES") == 0) { ++ if (strcmp(privProtocol, "AES") == 0) { + g_snmp_sess.securityPrivProto = usmAESPrivProtocol; + g_snmp_sess.securityPrivProtoLen = sizeof(usmAESPrivProtocol)/sizeof(oid); + } diff --git a/nut.spec b/nut.spec index 0b70251..453218f 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 39%{?dist} +Release: 40%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -32,6 +32,7 @@ Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch Patch11: nut-2.7.4-nutscanner-FTBFS.patch +Patch12: nut-2.7.4-scratchdes.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -139,6 +140,7 @@ necessary to develop NUT client applications. %patch9 -p1 -b .rmpidf %patch10 -p1 -b .cloexec %patch11 -p1 -b .nutscanner-FTBFS +%patch12 -p1 -b .scratchdes sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor @@ -448,6 +450,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 08 2021 Michal Hlavinka - 2.7.4-40 +- drop snmp-ups support for DES, as required net-snmp no longer supports it + * Fri Jun 04 2021 Python Maint - 2.7.4-39 - Rebuilt for Python 3.10 From 99495edf470e0b5041340632bb41d6097ede373b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 16:26:14 +0000 Subject: [PATCH 094/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 453218f..bd534e3 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 40%{?dist} +Release: 41%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -450,6 +450,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 2.7.4-41 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jun 08 2021 Michal Hlavinka - 2.7.4-40 - drop snmp-ups support for DES, as required net-snmp no longer supports it From cdbcbed29f5356729b76007d43f4649474aa8bed Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:09:20 +0200 Subject: [PATCH 095/142] Rebuilt with OpenSSL 3.0.0 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index bd534e3..9093d31 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 41%{?dist} +Release: 42%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -450,6 +450,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Sep 14 2021 Sahana Prasad - 2.7.4-42 +- Rebuilt with OpenSSL 3.0.0 + * Thu Jul 22 2021 Fedora Release Engineering - 2.7.4-41 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From d08ed319dd5d3b2e120907e94c9bddb1bc1b1bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 23 Sep 2021 13:31:07 +0200 Subject: [PATCH 096/142] Don't own /usr/lib/python3.X/site-packages --- nut.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index 9093d31..1c738fb 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 42%{?dist} +Release: 43%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -411,7 +411,7 @@ fi %{_mandir}/man8/upsrw.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz -%{python3_sitelib}/ +%pycached %{python3_sitelib}/PyNUT.py %{_datadir}/nut %if %{with python2} %{_bindir}/nut-monitor @@ -450,6 +450,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Sep 23 2021 Miro Hrončok - 2.7.4-43 +- Don't own /usr/lib/python3.X/site-packages + * Tue Sep 14 2021 Sahana Prasad - 2.7.4-42 - Rebuilt with OpenSSL 3.0.0 From 5c64b71173ffe1bb6f59310d19c2b3ab2a429c7c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 21:31:57 +0000 Subject: [PATCH 097/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 1c738fb..fb873f2 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.7.4 -Release: 43%{?dist} +Release: 44%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz @@ -450,6 +450,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 2.7.4-44 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Thu Sep 23 2021 Miro Hrončok - 2.7.4-43 - Don't own /usr/lib/python3.X/site-packages From 48685366900985696be8371d8deea6494ae36c43 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 6 Jun 2022 22:39:25 +0200 Subject: [PATCH 098/142] updated to 2.8.0 --- .gitignore | 1 + nut-2.6.3-tmpfiles.patch | 45 +++++++++++++-------- nut-2.6.5-rmpidf.patch | 60 ++++++++++++++-------------- nut-2.6.5-unreachable.patch | 17 ++++---- nut.spec | 79 ++++++++++++++++++++++++------------- sources | 2 +- 6 files changed, 121 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 01c65a3..b466deb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ nut-2.4.3.tar.gz /nut-2.7.2.tar.gz /nut-2.7.3.tar.gz /nut-2.7.4.tar.gz +/nut-2.8.0.tar.gz diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 0b45e1c..7f7cd98 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -1,22 +1,33 @@ -diff -up nut-2.7.4/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.4/scripts/systemd/nut-driver.service.in ---- nut-2.7.4/scripts/systemd/nut-driver.service.in.tmpfiles 2016-08-11 16:58:00.759001400 +0200 -+++ nut-2.7.4/scripts/systemd/nut-driver.service.in 2016-08-11 16:58:38.619248466 +0200 -@@ -4,6 +4,7 @@ After=local-fs.target network.target - StopWhenUnneeded=yes - - [Service] +diff -up nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in +--- nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles 2022-05-09 16:42:37.296229637 +0200 ++++ nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in 2022-05-09 16:42:51.139030657 +0200 +@@ -23,6 +23,7 @@ Type=oneshot + # don't want it to fail the unit (when it can't restart). + Environment=REPORT_RESTART_42=no + EnvironmentFile=-@CONFPATH@/nut.conf +ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf - ExecStart=@SBINDIR@/upsdrvctl start - ExecStop=@SBINDIR@/upsdrvctl stop - Type=forking -diff -up nut-2.7.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.4/scripts/systemd/nut-monitor.service.in ---- nut-2.7.4/scripts/systemd/nut-monitor.service.in.tmpfiles 2015-12-29 09:42:34.000000000 +0100 -+++ nut-2.7.4/scripts/systemd/nut-monitor.service.in 2016-08-11 16:57:48.121918934 +0200 -@@ -3,6 +3,7 @@ Description=Network UPS Tools - power de - After=local-fs.target network.target nut-server.service + ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh + ExecReload=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh +diff -up nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver@.service.in +--- nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles 2022-05-09 16:41:00.952614514 +0200 ++++ nut-2.8.0/scripts/systemd/nut-driver@.service.in 2022-05-09 16:41:42.783013227 +0200 +@@ -40,6 +40,7 @@ PartOf=nut-driver.target [Service] + EnvironmentFile=-@CONFPATH@/nut.conf + SyslogIdentifier=%N +ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf - ExecStart=@SBINDIR@/upsmon + ExecStart=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl start "$NUTDEV"' + ExecStop=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl stop "$NUTDEV"' + # Restart really always, do not stop trying: +diff -up nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-monitor.service.in +--- nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles 2022-05-09 12:57:35.160646121 +0200 ++++ nut-2.8.0/scripts/systemd/nut-monitor.service.in 2022-05-09 16:40:18.289227772 +0200 +@@ -18,6 +18,7 @@ PartOf=nut.target + [Service] + EnvironmentFile=-@CONFPATH@/nut.conf + SyslogIdentifier=%N ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf + ExecStart=@SBINDIR@/upsmon -F + ExecReload=@SBINDIR@/upsmon -c reload PIDFile=@PIDPATH@/upsmon.pid - Type=forking diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index 3041c6d..54c6e1e 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,7 +1,7 @@ -diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c ---- nut-2.7.1/clients/upsmon.c.rmpidf 2014-02-27 11:41:09.139369295 +0100 -+++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:41:09.145369344 +0100 -@@ -2027,6 +2027,7 @@ int main(int argc, char *argv[]) +diff -up nut-2.8.0/clients/upsmon.c.rmpidf nut-2.8.0/clients/upsmon.c +--- nut-2.8.0/clients/upsmon.c.rmpidf 2022-04-23 13:56:06.000000000 +0200 ++++ nut-2.8.0/clients/upsmon.c 2022-05-09 17:22:34.329547283 +0200 +@@ -2314,6 +2314,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); upsmon_cleanup(); @@ -9,47 +9,47 @@ diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c exit(EXIT_SUCCESS); } -diff -up nut-2.7.1/common/common.c.rmpidf nut-2.7.1/common/common.c ---- nut-2.7.1/common/common.c.rmpidf 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/common/common.c 2014-02-27 11:41:09.146369353 +0100 -@@ -229,6 +229,20 @@ void writepid(const char *name) - umask(mask); +diff -up nut-2.8.0/common/common.c.rmpidf nut-2.8.0/common/common.c +--- nut-2.8.0/common/common.c.rmpidf 2022-05-09 17:22:34.329547283 +0200 ++++ nut-2.8.0/common/common.c 2022-05-09 17:26:48.671847245 +0200 +@@ -358,6 +358,20 @@ pid_t parsepid(const char *buf) + return pid; } +/* remove pid file */ +void cleanpid(const char *name) +{ -+ char fn[SMALLBUF]; ++ char fn[SMALLBUF]; + -+ /* use full path if present, else build filename in PIDPATH */ -+ if (*name == '/') -+ snprintf(fn, sizeof(fn), "%s", name); -+ else -+ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name); ++ /* use full path if present, else build filename in PIDPATH */ ++ if (*name == '/') ++ snprintf(fn, sizeof(fn), "%s", name); ++ else ++ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name); + -+ unlink(fn); ++ unlink(fn); +} + - /* open pidfn, get the pid, then send it sig */ - int sendsignalfn(const char *pidfn, int sig) - { -diff -up nut-2.7.1/include/common.h.rmpidf nut-2.7.1/include/common.h ---- nut-2.7.1/include/common.h.rmpidf 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/include/common.h 2014-02-27 11:41:09.146369353 +0100 -@@ -70,6 +70,9 @@ void chroot_start(const char *path); + /* open pidfn, get the pid, then send it sig + * returns negative codes for errors, or + * zero for a successfully sent signal +diff -up nut-2.8.0/include/common.h.rmpidf nut-2.8.0/include/common.h +--- nut-2.8.0/include/common.h.rmpidf 2022-05-09 17:22:34.329547283 +0200 ++++ nut-2.8.0/include/common.h 2022-05-09 17:25:47.439740973 +0200 +@@ -103,6 +103,9 @@ void chroot_start(const char *path); /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); +/* remove pid file */ +void cleanpid(const char *name); + - /* send a signal to another running process */ - int sendsignal(const char *progname, int sig); - -diff -up nut-2.7.1/server/upsd.c.rmpidf nut-2.7.1/server/upsd.c ---- nut-2.7.1/server/upsd.c.rmpidf 2014-02-27 11:41:09.146369353 +0100 -+++ nut-2.7.1/server/upsd.c 2014-02-27 11:42:03.715818754 +0100 -@@ -1050,6 +1050,7 @@ int main(int argc, char **argv) + /* parses string buffer into a pid_t if it passes + * a few sanity checks; returns -1 on error */ + pid_t parsepid(const char *buf); +diff -up nut-2.8.0/server/upsd.c.rmpidf nut-2.8.0/server/upsd.c +--- nut-2.8.0/server/upsd.c.rmpidf 2022-04-23 13:56:07.000000000 +0200 ++++ nut-2.8.0/server/upsd.c 2022-05-09 17:22:34.330547269 +0200 +@@ -1515,6 +1515,7 @@ int main(int argc, char **argv) ssl_cleanup(); upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); diff --git a/nut-2.6.5-unreachable.patch b/nut-2.6.5-unreachable.patch index 3c9db41..4166e84 100644 --- a/nut-2.6.5-unreachable.patch +++ b/nut-2.6.5-unreachable.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable nut-2.6.5/scripts/python/app/NUT-Monitor ---- nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/scripts/python/app/NUT-Monitor 2013-01-07 18:04:26.532531441 +0100 -@@ -674,6 +674,11 @@ class interface : +diff -up nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in +--- nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable 2022-05-09 17:20:11.629621005 +0200 ++++ nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in 2022-05-09 17:20:52.674024537 +0200 +@@ -693,6 +693,11 @@ along with this program. If not, see 1.0 @@ -25,7 +25,6 @@ Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/50 Patch1: nut-2.6.3-tmpfiles.patch #quick fix. TODO: fix it properly -Patch3: nut-2.6.5-quickfix.patch Patch5: nut-2.6.5-dlfix.patch Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch @@ -60,6 +59,8 @@ BuildRequires: libtool BuildRequires: libtool-ltdl-devel BuildRequires: libX11-devel BuildRequires: libXpm-devel +BuildRequires: libmodbus-devel +BuildRequires: libi2c-devel BuildRequires: neon-devel BuildRequires: net-snmp-devel BuildRequires: netpbm-devel @@ -131,26 +132,21 @@ necessary to develop NUT client applications. %prep %setup -q -%patch0 -p1 -b .openssl +#patch0 -p1 -b .openssl %patch1 -p1 -b .tmpfiles -%patch3 -p1 -b .quickfix -%patch5 -p1 -b .dlfix -%patch7 -p1 -b .foreground +#patch5 -p1 -b .dlfix +#%patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -%patch10 -p1 -b .cloexec -%patch11 -p1 -b .nutscanner-FTBFS -%patch12 -p1 -b .scratchdes +#%patch10 -p1 -b .cloexec +#%patch11 -p1 -b .nutscanner-FTBFS +#%patch12 -p1 -b .scratchdes -sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop -sed -i 's|env python|env python3|' scripts/python/app/NUT-Monitor -sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor +sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop +sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in -# Fix python shbangs -pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/python scripts/python/app/NUT-Monitor - # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} @@ -170,16 +166,18 @@ export LDFLAGS="-Wl,-z,now" %endif --without-wrap \ --with-cgi \ + --with-python3 \ --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ --with-group=dialout \ - --with-statepath=%{piddir} \ - --with-pidpath=%{piddir} \ - --with-altpidpath=%{piddir} \ + --with-statepath=/var/run \ + --with-pidpath=/var/run \ + --with-altpidpath=/var/run \ --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ --with-systemdsystemunitdir=%{_unitdir} \ + --with-systemdshutdowndir=/lib/systemd/system-shutdown \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ @@ -203,9 +201,11 @@ mkdir -p %{buildroot}%{modeldir} \ %make_install -%if 0%{?fedora} || 0%{?rhel} > 6 - install -p -D -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/nut-client.conf -%endif +#if 0%{?fedora} || 0%{?rhel} > 6 +# install -p -D -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/nut-client.conf +#endif + +mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/nut-common.conf rm -rf %{buildroot}%{_prefix}/html rm -f %{buildroot}%{_libdir}/*.la @@ -312,22 +312,33 @@ fi %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups -%{_unitdir}/nut-driver.service +%{_unitdir}/nut-driver-enumerator.path +%{_unitdir}/nut-driver-enumerator.service +%{_unitdir}/nut-driver@.service +%{_unitdir}/nut-driver.target %{_unitdir}/nut-server.service +%{_unitdir}/nut.target %{_sbindir}/upsd %{_bindir}/nut-scanner %{_bindir}/upslog %{_libdir}/libnutscan.so.* +%{_libexecdir}/nut-driver-enumerator.sh +%{_datadir}/augeas/lenses/dist/nut* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list %{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/ups.conf.5.gz %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz + +%{_mandir}/man8/adelsystem_cbi.8.gz + + %{_mandir}/man8/al175.8.gz %{_mandir}/man8/apcsmart.8.gz %{_mandir}/man8/apcsmart-old.8.gz %{_mandir}/man8/apcupsd-ups.8.gz +%{_mandir}/man8/asem.8.gz %{_mandir}/man8/bcmxcp.8* %{_mandir}/man8/bcmxcp_usb.8.gz %{_mandir}/man8/belkin.8.gz @@ -343,7 +354,9 @@ fi %{_mandir}/man8/everups.8.gz %{_mandir}/man8/etapro.8.gz %{_mandir}/man8/gamatronic.8.gz +%{_mandir}/man8/generic_modbus.8.gz %{_mandir}/man8/genericups.8.gz +%{_mandir}/man8/huawei-ups2000.8.gz %{_mandir}/man8/isbmex.8.gz %{_mandir}/man8/ivtscd.8.gz %{_mandir}/man8/liebert.8.gz @@ -351,16 +364,21 @@ fi %{_mandir}/man8/masterguard.8.gz %{_mandir}/man8/metasys.8.gz %{_mandir}/man8/microdowell.8.gz +%{_mandir}/man8/microsol-apc.8.gz %{_mandir}/man8/mge-utalk.8.gz %{_mandir}/man8/mge-shut.8.gz %{_mandir}/man8/nutupsdrv.8.gz %{_mandir}/man8/nutdrv_atcl_usb.8.gz +%{_mandir}/man8/nutdrv_siemens_sitop.8.gz +%{_mandir}/man8/nut-driver-enumerator.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz %{_mandir}/man8/nut-recorder.8.gz %{_mandir}/man8/nut-scanner.8.gz %{_mandir}/man8/nutdrv_qx.8.gz %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz +%{_mandir}/man8/phoenixcontact_modbus.8.gz +%{_mandir}/man8/pijuice.8.gz %{_mandir}/man8/powercom.8.gz %if %{with powerman} %{_mandir}/man8/powerman-pdu.8.gz @@ -373,6 +391,7 @@ fi %{_mandir}/man8/safenet.8.gz %{_mandir}/man8/snmp-ups.8.gz %{_mandir}/man8/solis.8* +%{_mandir}/man8/socomec_jbus.8.gz %{_mandir}/man8/tripplite.8.gz %{_mandir}/man8/tripplite_usb.8.gz %{_mandir}/man8/tripplitesu.8.gz @@ -380,6 +399,7 @@ fi %{_mandir}/man8/upscode2.8* %{_mandir}/man8/upsd.8.gz %{_mandir}/man8/upsdrvctl.8.gz +%{_mandir}/man8/upsdrvsvcctl.8.gz %{_mandir}/man8/upslog.8.gz %{_mandir}/man8/usbhid-ups.8.gz @@ -388,9 +408,8 @@ fi %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf -%if 0%{?fedora} || 0%{?rhel} > 6 - %{_tmpfilesdir}/nut-client.conf -%endif +#{_tmpfilesdir}/nut-client.conf +%{_tmpfilesdir}/nut-common.conf %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups # upsmon.pid is written as root, so root needs access for now %ghost %attr(770,root,nut) %{piddir} @@ -404,6 +423,7 @@ fi /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* %{_libdir}/libnutclient.so.* +%{_libdir}/libnutclientstub.so.* %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz %{_mandir}/man8/upsc.8.gz @@ -444,12 +464,17 @@ fi %{_mandir}/man3/libnutclient* %{_libdir}/libupsclient.so %{_libdir}/libnutclient.so +%{_libdir}/libnutclientstub.so %{_libdir}/libnutscan.so %{_libdir}/pkgconfig/libupsclient.pc %{_libdir}/pkgconfig/libnutclient.pc +%{_libdir}/pkgconfig/libnutclientstub.pc %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon May 09 2022 Michal Hlavinka - 2.8.0-1 +- updated to 2.8.0 + * Thu Jan 20 2022 Fedora Release Engineering - 2.7.4-44 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index b1483aa..3574636 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3ba53656933d7471f95140b32a5b8d5c nut-2.7.4.tar.gz +SHA512 (nut-2.8.0.tar.gz) = 3c413ae54088045a713eb80cf1bdda474f41bb3b67c7c0248aa7a0c4d441dce1ff42627a2735273d7e36892d1f2eeb895220cf28af63fec2fa0c7a267f82d577 From 1e27db6337e7de206609ea47463cd9cb85a8b0d2 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 7 Jun 2022 10:09:17 +0200 Subject: [PATCH 099/142] change libusb reguirement to libusb1 --- nut.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index ce792f8..5d04031 100644 --- a/nut.spec +++ b/nut.spec @@ -75,7 +75,7 @@ BuildRequires: python3-setuptools BuildRequires: /usr/bin/pathfix.py %ifnarch s390 s390x -BuildRequires: libusb-devel +BuildRequires: libusb1-devel %endif ExcludeArch: s390 s390x From f68641b430cfc9801c8120fe7e47744b7dca5d62 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 7 Jun 2022 11:50:21 +0200 Subject: [PATCH 100/142] add missing BR --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index 5d04031..27d3774 100644 --- a/nut.spec +++ b/nut.spec @@ -42,6 +42,7 @@ Obsoletes: nut-hal < 2.6.0-7 BuildRequires: make BuildRequires: autoconf BuildRequires: automake +BuildRequires: augeas-libs BuildRequires: avahi-devel BuildRequires: cppunit-devel BuildRequires: dbus-glib-devel From a136d9db58c2a9cd7bba3386c373a2c2c3f56d2c Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 7 Jun 2022 16:14:41 +0200 Subject: [PATCH 101/142] drop unused solaris init script pulling unnecessary dependency --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 27d3774..1948353 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -211,6 +211,7 @@ mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/n rm -rf %{buildroot}%{_prefix}/html rm -f %{buildroot}%{_libdir}/*.la rm -rf docs/man +rm -rf %{buildroot}%{_datadir}/nut/solaris-init find docs/ -name 'Makefile*' -delete pushd conf; @@ -473,6 +474,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 07 2022 Michal Hlavinka - 2.8.0-2 +- drop unused solaris init script pulling unnecessary dependency + * Mon May 09 2022 Michal Hlavinka - 2.8.0-1 - updated to 2.8.0 From 8f6b5722310c4fabd89ac0b7daafb3d41354a394 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 14:51:42 +0200 Subject: [PATCH 102/142] Rebuilt for Python 3.11 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 1948353..8e53bb2 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -474,6 +474,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Jun 13 2022 Python Maint - 2.8.0-3 +- Rebuilt for Python 3.11 + * Tue Jun 07 2022 Michal Hlavinka - 2.8.0-2 - drop unused solaris init script pulling unnecessary dependency From c1478deaf56c39eec69afb341881188326196309 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 00:57:20 +0000 Subject: [PATCH 103/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 8e53bb2..4473073 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -474,6 +474,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 2.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Mon Jun 13 2022 Python Maint - 2.8.0-3 - Rebuilt for Python 3.11 From 670632e3fd75126f70564e89705bba513a96c5aa Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 31 Aug 2022 12:36:18 +0200 Subject: [PATCH 104/142] update pid path --- nut.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nut.spec b/nut.spec index 4473073..a46e894 100644 --- a/nut.spec +++ b/nut.spec @@ -6,7 +6,7 @@ %global nut_gid 57 %global cgidir /var/www/nut-cgi-bin -%global piddir /var/run/nut +%global piddir /run/nut %global modeldir /usr/sbin # powerman is retired on Fedora, therefore disable it by default %bcond_with powerman @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -74,6 +74,7 @@ BuildRequires: powerman-devel BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: /usr/bin/pathfix.py +BuildRequires: systemd-rpm-macros %ifnarch s390 s390x BuildRequires: libusb1-devel @@ -81,7 +82,7 @@ BuildRequires: libusb1-devel ExcludeArch: s390 s390x -%global restart_flag /var/run/%{name}/%{name}-restart-after-rpm-install +%global restart_flag /run/%{name}/%{name}-restart-after-rpm-install %description These programs are part of a developing project to monitor the assortment @@ -171,9 +172,9 @@ export LDFLAGS="-Wl,-z,now" --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ --with-group=dialout \ - --with-statepath=/var/run \ - --with-pidpath=/var/run \ - --with-altpidpath=/var/run \ + --with-statepath=/run/nut \ + --with-pidpath=/run/nut \ + --with-altpidpath=/run/nut \ --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ @@ -474,6 +475,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Aug 31 2022 Michal Hlavinka - 2.8.0-5 +- update pid path + * Fri Jul 22 2022 Fedora Release Engineering - 2.8.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 6db1d50203304ba99dc7f4b1c4f3865f808a47c6 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 27 Nov 2022 22:18:05 +0100 Subject: [PATCH 105/142] Port configure script to C99 Related to: --- nut-c99-ax_c_printf_null.patch | 60 ++++++++++++++++++++++++++++++++++ nut-c99-c_attribute.patch | 17 ++++++++++ nut-c99-strdup.patch | 17 ++++++++++ nut.spec | 11 ++++++- 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 nut-c99-ax_c_printf_null.patch create mode 100644 nut-c99-c_attribute.patch create mode 100644 nut-c99-strdup.patch diff --git a/nut-c99-ax_c_printf_null.patch b/nut-c99-ax_c_printf_null.patch new file mode 100644 index 0000000..9db80b0 --- /dev/null +++ b/nut-c99-ax_c_printf_null.patch @@ -0,0 +1,60 @@ +Fix several issues with the AX_C_PRINTF_STRING_NULL check: + +Adjust quoting in the AX_C_PRINTF_STRING_NULL definition. Switch to +strstr from strcasestr (a GNU extension, requires -D_GNU_SOURCE) +and include instead of . Add missing braces +and parentheses. Use double-quote for string literals. + +Submitted upstream: + +diff --git a/m4/ax_c_pragmas.m4 b/m4/ax_c_pragmas.m4 +index 53c1aebf8ea35a1e..14ecd596d3b36573 100644 +--- a/m4/ax_c_pragmas.m4 ++++ b/m4/ax_c_pragmas.m4 +@@ -943,32 +943,32 @@ if test -z "${nut_have_ax_c_printf_string_null_seen}"; then + dnl ### To be sure, bolt the language + AC_LANG_PUSH([C]) + +- AC_CACHE_CHECK([for practical support to pritnf("%s", NULL)], ++ AC_CACHE_CHECK([for practical support to printf("%s", NULL)], + [ax_cv__printf_string_null], + [AX_RUN_OR_LINK_IFELSE( + [AC_LANG_PROGRAM([dnl + #include +-#include +-], [dnl ++#include ++], [[ + char buf[128]; + char *s = NULL; + int res = snprintf(buf, sizeof(buf), "%s", s); + buf[sizeof(buf)-1] = '\0'; + if (res < 0) { +- printf(stderr, "FAILED to snprintf() a NULL string argument"); +- exit 1; ++ fprintf(stderr, "FAILED to snprintf() a NULL string argument\n"); ++ return 1; + } +-if (buf[0] == '\0') +- printf(stderr, "RETURNED empty string from snprintf() with a NULL string argument"); +- exit 0; ++if (buf[0] == '\0') { ++ fprintf(stderr, "RETURNED empty string from snprintf() with a NULL string argument\n"); ++ return 0; + } +-if (strcasestr(buf, 'null') == NULL) +- printf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'", buf); +- exit 0; ++if (strstr(buf, "null") == NULL) { ++ fprintf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'\n", buf); ++ return 0; + } +-printf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'", buf); +-exit 0; +- ])], ++fprintf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'\n", buf); ++return 0; ++ ]])], + [ax_cv__printf_string_null=yes], + [ax_cv__printf_string_null=no] + )] diff --git a/nut-c99-c_attribute.patch b/nut-c99-c_attribute.patch new file mode 100644 index 0000000..aff6495 --- /dev/null +++ b/nut-c99-c_attribute.patch @@ -0,0 +1,17 @@ +Call the defined foo function instead of the undeclared func function. + +Submitted upstream: + +diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4 +index 0e952e7841c35b60..780bc2bb14ac5a78 100644 +--- a/m4/ax_c___attribute__.m4 ++++ b/m4/ax_c___attribute__.m4 +@@ -67,7 +67,7 @@ AC_DEFUN([AX_C___ATTRIBUTE__], [ + foo(__attribute__ ((unused)) int i) { + return; + } +- ]], [func(1);])], ++ ]], [foo(1);])], + [ax_cv___attribute__unused_arg=yes], + [ax_cv___attribute__unused_arg=no] + ) diff --git a/nut-c99-strdup.patch b/nut-c99-strdup.patch new file mode 100644 index 0000000..90c83db --- /dev/null +++ b/nut-c99-strdup.patch @@ -0,0 +1,17 @@ +Fix strdup configure test: Remove a call to the undeclared free +function. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index 3aa26c24ebc99bb6..c93ccd1e494874d5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -294,7 +294,6 @@ AC_CACHE_CHECK([for strdup(s)], + char *t = "Test"; + char *s = strdup(t); + if (!s || !(s[0]=='T'&&s[1]=='e'&&s[2]=='s'&&s[3]=='t'&&s[4]=='\0') || s == t) res = 1; +-if (s) free (s); + if (res != 0) return res + /* autoconf adds ";return 0;" */ + ]])], diff --git a/nut.spec b/nut.spec index a46e894..fe29cff 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -32,6 +32,9 @@ Patch9: nut-2.6.5-rmpidf.patch Patch10: nut-2.7.4-cloexec.patch Patch11: nut-2.7.4-nutscanner-FTBFS.patch Patch12: nut-2.7.4-scratchdes.patch +Patch13: nut-c99-c_attribute.patch +Patch14: nut-c99-ax_c_printf_null.patch +Patch15: nut-c99-strdup.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -143,6 +146,9 @@ necessary to develop NUT client applications. #%patch10 -p1 -b .cloexec #%patch11 -p1 -b .nutscanner-FTBFS #%patch12 -p1 -b .scratchdes +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in @@ -475,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sun Nov 27 2022 Florian Weimer - 2.8.0-6 +- Port configure script to C99 + * Wed Aug 31 2022 Michal Hlavinka - 2.8.0-5 - update pid path From 0a29e563e374f274f801270bce8eaab9159c7d16 Mon Sep 17 00:00:00 2001 From: "Charles R. Anderson" Date: Sat, 3 Dec 2022 12:24:08 -0500 Subject: [PATCH 106/142] Fix STATEPATH/PIDPATH/ALTPIDPATH directory creation and ownership use piddir for specifying restart_flag location use piddir for specifying configure --with-statepath/pidpath/altpidpath add nut-2.8.0-piddir-owner.patch for upstream tmpfiles config creation to not append /nut and always use owner root update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name remove unused downstream tmpfiles source and code --- nut-2.6.3-tmpfiles.patch | 6 ++--- nut-2.8.0-piddir-owner.patch | 48 ++++++++++++++++++++++++++++++++++++ nut.spec | 25 ++++++++++--------- 3 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 nut-2.8.0-piddir-owner.patch diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index 7f7cd98..d1f09b4 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -5,7 +5,7 @@ diff -up nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles nut # don't want it to fail the unit (when it can't restart). Environment=REPORT_RESTART_42=no EnvironmentFile=-@CONFPATH@/nut.conf -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh ExecReload=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh @@ -16,7 +16,7 @@ diff -up nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles nut-2.8.0/scr [Service] EnvironmentFile=-@CONFPATH@/nut.conf SyslogIdentifier=%N -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf ExecStart=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl start "$NUTDEV"' ExecStop=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl stop "$NUTDEV"' # Restart really always, do not stop trying: @@ -27,7 +27,7 @@ diff -up nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.8.0/scr [Service] EnvironmentFile=-@CONFPATH@/nut.conf SyslogIdentifier=%N -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf ExecStart=@SBINDIR@/upsmon -F ExecReload=@SBINDIR@/upsmon -c reload PIDFile=@PIDPATH@/upsmon.pid diff --git a/nut-2.8.0-piddir-owner.patch b/nut-2.8.0-piddir-owner.patch new file mode 100644 index 0000000..61fa75d --- /dev/null +++ b/nut-2.8.0-piddir-owner.patch @@ -0,0 +1,48 @@ +diff -up nut-2.8.0/configure.ac.piddir-owner nut-2.8.0/configure.ac +--- nut-2.8.0/configure.ac.piddir-owner 2022-04-26 18:03:36.000000000 -0400 ++++ nut-2.8.0/configure.ac 2022-11-30 13:29:58.418038393 -0500 +@@ -2833,23 +2833,23 @@ AS_IF([test -n "$systemdtmpfilesdir"], + [mkdir -p "${TOP_BUILDDIR}"/scripts/systemd + cat > "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF + # State file (e.g. upsd to driver) and pidfile location for NUT: +-d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @STATEPATH@/nut ++d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @STATEPATH@ + EOF + AS_IF([test "$STATEPATH" != "$PIDPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @PIDPATH@/nut ++d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @PIDPATH@ + EOF]) + AS_IF([test -n "$ALTPIDPATH" && test "$STATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTPIDPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @ALTPIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @ALTPIDPATH@/nut ++d @ALTPIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @ALTPIDPATH@ + EOF]) + AS_IF([test -n "$ALTSTATEPATH" && test "$STATEPATH" != "$ALTSTATEPATH" && test "$ALTSTATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTSTATEPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @ALTSTATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @ALTSTATEPATH@/nut ++d @ALTSTATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @ALTSTATEPATH@ + EOF]) + ]) + AC_MSG_RESULT([done]) +diff -up nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in +--- nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner 2022-04-26 18:06:27.000000000 -0400 ++++ nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in 2022-11-30 13:30:11.651106256 -0500 +@@ -1,5 +1,5 @@ + # State file (e.g. upsd to driver) and pidfile location for NUT: +-d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @STATEPATH@/nut +-d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @PIDPATH@/nut ++d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @STATEPATH@ ++d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @PIDPATH@ diff --git a/nut.spec b/nut.spec index fe29cff..eff4ecf 100644 --- a/nut.spec +++ b/nut.spec @@ -14,15 +14,15 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ and GPLv3+ Url: http://www.networkupstools.org/ Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz -Source3: nut-client.tmpfiles Source4: libs.sh # Upstream support for OpenSSL-1.1.0, TLS > 1.0 Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch Patch1: nut-2.6.3-tmpfiles.patch +Patch2: nut-2.8.0-piddir-owner.patch #quick fix. TODO: fix it properly Patch5: nut-2.6.5-dlfix.patch @@ -85,7 +85,7 @@ BuildRequires: libusb1-devel ExcludeArch: s390 s390x -%global restart_flag /run/%{name}/%{name}-restart-after-rpm-install +%global restart_flag %{piddir}/%{name}-restart-after-rpm-install %description These programs are part of a developing project to monitor the assortment @@ -139,6 +139,7 @@ necessary to develop NUT client applications. %setup -q #patch0 -p1 -b .openssl %patch1 -p1 -b .tmpfiles +%patch2 -p1 -b .piddir-owner #patch5 -p1 -b .dlfix #%patch7 -p1 -b .foreground %patch8 -p1 -b .unreachable @@ -178,9 +179,9 @@ export LDFLAGS="-Wl,-z,now" --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ --with-group=dialout \ - --with-statepath=/run/nut \ - --with-pidpath=/run/nut \ - --with-altpidpath=/run/nut \ + --with-statepath=%{piddir} \ + --with-pidpath=%{piddir} \ + --with-altpidpath=%{piddir} \ --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ @@ -209,10 +210,6 @@ mkdir -p %{buildroot}%{modeldir} \ %make_install -#if 0%{?fedora} || 0%{?rhel} > 6 -# install -p -D -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/nut-client.conf -#endif - mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/nut-common.conf rm -rf %{buildroot}%{_prefix}/html @@ -417,7 +414,6 @@ fi %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf -#{_tmpfilesdir}/nut-client.conf %{_tmpfilesdir}/nut-common.conf %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups # upsmon.pid is written as root, so root needs access for now @@ -481,6 +477,13 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Nov 30 2022 Charles R. Anderson - 2.8.0-7 +- use piddir for specifying restart_flag location +- use piddir for specifying configure --with-statepath/pidpath/altpidpath +- add nut-2.8.0-piddir-owner.patch for upstream tmpfiles config creation to not append /nut and always use owner root +- update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name +- remove unused downstream tmpfiles source and code + * Sun Nov 27 2022 Florian Weimer - 2.8.0-6 - Port configure script to C99 From 4daa89396590d9f483b880a5a6284e431d3cdc5e Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 6 Dec 2022 22:31:17 +0100 Subject: [PATCH 107/142] use https for urls --- nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index eff4ecf..c681f2e 100644 --- a/nut.spec +++ b/nut.spec @@ -16,8 +16,8 @@ Name: nut Version: 2.8.0 Release: 7%{?dist} License: GPLv2+ and GPLv3+ -Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz +Url: https://www.networkupstools.org/ +Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz Source4: libs.sh # Upstream support for OpenSSL-1.1.0, TLS > 1.0 Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch From 393aac65a201f49dfa640d994f288d671e44c297 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 12 Dec 2022 23:23:52 +0100 Subject: [PATCH 108/142] fix STATEPATH location and creation (#2024651) merged C99 related changes to configure from fedora trim changelog --- .gitignore | 1 + 504.patch | 333 ------------------ nut-2.2.1-conf.patch | 13 - nut-2.6.0-usbget.patch | 28 -- nut-2.6.3-tmpfiles.patch | 47 ++- nut-2.6.5-dlfix.patch | 25 -- nut-2.6.5-foreground.patch | 129 ------- nut-2.6.5-ipmifix.patch | 138 -------- nut-2.6.5-quickfix.patch | 12 - nut-2.6.5-rmpidf.patch | 60 ++-- nut-2.6.5-unreachable.patch | 17 +- nut-2.7.4-cloexec.patch | 82 ----- nut-2.8.0-piddir-owner.patch | 48 +++ nut-c99-ax_c_printf_null.patch | 60 ++++ nut-c99-c_attribute.patch | 17 + nut-c99-strdup.patch | 17 + nut.spec | 603 +++++---------------------------- sources | 2 +- 18 files changed, 300 insertions(+), 1332 deletions(-) delete mode 100644 504.patch delete mode 100644 nut-2.2.1-conf.patch delete mode 100644 nut-2.6.0-usbget.patch delete mode 100644 nut-2.6.5-dlfix.patch delete mode 100644 nut-2.6.5-foreground.patch delete mode 100644 nut-2.6.5-ipmifix.patch delete mode 100644 nut-2.6.5-quickfix.patch delete mode 100644 nut-2.7.4-cloexec.patch create mode 100644 nut-2.8.0-piddir-owner.patch create mode 100644 nut-c99-ax_c_printf_null.patch create mode 100644 nut-c99-c_attribute.patch create mode 100644 nut-c99-strdup.patch diff --git a/.gitignore b/.gitignore index 4a36018..9da25ad 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ nut-2.4.3.tar.gz /nut-2.7.1.tar.gz /nut-2.7.2.tar.gz /nut-2.7.4.tar.gz +/nut-2.8.0.tar.gz diff --git a/504.patch b/504.patch deleted file mode 100644 index 71e1bf4..0000000 --- a/504.patch +++ /dev/null @@ -1,333 +0,0 @@ -From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Mon, 27 Nov 2017 21:10:13 +0100 -Subject: [PATCH 1/7] Add support for openssl-1.1.0 - ---- - clients/upsclient.c | 4 ++++ - m4/nut_check_libopenssl.m4 | 5 +++-- - server/netssl.c | 4 ++++ - 3 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index b90587b00..fc5e7523c 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -316,7 +316,11 @@ int upscli_init(int certverify, const char *certpath, - - #ifdef WITH_OPENSSL - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+#else -+ OPENSSL_init_ssl(0, NULL); -+#endif - SSL_load_error_strings(); - - ssl_method = TLSv1_client_method(); -diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 -index 1b875077b..5f29f4a38 100644 ---- a/m4/nut_check_libopenssl.m4 -+++ b/m4/nut_check_libopenssl.m4 -@@ -57,8 +57,9 @@ if test -z "${nut_have_libopenssl_seen}"; then - AC_MSG_RESULT([${LIBS}]) - - dnl check if openssl is usable -- AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no]) -+ AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) -+ AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) -+ AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) - - if test "${nut_have_openssl}" = "yes"; then - nut_with_ssl="yes" -diff --git a/server/netssl.c b/server/netssl.c -index c2f409899..0f9a70acf 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -388,7 +388,11 @@ void ssl_init(void) - #ifdef WITH_OPENSSL - - SSL_load_error_strings(); -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+#else -+ OPENSSL_init_ssl(0, NULL); -+#endif - - if ((ssl_method = TLSv1_server_method()) == NULL) { - ssl_debug(); - -From b15656efb2575647ca0e0b6439b6380373767b8f Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Tue, 28 Nov 2017 20:00:52 +0100 -Subject: [PATCH 2/7] Allow TLSv1 and higher (not just TLSv1) - ---- - clients/upsclient.c | 30 +++++++++++++++++------------- - server/netssl.c | 26 +++++++++++++++----------- - 2 files changed, 32 insertions(+), 24 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index fc5e7523c..bd951e854 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -299,11 +299,6 @@ int upscli_init(int certverify, const char *certpath, - { - #ifdef WITH_OPENSSL - int ret, ssl_mode = SSL_VERIFY_NONE; --#if OPENSSL_VERSION_NUMBER >= 0x10000000L -- const SSL_METHOD *ssl_method; --#else -- SSL_METHOD *ssl_method; --#endif - #elif defined(WITH_NSS) /* WITH_OPENSSL */ - SECStatus status; - #endif /* WITH_OPENSSL | WITH_NSS */ -@@ -315,26 +310,35 @@ int upscli_init(int certverify, const char *certpath, - } - - #ifdef WITH_OPENSSL -+ -+ SSL_load_error_strings(); - - #if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+ -+ ssl_ctx = SSL_CTX_new(SSLv23_client_method()); - #else - OPENSSL_init_ssl(0, NULL); --#endif -- SSL_load_error_strings(); - -- ssl_method = TLSv1_client_method(); -- -- if (!ssl_method) { -- return 0; -- } -+ ssl_ctx = SSL_CTX_new(TLS_client_method()); -+#endif - -- ssl_ctx = SSL_CTX_new(ssl_method); - if (!ssl_ctx) { - upslogx(LOG_ERR, "Can not initialize SSL context"); - return -1; - } - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ /* set minimum protocol TLSv1 */ -+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); -+#else -+ ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION); -+ if (ret != 1) { -+ upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1"); -+ return -1; -+ } -+#endif -+ - if (!certpath) { - if (certverify == 1) { - upslogx(LOG_ERR, "Can not verify certificate if any is specified"); -diff --git a/server/netssl.c b/server/netssl.c -index 0f9a70acf..98680d25e 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -371,13 +371,7 @@ void ssl_init(void) - { - #ifdef WITH_NSS - SECStatus status; --#elif defined(WITH_OPENSSL) --#if OPENSSL_VERSION_NUMBER >= 0x10000000L -- const SSL_METHOD *ssl_method; --#else -- SSL_METHOD *ssl_method; --#endif --#endif /* WITH_NSS|WITH_OPENSSL */ -+#endif /* WITH_NSS */ - - if (!certfile) { - return; -@@ -388,21 +382,31 @@ void ssl_init(void) - #ifdef WITH_OPENSSL - - SSL_load_error_strings(); -+ - #if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+ -+ ssl_ctx = SSL_CTX_new(SSLv23_server_method()); - #else - OPENSSL_init_ssl(0, NULL); -+ -+ ssl_ctx = SSL_CTX_new(TLS_server_method()); - #endif - -- if ((ssl_method = TLSv1_server_method()) == NULL) { -+ if (!ssl_ctx) { - ssl_debug(); -- fatalx(EXIT_FAILURE, "TLSv1_server_method failed"); -+ fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); - } - -- if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ /* set minimum protocol TLSv1 */ -+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); -+#else -+ if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) { - ssl_debug(); -- fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); -+ fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)"); - } -+#endif - - if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) { - ssl_debug(); - -From 5a8308aef9884017754fb70620c8ded34fa44290 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Tue, 28 Nov 2017 22:01:41 +0100 -Subject: [PATCH 3/7] Fix check for empty string - ---- - clients/upssched.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clients/upssched.c b/clients/upssched.c -index 97b3ed42d..3fdf118ed 100644 ---- a/clients/upssched.c -+++ b/clients/upssched.c -@@ -794,7 +794,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd, - } - - if (!strcmp(cmd, "EXECUTE")) { -- if (ca1 == '\0') { -+ if (ca1[0] == '\0') { - upslogx(LOG_ERR, "Empty EXECUTE command argument"); - return; - } - -From 5ecfb0ffe3d89a5116dd287ff2c3f60de67ecbb9 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Fri, 1 Dec 2017 12:24:00 +0100 -Subject: [PATCH 4/7] Report TLS handshake in debug mode - ---- - clients/upsclient.c | 2 +- - server/netssl.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index bd951e854..b7dd8f424 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -745,7 +745,7 @@ static int upscli_sslinit(UPSCONN_t *ups, int verifycert) - switch(res) - { - case 1: -- upsdebugx(3, "SSL connected"); -+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl)); - break; - case 0: - upslog_with_errno(1, "SSL_connect do not accept handshake."); -diff --git a/server/netssl.c b/server/netssl.c -index 98680d25e..6ae13e8d3 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -275,7 +275,7 @@ void net_starttls(nut_ctype_t *client, int numarg, const char **arg) - { - case 1: - client->ssl_connected = 1; -- upsdebugx(3, "SSL connected"); -+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl)); - break; - - case 0: - -From ab0c8b41c0530d3706e4997257939026cfd29ccc Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:31:21 +0100 -Subject: [PATCH 5/7] Update nut_check_libopenssl.m4 - ---- - m4/nut_check_libopenssl.m4 | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 -index 5f29f4a38..7eb401cd9 100644 ---- a/m4/nut_check_libopenssl.m4 -+++ b/m4/nut_check_libopenssl.m4 -@@ -57,9 +57,8 @@ if test -z "${nut_have_libopenssl_seen}"; then - AC_MSG_RESULT([${LIBS}]) - - dnl check if openssl is usable -- AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) -- AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) -- AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -+ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -+ AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no]) - - if test "${nut_have_openssl}" = "yes"; then - nut_with_ssl="yes" - -From 1dc34a5da7308f0f85537a6761fefb3ff3098863 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:34:53 +0100 -Subject: [PATCH 6/7] Update upsclient.c - ---- - clients/upsclient.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index b7dd8f424..541664f36 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -311,15 +311,12 @@ int upscli_init(int certverify, const char *certpath, - - #ifdef WITH_OPENSSL - -- SSL_load_error_strings(); -- - #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ SSL_load_error_strings(); - SSL_library_init(); - - ssl_ctx = SSL_CTX_new(SSLv23_client_method()); - #else -- OPENSSL_init_ssl(0, NULL); -- - ssl_ctx = SSL_CTX_new(TLS_client_method()); - #endif - - -From 108c31c9b170da2ee34a25fd373d21837d4d10a3 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:37:42 +0100 -Subject: [PATCH 7/7] Update netssl.c - ---- - server/netssl.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/server/netssl.c b/server/netssl.c -index 6ae13e8d3..cf9419edf 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -381,15 +381,12 @@ void ssl_init(void) - - #ifdef WITH_OPENSSL - -- SSL_load_error_strings(); -- - #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ SSL_load_error_strings(); - SSL_library_init(); - - ssl_ctx = SSL_CTX_new(SSLv23_server_method()); - #else -- OPENSSL_init_ssl(0, NULL); -- - ssl_ctx = SSL_CTX_new(TLS_server_method()); - #endif - diff --git a/nut-2.2.1-conf.patch b/nut-2.2.1-conf.patch deleted file mode 100644 index beebdf6..0000000 --- a/nut-2.2.1-conf.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: nut/conf/upssched.conf.sample.in -=================================================================== ---- nut/conf/upssched.conf.sample.in (revision 2057) -+++ nut/conf/upssched.conf.sample.in (revision 2070) -@@ -14,7 +14,7 @@ - # A shell script with a big case..esac construct should work nicely for this. - # An example has been provided to help you get started. - --CMDSCRIPT @BINDIR@/upssched-cmd -+CMDSCRIPT @bindir@/upssched-cmd - - # ============================================================================ - # diff --git a/nut-2.6.0-usbget.patch b/nut-2.6.0-usbget.patch deleted file mode 100644 index 2d9242a..0000000 --- a/nut-2.6.0-usbget.patch +++ /dev/null @@ -1,28 +0,0 @@ -Index: /trunk/drivers/libhid.c -=================================================================== ---- trunk/drivers/libhid.c (revision 2719) -+++ trunk/drivers/libhid.c (revision 2893) -@@ -142,5 +142,4 @@ - int id = pData->ReportID; - int r; -- unsigned char buf[SMALLBUF]; - - if (rbuf->ts[id] + age > time(NULL)) { -@@ -150,15 +149,12 @@ - } - -- r = comm_driver->get_report(udev, id, buf, sizeof(buf)); -+ r = comm_driver->get_report(udev, id, rbuf->data[id], rbuf->len[id]); - if (r <= 0) { - return -1; - } - -- /* broken report descriptors are common, so store whatever we can */ -- memcpy(rbuf->data[id], buf, (r < rbuf->len[id]) ? r : rbuf->len[id]); -- - if (rbuf->len[id] != r) { - upsdebugx(2, "%s: expected %d bytes, but got %d instead", __func__, rbuf->len[id], r); -- upsdebug_hex(3, "Report[err]", buf, r); -+ upsdebug_hex(3, "Report[err]", rbuf->data[id], r); - } else { - upsdebug_hex(3, "Report[get]", rbuf->data[id], rbuf->len[id]); diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch index ee0d7e1..d1f09b4 100644 --- a/nut-2.6.3-tmpfiles.patch +++ b/nut-2.6.3-tmpfiles.patch @@ -1,22 +1,33 @@ -diff -up nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-driver.service.in ---- nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles 2015-02-23 14:44:50.173188023 +0100 -+++ nut-2.7.2/scripts/systemd/nut-driver.service.in 2015-02-23 14:45:03.915137074 +0100 -@@ -4,6 +4,7 @@ After=local-fs.target network.target - StopWhenUnneeded=yes +diff -up nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in +--- nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles 2022-05-09 16:42:37.296229637 +0200 ++++ nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in 2022-05-09 16:42:51.139030657 +0200 +@@ -23,6 +23,7 @@ Type=oneshot + # don't want it to fail the unit (when it can't restart). + Environment=REPORT_RESTART_42=no + EnvironmentFile=-@CONFPATH@/nut.conf ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf + ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh + ExecReload=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh +diff -up nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver@.service.in +--- nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles 2022-05-09 16:41:00.952614514 +0200 ++++ nut-2.8.0/scripts/systemd/nut-driver@.service.in 2022-05-09 16:41:42.783013227 +0200 +@@ -40,6 +40,7 @@ PartOf=nut-driver.target [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf - ExecStart=@SBINDIR@/upsdrvctl start - ExecStop=@SBINDIR@/upsdrvctl stop - Type=forking -diff -up nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-monitor.service.in ---- nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles 2014-02-14 09:56:53.000000000 +0100 -+++ nut-2.7.2/scripts/systemd/nut-monitor.service.in 2015-02-23 14:45:18.443083211 +0100 -@@ -3,6 +3,7 @@ Description=Network UPS Tools - power de - After=local-fs.target network.target nut-server.service - + EnvironmentFile=-@CONFPATH@/nut.conf + SyslogIdentifier=%N ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf + ExecStart=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl start "$NUTDEV"' + ExecStop=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl stop "$NUTDEV"' + # Restart really always, do not stop trying: +diff -up nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-monitor.service.in +--- nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles 2022-05-09 12:57:35.160646121 +0200 ++++ nut-2.8.0/scripts/systemd/nut-monitor.service.in 2022-05-09 16:40:18.289227772 +0200 +@@ -18,6 +18,7 @@ PartOf=nut.target [Service] -+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf - ExecStart=@SBINDIR@/upsmon + EnvironmentFile=-@CONFPATH@/nut.conf + SyslogIdentifier=%N ++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf + ExecStart=@SBINDIR@/upsmon -F + ExecReload=@SBINDIR@/upsmon -c reload PIDFile=@PIDPATH@/upsmon.pid - Type=forking diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch deleted file mode 100644 index f93b5ea..0000000 --- a/nut-2.6.5-dlfix.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up nut-2.7.4/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_avahi.c -diff -up nut-2.7.4/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_ipmi.c -diff -up nut-2.7.4/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.4/tools/nut-scanner/scan_nut.c -diff -up nut-2.7.4/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.4/tools/nut-scanner/scan_snmp.c -diff -up nut-2.7.4/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.4/tools/nut-scanner/scan_usb.c -diff -up nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.4/tools/nut-scanner/scan_xml_http.c ---- nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix 2016-03-08 13:01:11.000000000 +0100 -+++ nut-2.7.4/tools/nut-scanner/scan_xml_http.c 2016-03-12 00:23:02.554826665 +0100 -@@ -37,7 +37,6 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libneon"; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -102,7 +101,7 @@ int nutscan_load_neon_library(const char - - return 1; - err: -- fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname, dl_error); -+ fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname_path, dl_error); - dl_handle = (void *)1; - lt_dlexit(); - return 0; diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch deleted file mode 100644 index b97e8c4..0000000 --- a/nut-2.6.5-foreground.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -up nut-2.7.1/clients/upsmon.c.foreground nut-2.7.1/clients/upsmon.c ---- nut-2.7.1/clients/upsmon.c.foreground 2013-07-26 21:41:10.000000000 +0200 -+++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:39:58.158784578 +0100 -@@ -1645,6 +1645,7 @@ static void help(const char *progname) - printf(" - reload: reread configuration\n"); - printf(" - stop: stop monitoring and exit\n"); - printf(" -D raise debugging level\n"); -+ printf(" -F run in foreground, do not daemonize\n"); - printf(" -h display this help\n"); - printf(" -K checks POWERDOWNFLAG, sets exit code to 0 if set\n"); - printf(" -p always run privileged (disable privileged parent)\n"); -@@ -1859,7 +1860,7 @@ static void check_parent(void) - int main(int argc, char *argv[]) - { - const char *prog = xbasename(argv[0]); -- int i, cmd = 0, checking_flag = 0; -+ int i, cmd = 0, checking_flag = 0, foreground = 0; - - printf("Network UPS Tools %s %s\n", prog, UPS_VERSION); - -@@ -1870,7 +1871,7 @@ int main(int argc, char *argv[]) - - run_as_user = xstrdup(RUN_AS_USER); - -- while ((i = getopt(argc, argv, "+Dhic:f:pu:VK46")) != -1) { -+ while ((i = getopt(argc, argv, "+DFhic:f:pu:VK46")) != -1) { - switch (i) { - case 'c': - if (!strncmp(optarg, "fsd", strlen(optarg))) -@@ -1887,6 +1888,9 @@ int main(int argc, char *argv[]) - case 'D': - nut_debug_level++; - break; -+ case 'F': -+ foreground = 1; -+ break; - case 'f': - free(configfile); - configfile = xstrdup(optarg); -@@ -1962,9 +1966,9 @@ int main(int argc, char *argv[]) - exit(EXIT_FAILURE); - } - -- if (nut_debug_level < 1) { -+ if (!foreground && nut_debug_level < 1) { - background(); -- } else { -+ } else if (nut_debug_level >= 1) { - upsdebugx(1, "debug level is '%d'", nut_debug_level); - } - -diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/scripts/systemd/nut-monitor.service.in ---- nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground 2014-02-27 11:39:58.141784438 +0100 -+++ nut-2.7.1/scripts/systemd/nut-monitor.service.in 2014-02-27 11:39:58.152784529 +0100 -@@ -4,9 +4,8 @@ After=local-fs.target network.target nut - - [Service] - ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf --ExecStart=@SBINDIR@/upsmon --PIDFile=@PIDPATH@/upsmon.pid --Type=forking -+ExecStart=@SBINDIR@/upsmon -F -+Type=simple - - [Install] - WantedBy=multi-user.target -diff -up nut-2.7.1/scripts/systemd/nut-server.service.in.foreground nut-2.7.1/scripts/systemd/nut-server.service.in ---- nut-2.7.1/scripts/systemd/nut-server.service.in.foreground 2013-07-26 21:41:11.000000000 +0200 -+++ nut-2.7.1/scripts/systemd/nut-server.service.in 2014-02-27 11:39:58.152784529 +0100 -@@ -5,8 +5,8 @@ Requires=nut-driver.service - Before=nut-monitor.service - - [Service] --ExecStart=@SBINDIR@/upsd --Type=forking -+ExecStart=@SBINDIR@/upsd -F -+Type=simple - - [Install] - WantedBy=multi-user.target -diff -up nut-2.7.1/server/upsd.c.foreground nut-2.7.1/server/upsd.c ---- nut-2.7.1/server/upsd.c.foreground 2013-07-26 21:41:11.000000000 +0200 -+++ nut-2.7.1/server/upsd.c 2014-02-27 11:39:58.153784537 +0100 -@@ -827,6 +827,7 @@ static void help(const char *progname) - printf(" - reload: reread configuration files\n"); - printf(" - stop: stop process and exit\n"); - printf(" -D raise debugging level\n"); -+ printf(" -F run in foreground, do not daemonize\n"); - printf(" -h display this help\n"); - printf(" -r chroots to \n"); - printf(" -q raise log level threshold\n"); -@@ -890,7 +891,7 @@ void check_perms(const char *fn) - - int main(int argc, char **argv) - { -- int i, cmd = 0; -+ int i, cmd = 0, foreground = 0; - char *chroot_path = NULL; - const char *user = RUN_AS_USER; - struct passwd *new_uid = NULL; -@@ -906,7 +907,7 @@ int main(int argc, char **argv) - - printf("Network UPS Tools %s %s\n", progname, UPS_VERSION); - -- while ((i = getopt(argc, argv, "+h46p:qr:i:fu:Vc:D")) != -1) { -+ while ((i = getopt(argc, argv, "+hF46p:qr:i:fu:Vc:D")) != -1) { - switch (i) { - case 'h': - help(progname); -@@ -944,6 +945,10 @@ int main(int argc, char **argv) - nut_debug_level++; - break; - -+ case 'F': -+ foreground = 1; -+ break; -+ - case '4': - opt_af = AF_INET; - break; -@@ -1031,7 +1036,7 @@ int main(int argc, char **argv) - /* handle upsd.users */ - user_load(); - -- if (!nut_debug_level) { -+ if (!nut_debug_level && !foreground) { - background(); - writepid(pidfn); - } else { diff --git a/nut-2.6.5-ipmifix.patch b/nut-2.6.5-ipmifix.patch deleted file mode 100644 index db7bff8..0000000 --- a/nut-2.6.5-ipmifix.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -up nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix nut-2.6.5/drivers/nut-libfreeipmi.c ---- nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix 2012-07-31 19:38:59.000000000 +0200 -+++ nut-2.6.5/drivers/nut-libfreeipmi.c 2012-09-04 09:42:48.000000000 +0200 -@@ -49,6 +49,36 @@ - #include "nut-ipmi.h" - #include "dstate.h" - -+#ifdef HAVE_FREEIPMI_11X_12X -+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t -+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id -+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy -+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create -+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags -+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id -+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg -+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX -+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS -+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION -+#define IPMI_FRU_PARSE_AREA_TYPE_BOARD_INFO_AREA IPMI_FRU_AREA_TYPE_BOARD_INFO_AREA -+#define ipmi_fru_parse_field_t ipmi_fru_field_t -+#define ipmi_fru_parse_ctx_create ipmi_fru_ctx_create -+#define ipmi_fru_parse_ctx_set_flags ipmi_fru_ctx_set_flags -+#define ipmi_fru_parse_ctx_strerror ipmi_fru_ctx_strerror -+#define ipmi_fru_parse_ctx_errnum ipmi_fru_ctx_errnum -+#define ipmi_fru_parse_open_device_id ipmi_fru_open_device_id -+#define ipmi_fru_parse_ctx_errormsg ipmi_fru_ctx_errormsg -+#define ipmi_fru_parse_read_data_area ipmi_fru_read_data_area -+#define ipmi_fru_parse_type_length_field_to_string ipmi_fru_type_length_field_to_string -+#define ipmi_fru_parse_close_device_id ipmi_fru_close_device_id -+#define ipmi_fru_parse_ctx_destroy ipmi_fru_ctx_destroy -+#define ipmi_fru_parse_multirecord_power_supply_information ipmi_fru_multirecord_power_supply_information -+#define ipmi_fru_parse_board_info_area ipmi_fru_board_info_area -+#define ipmi_fru_parse_next ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_STRING_MAX IPMI_FRU_AREA_STRING_MAX -+#endif -+ - /* FreeIPMI defines */ - #define IPMI_FRU_STR_BUFLEN 1024 - /* haven't seen a motherboard with more than 2-3 so far, -diff -up nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix nut-2.6.5/m4/nut_check_libfreeipmi.m4 ---- nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/m4/nut_check_libfreeipmi.m4 2012-09-04 09:45:45.399328962 +0200 -@@ -66,15 +66,23 @@ if test -z "${nut_have_libfreeipmi_seen} - dnl when version cannot be tested (prior to 1.0.5, with no pkg-config) - dnl we have to check for some specific functions - AC_SEARCH_LIBS([ipmi_ctx_find_inband], [freeipmi], [], [nut_have_freeipmi=no]) -- AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [], [nut_have_freeipmi=no]) - - AC_SEARCH_LIBS([ipmi_monitoring_init], [ipmimonitoring], [nut_have_freeipmi_monitoring=yes], [nut_have_freeipmi_monitoring=no]) - AC_SEARCH_LIBS([ipmi_monitoring_sensor_read_record_id], [ipmimonitoring], [], [nut_have_freeipmi_monitoring=no]) - - dnl Check for FreeIPMI 1.1.X / 1.2.X which implies API changes! -- AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], []) -+ nut_have_freeipmi_old="${nut_have_freeipmi}" -+ AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no]) -+ AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no]) -+ AC_SEARCH_LIBS([ipmi_fru_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no]) - AC_SEARCH_LIBS([ipmi_sdr_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no]) - -+ if test "${nut_have_freeipmi}${nut_have_freeipmi_11x_12x}" = "yesyes"; then -+ AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available]) -+ elif test "${nut_have_freeipmi_old}" = "no"; then -+ nut_have_freeipmi="no" -+ fi -+ - if test "${nut_have_freeipmi}" = "yes"; then - nut_with_ipmi="yes" - nut_ipmi_lib="(FreeIPMI)" -@@ -84,10 +92,6 @@ if test -z "${nut_have_libfreeipmi_seen} - LIBIPMI_LIBS="${LIBS}" - fi - -- if test "${nut_have_freeipmi_11x_12x}" = "yes"; then -- AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available]) -- fi -- - if test "${nut_have_freeipmi_monitoring}" = "yes"; then - AC_DEFINE(HAVE_FREEIPMI_MONITORING, 1, [Define if FreeIPMI monitoring support is available]) - fi -diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix nut-2.6.5/tools/nut-scanner/scan_ipmi.c ---- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix 2012-07-31 19:38:58.000000000 +0200 -+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-04 09:42:35.000000000 +0200 -@@ -34,24 +34,50 @@ static char * libname = "libfreeipmi"; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - --static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx); --static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx); - #ifdef HAVE_FREEIPMI_11X_12X - static void (*nut_ipmi_sdr_ctx_destroy) (ipmi_sdr_ctx_t ctx); -+static int (*nut_ipmi_fru_close_device_id) (ipmi_fru_ctx_t ctx); -+static void (*nut_ipmi_fru_ctx_destroy) (ipmi_fru_ctx_t ctx); -+static ipmi_fru_ctx_t (*nut_ipmi_fru_ctx_create) (ipmi_ctx_t ipmi_ctx); -+static int (*nut_ipmi_fru_ctx_set_flags) (ipmi_fru_ctx_t ctx, unsigned int flags); -+static int (*nut_ipmi_fru_open_device_id) (ipmi_fru_ctx_t ctx, uint8_t fru_device_id); -+static char * (*nut_ipmi_fru_ctx_errormsg) (ipmi_fru_ctx_t ctx); -+static int (*nut_ipmi_fru_next) (ipmi_fru_ctx_t ctx); - #else /* HAVE_FREEIPMI_11X_12X */ -+static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx); -+static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx); - static void (*nut_ipmi_sdr_cache_ctx_destroy) (ipmi_sdr_cache_ctx_t ctx); - static void (*nut_ipmi_sdr_parse_ctx_destroy) (ipmi_sdr_parse_ctx_t ctx); --#endif /* HAVE_FREEIPMI_11X_12X */ - static ipmi_fru_parse_ctx_t (*nut_ipmi_fru_parse_ctx_create) (ipmi_ctx_t ipmi_ctx); - static int (*nut_ipmi_fru_parse_ctx_set_flags) (ipmi_fru_parse_ctx_t ctx, unsigned int flags); - static int (*nut_ipmi_fru_parse_open_device_id) (ipmi_fru_parse_ctx_t ctx, uint8_t fru_device_id); - static char * (*nut_ipmi_fru_parse_ctx_errormsg) (ipmi_fru_parse_ctx_t ctx); -+static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx); -+#endif /* HAVE_FREEIPMI_11X_12X */ -+ -+#ifndef ipmi_fru_parse_ctx_t -+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t -+#endif -+ -+#ifndef nut_ipmi_fru_parse_close_device_id -+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id -+#endif -+ -+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy -+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create -+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags -+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id -+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg -+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next -+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX -+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS -+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION -+ - static int (*nut_ipmi_fru_parse_read_data_area) (ipmi_fru_parse_ctx_t ctx, - unsigned int *area_type, - unsigned int *area_length, - void *areabuf, - unsigned int areabuflen); --static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx); - static ipmi_ctx_t (*nut_ipmi_ctx_create) (void); - static int (*nut_ipmi_ctx_find_inband) (ipmi_ctx_t ctx, - ipmi_driver_type_t *driver_type, diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch deleted file mode 100644 index aa11fe6..0000000 --- a/nut-2.6.5-quickfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up nut-2.7.3/configure.ac.quickfix nut-2.7.3/configure.ac ---- nut-2.7.3/configure.ac.quickfix 2015-04-23 12:05:21.219228670 +0200 -+++ nut-2.7.3/configure.ac 2015-04-23 12:05:21.230228646 +0200 -@@ -1065,7 +1065,7 @@ dnl Override installation directory, wit - dnl prefix. This is needed for 'distcheck*' targets, otherwise - dnl files will try to get intalled to the actual system directories - if test -n "${systemdsystemunitdir}"; then -- systemdsystemshutdowndir="${libdir}/systemd/system-shutdown" -+ systemdsystemshutdowndir="/lib/systemd/system-shutdown" - AC_MSG_RESULT(using ${systemdsystemunitdir}) - else - AC_MSG_RESULT(no) diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index 3041c6d..54c6e1e 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,7 +1,7 @@ -diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c ---- nut-2.7.1/clients/upsmon.c.rmpidf 2014-02-27 11:41:09.139369295 +0100 -+++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:41:09.145369344 +0100 -@@ -2027,6 +2027,7 @@ int main(int argc, char *argv[]) +diff -up nut-2.8.0/clients/upsmon.c.rmpidf nut-2.8.0/clients/upsmon.c +--- nut-2.8.0/clients/upsmon.c.rmpidf 2022-04-23 13:56:06.000000000 +0200 ++++ nut-2.8.0/clients/upsmon.c 2022-05-09 17:22:34.329547283 +0200 +@@ -2314,6 +2314,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); upsmon_cleanup(); @@ -9,47 +9,47 @@ diff -up nut-2.7.1/clients/upsmon.c.rmpidf nut-2.7.1/clients/upsmon.c exit(EXIT_SUCCESS); } -diff -up nut-2.7.1/common/common.c.rmpidf nut-2.7.1/common/common.c ---- nut-2.7.1/common/common.c.rmpidf 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/common/common.c 2014-02-27 11:41:09.146369353 +0100 -@@ -229,6 +229,20 @@ void writepid(const char *name) - umask(mask); +diff -up nut-2.8.0/common/common.c.rmpidf nut-2.8.0/common/common.c +--- nut-2.8.0/common/common.c.rmpidf 2022-05-09 17:22:34.329547283 +0200 ++++ nut-2.8.0/common/common.c 2022-05-09 17:26:48.671847245 +0200 +@@ -358,6 +358,20 @@ pid_t parsepid(const char *buf) + return pid; } +/* remove pid file */ +void cleanpid(const char *name) +{ -+ char fn[SMALLBUF]; ++ char fn[SMALLBUF]; + -+ /* use full path if present, else build filename in PIDPATH */ -+ if (*name == '/') -+ snprintf(fn, sizeof(fn), "%s", name); -+ else -+ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name); ++ /* use full path if present, else build filename in PIDPATH */ ++ if (*name == '/') ++ snprintf(fn, sizeof(fn), "%s", name); ++ else ++ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name); + -+ unlink(fn); ++ unlink(fn); +} + - /* open pidfn, get the pid, then send it sig */ - int sendsignalfn(const char *pidfn, int sig) - { -diff -up nut-2.7.1/include/common.h.rmpidf nut-2.7.1/include/common.h ---- nut-2.7.1/include/common.h.rmpidf 2013-11-20 20:53:31.000000000 +0100 -+++ nut-2.7.1/include/common.h 2014-02-27 11:41:09.146369353 +0100 -@@ -70,6 +70,9 @@ void chroot_start(const char *path); + /* open pidfn, get the pid, then send it sig + * returns negative codes for errors, or + * zero for a successfully sent signal +diff -up nut-2.8.0/include/common.h.rmpidf nut-2.8.0/include/common.h +--- nut-2.8.0/include/common.h.rmpidf 2022-05-09 17:22:34.329547283 +0200 ++++ nut-2.8.0/include/common.h 2022-05-09 17:25:47.439740973 +0200 +@@ -103,6 +103,9 @@ void chroot_start(const char *path); /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); +/* remove pid file */ +void cleanpid(const char *name); + - /* send a signal to another running process */ - int sendsignal(const char *progname, int sig); - -diff -up nut-2.7.1/server/upsd.c.rmpidf nut-2.7.1/server/upsd.c ---- nut-2.7.1/server/upsd.c.rmpidf 2014-02-27 11:41:09.146369353 +0100 -+++ nut-2.7.1/server/upsd.c 2014-02-27 11:42:03.715818754 +0100 -@@ -1050,6 +1050,7 @@ int main(int argc, char **argv) + /* parses string buffer into a pid_t if it passes + * a few sanity checks; returns -1 on error */ + pid_t parsepid(const char *buf); +diff -up nut-2.8.0/server/upsd.c.rmpidf nut-2.8.0/server/upsd.c +--- nut-2.8.0/server/upsd.c.rmpidf 2022-04-23 13:56:07.000000000 +0200 ++++ nut-2.8.0/server/upsd.c 2022-05-09 17:22:34.330547269 +0200 +@@ -1515,6 +1515,7 @@ int main(int argc, char **argv) ssl_cleanup(); upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); diff --git a/nut-2.6.5-unreachable.patch b/nut-2.6.5-unreachable.patch index 3c9db41..4166e84 100644 --- a/nut-2.6.5-unreachable.patch +++ b/nut-2.6.5-unreachable.patch @@ -1,7 +1,7 @@ -diff -up nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable nut-2.6.5/scripts/python/app/NUT-Monitor ---- nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable 2012-07-31 19:38:56.000000000 +0200 -+++ nut-2.6.5/scripts/python/app/NUT-Monitor 2013-01-07 18:04:26.532531441 +0100 -@@ -674,6 +674,11 @@ class interface : +diff -up nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in +--- nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable 2022-05-09 17:20:11.629621005 +0200 ++++ nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in 2022-05-09 17:20:52.674024537 +0200 +@@ -693,6 +693,11 @@ along with this program. If not, see - #include - #include -+#include - - #include "parseconf.h" - -@@ -443,6 +444,9 @@ - return 0; - } - -+ /* prevent fd leaking to child processes */ -+ fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC); -+ - return 1; /* OK */ - } - ---- nut-2.7.4/clients/upsmon.c.cloexec 2018-12-07 16:22:42.185376803 -0800 -+++ nut-2.7.4/clients/upsmon.c 2018-12-07 17:18:44.662093479 -0800 -@@ -24,6 +24,8 @@ - #include - #include - #include -+#include -+#include - - #include "upsclient.h" - #include "upsmon.h" -@@ -1432,6 +1434,9 @@ - /* we're definitely connected now */ - setflag(&ups->status, ST_CONNECTED); - -+ /* prevent connection leaking to NOTIFYCMD */ -+ fcntl(upscli_fd(&ups->conn), F_SETFD, FD_CLOEXEC); -+ - /* now try to authenticate to upsd */ - - ret = do_upsd_auth(ups); -@@ -1715,6 +1720,9 @@ - } - - close(pipefd[0]); -+ -+ /* prevent pipe leaking to NOTIFYCMD */ -+ fcntl(pipefd[1], F_SETFD, FD_CLOEXEC); - } - - static void delete_ups(utype_t *target) ---- nut-2.7.4/clients/upssched.c.cloexec 2018-12-07 17:09:13.081914570 -0800 -+++ nut-2.7.4/clients/upssched.c 2018-12-07 18:28:54.380512191 -0800 -@@ -46,6 +46,8 @@ - #include - #include - #include -+#include -+#include - - #include "upssched.h" - #include "timehead.h" -@@ -297,6 +299,9 @@ - if (ret < 0) - fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG); - -+ /* don't leak socket to CMDSCRIPT */ -+ fcntl(fd, F_SETFD, FD_CLOEXEC); -+ - return fd; - } - -@@ -370,6 +375,9 @@ - return; - } - -+ /* don't leak connection to CMDSCRIPT */ -+ fcntl(acc, F_SETFD, FD_CLOEXEC); -+ - /* enable nonblocking I/O */ - - ret = fcntl(acc, F_GETFL, 0); diff --git a/nut-2.8.0-piddir-owner.patch b/nut-2.8.0-piddir-owner.patch new file mode 100644 index 0000000..61fa75d --- /dev/null +++ b/nut-2.8.0-piddir-owner.patch @@ -0,0 +1,48 @@ +diff -up nut-2.8.0/configure.ac.piddir-owner nut-2.8.0/configure.ac +--- nut-2.8.0/configure.ac.piddir-owner 2022-04-26 18:03:36.000000000 -0400 ++++ nut-2.8.0/configure.ac 2022-11-30 13:29:58.418038393 -0500 +@@ -2833,23 +2833,23 @@ AS_IF([test -n "$systemdtmpfilesdir"], + [mkdir -p "${TOP_BUILDDIR}"/scripts/systemd + cat > "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF + # State file (e.g. upsd to driver) and pidfile location for NUT: +-d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @STATEPATH@/nut ++d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @STATEPATH@ + EOF + AS_IF([test "$STATEPATH" != "$PIDPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @PIDPATH@/nut ++d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @PIDPATH@ + EOF]) + AS_IF([test -n "$ALTPIDPATH" && test "$STATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTPIDPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @ALTPIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @ALTPIDPATH@/nut ++d @ALTPIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @ALTPIDPATH@ + EOF]) + AS_IF([test -n "$ALTSTATEPATH" && test "$STATEPATH" != "$ALTSTATEPATH" && test "$ALTSTATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTSTATEPATH"], + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF +-d @ALTSTATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @ALTSTATEPATH@/nut ++d @ALTSTATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @ALTSTATEPATH@ + EOF]) + ]) + AC_MSG_RESULT([done]) +diff -up nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in +--- nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner 2022-04-26 18:06:27.000000000 -0400 ++++ nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in 2022-11-30 13:30:11.651106256 -0500 +@@ -1,5 +1,5 @@ + # State file (e.g. upsd to driver) and pidfile location for NUT: +-d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @STATEPATH@/nut +-d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +-X @PIDPATH@/nut ++d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @STATEPATH@ ++d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - ++X @PIDPATH@ diff --git a/nut-c99-ax_c_printf_null.patch b/nut-c99-ax_c_printf_null.patch new file mode 100644 index 0000000..9db80b0 --- /dev/null +++ b/nut-c99-ax_c_printf_null.patch @@ -0,0 +1,60 @@ +Fix several issues with the AX_C_PRINTF_STRING_NULL check: + +Adjust quoting in the AX_C_PRINTF_STRING_NULL definition. Switch to +strstr from strcasestr (a GNU extension, requires -D_GNU_SOURCE) +and include instead of . Add missing braces +and parentheses. Use double-quote for string literals. + +Submitted upstream: + +diff --git a/m4/ax_c_pragmas.m4 b/m4/ax_c_pragmas.m4 +index 53c1aebf8ea35a1e..14ecd596d3b36573 100644 +--- a/m4/ax_c_pragmas.m4 ++++ b/m4/ax_c_pragmas.m4 +@@ -943,32 +943,32 @@ if test -z "${nut_have_ax_c_printf_string_null_seen}"; then + dnl ### To be sure, bolt the language + AC_LANG_PUSH([C]) + +- AC_CACHE_CHECK([for practical support to pritnf("%s", NULL)], ++ AC_CACHE_CHECK([for practical support to printf("%s", NULL)], + [ax_cv__printf_string_null], + [AX_RUN_OR_LINK_IFELSE( + [AC_LANG_PROGRAM([dnl + #include +-#include +-], [dnl ++#include ++], [[ + char buf[128]; + char *s = NULL; + int res = snprintf(buf, sizeof(buf), "%s", s); + buf[sizeof(buf)-1] = '\0'; + if (res < 0) { +- printf(stderr, "FAILED to snprintf() a NULL string argument"); +- exit 1; ++ fprintf(stderr, "FAILED to snprintf() a NULL string argument\n"); ++ return 1; + } +-if (buf[0] == '\0') +- printf(stderr, "RETURNED empty string from snprintf() with a NULL string argument"); +- exit 0; ++if (buf[0] == '\0') { ++ fprintf(stderr, "RETURNED empty string from snprintf() with a NULL string argument\n"); ++ return 0; + } +-if (strcasestr(buf, 'null') == NULL) +- printf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'", buf); +- exit 0; ++if (strstr(buf, "null") == NULL) { ++ fprintf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'\n", buf); ++ return 0; + } +-printf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'", buf); +-exit 0; +- ])], ++fprintf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'\n", buf); ++return 0; ++ ]])], + [ax_cv__printf_string_null=yes], + [ax_cv__printf_string_null=no] + )] diff --git a/nut-c99-c_attribute.patch b/nut-c99-c_attribute.patch new file mode 100644 index 0000000..aff6495 --- /dev/null +++ b/nut-c99-c_attribute.patch @@ -0,0 +1,17 @@ +Call the defined foo function instead of the undeclared func function. + +Submitted upstream: + +diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4 +index 0e952e7841c35b60..780bc2bb14ac5a78 100644 +--- a/m4/ax_c___attribute__.m4 ++++ b/m4/ax_c___attribute__.m4 +@@ -67,7 +67,7 @@ AC_DEFUN([AX_C___ATTRIBUTE__], [ + foo(__attribute__ ((unused)) int i) { + return; + } +- ]], [func(1);])], ++ ]], [foo(1);])], + [ax_cv___attribute__unused_arg=yes], + [ax_cv___attribute__unused_arg=no] + ) diff --git a/nut-c99-strdup.patch b/nut-c99-strdup.patch new file mode 100644 index 0000000..90c83db --- /dev/null +++ b/nut-c99-strdup.patch @@ -0,0 +1,17 @@ +Fix strdup configure test: Remove a call to the undeclared free +function. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index 3aa26c24ebc99bb6..c93ccd1e494874d5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -294,7 +294,6 @@ AC_CACHE_CHECK([for strdup(s)], + char *t = "Test"; + char *s = strdup(t); + if (!s || !(s[0]=='T'&&s[1]=='e'&&s[2]=='s'&&s[3]=='t'&&s[4]=='\0') || s == t) res = 1; +-if (s) free (s); + if (res != 0) return res + /* autoconf adds ";return 0;" */ + ]])], diff --git a/nut.spec b/nut.spec index 7a7f960..25e8112 100644 --- a/nut.spec +++ b/nut.spec @@ -1,5 +1,5 @@ %global _hardened_build 1 -%global with_python2 1 +#global with_python2 0 %bcond_with python2 #TODO: split nut-client so it does not require python @@ -9,29 +9,26 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /run/nut %global modeldir /usr/sbin +# powerman is retired on Fedora, therefore disable it by default +%bcond_with powerman Summary: Network UPS Tools Name: nut -Version: 2.7.4 -Release: 3%{?dist} -Group: Applications/System +Version: 2.8.0 +Release: 2%{?dist} License: GPLv2+ and GPLv3+ -Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz -Source3: nut-client.tmpfiles +Url: https://www.networkupstools.org/ +Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz Source4: libs.sh -# Upstream support for OpenSSL-1.1.0, TLS > 1.0 -Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch Patch1: nut-2.6.3-tmpfiles.patch +Patch2: nut-2.8.0-piddir-owner.patch #quick fix. TODO: fix it properly -Patch3: nut-2.6.5-quickfix.patch -Patch4: nut-2.6.5-ipmifix.patch -Patch5: nut-2.6.5-dlfix.patch -Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -Patch10: nut-2.7.4-cloexec.patch +Patch13: nut-c99-c_attribute.patch +Patch14: nut-c99-ax_c_printf_null.patch +Patch15: nut-c99-strdup.patch Requires(pre): shadow-utils Requires(post): coreutils systemd @@ -39,8 +36,10 @@ Requires(preun): systemd Requires(postun): coreutils systemd Obsoletes: nut-hal < 2.6.0-7 +BuildRequires: make BuildRequires: autoconf BuildRequires: automake +BuildRequires: augeas-libs BuildRequires: avahi-devel BuildRequires: cppunit-devel BuildRequires: dbus-glib-devel @@ -61,17 +60,24 @@ BuildRequires: libXpm-devel BuildRequires: neon-devel BuildRequires: net-snmp-devel BuildRequires: netpbm-devel +BuildRequires: nss-devel BuildRequires: openssl-devel BuildRequires: pkgconfig -#BuildRequires: powerman-devel -BuildRequires: python-devel +%if %{with powerman} +BuildRequires: powerman-devel +%endif +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: /usr/bin/pathfix.py +#BuildRequires: systemd-rpm-macros + %ifnarch s390 s390x BuildRequires: libusb-devel %endif ExcludeArch: s390 s390x -%global restart_flag /var/run/%{name}/%{name}-restart-after-rpm-install +%global restart_flag %{piddir}/%{name}-restart-after-rpm-install %description These programs are part of a developing project to monitor the assortment @@ -81,13 +87,14 @@ capability has been harnessed where possible to allow for safe shutdowns, live status tracking on web pages, and more. %package client -Group: Applications/System Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd Requires(pre): shadow-utils +%if %{with python2} Requires: pygtk2, pygtk2-libglade #only for python and gui part +%endif #Requires: %description client @@ -96,7 +103,6 @@ ups that the client host has access to, but where the UPS is physically attached to a different computer on the network. %package cgi -Group: Applications/System Summary: CGI utilities for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} webserver Requires(pre): shadow-utils @@ -106,7 +112,6 @@ This package includes CGI programs for accessing UPS status via a web browser. %package xml -Group: Applications/System Summary: XML UPS driver for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} @@ -115,7 +120,6 @@ This package adds the netxml-ups driver, that allows NUT to monitor a XML capable UPS. %package devel -Group: Development/Libraries Summary: Development files for NUT Client Requires: %{name}-client = %{version}-%{release} webserver openssl-devel @@ -125,39 +129,41 @@ necessary to develop NUT client applications. %prep %setup -q -%patch0 -p1 -b .openssl %patch1 -p1 -b .tmpfiles -%patch3 -p1 -b .quickfix -%patch5 -p1 -b .dlfix -%patch7 -p1 -b .foreground +%patch2 -p1 -b .piddir-owner %patch8 -p1 -b .unreachable %patch9 -p1 -b .rmpidf -%patch10 -p1 -b .cloexec +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 -sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop -sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor +sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop +sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in -#fix crlf end of lines -for f in docs/nut-qa.txt docs/website/css/ie-overrides.css docs/website/scripts/filter_png.js -do - sed -i 's/\r\n*$//' $f ||: -done - # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} %build autoreconf -i +export CXXFLAGS="-std=c++11 $RPM_OPT_FLAGS" # prevent assignment of default value, it would break configure's tests export LDFLAGS="-Wl,-z,now" %configure \ --with-all \ +%if %{without powerman} --without-powerman \ +%endif --with-libltdl \ - --without-hal \ +%if (0%{?fedora} && 0%{?fedora} < 33) || 0%{?el8} + --with-nss \ +%endif + --without-wrap \ + --without-modbus \ + --without-linux-i2c \ --with-cgi \ + --with-python3 \ --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ --with-group=dialout \ @@ -168,6 +174,7 @@ export LDFLAGS="-Wl,-z,now" --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ --with-systemdsystemunitdir=%{_unitdir} \ + --with-systemdshutdowndir=/lib/systemd/system-shutdown \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ @@ -179,8 +186,7 @@ sh %{SOURCE4} >>include/config.h #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool -%global _hardened_build 1 -%make_build CFLAGS="%{__global_cflags}" LDFLAGS="-Wl,-z,now -Wl,-z,relro %{__global_ldflags}" +%make_build LDFLAGS="%{__global_ldflags}" %install mkdir -p %{buildroot}%{modeldir} \ @@ -192,17 +198,16 @@ mkdir -p %{buildroot}%{modeldir} \ %make_install -%if %{?fedora}0 > 140 || %{?rhel}0 > 60 - install -p -D -m 644 %{SOURCE3} %{buildroot}/usr/lib/tmpfiles.d/nut-run.conf -%endif +mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/nut-common.conf rm -rf %{buildroot}%{_prefix}/html rm -f %{buildroot}%{_libdir}/*.la rm -rf docs/man +rm -rf %{buildroot}%{_datadir}/nut/solaris-init find docs/ -name 'Makefile*' -delete pushd conf; -make install DESTDIR=%{buildroot} +%make_install for file in %{buildroot}%{_sysconfdir}/ups/*.sample do mv $file %{buildroot}%{_sysconfdir}/ups/`basename $file .sample` @@ -210,6 +215,7 @@ done popd #fix collision with virtualbox +#mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-usbups.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-usbups.rules mv %{buildroot}/%{_usr}/lib/udev/rules.d/52-nut-ipmipsu.rules %{buildroot}/%{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules # fix encoding @@ -221,8 +227,9 @@ do done # install PyNUT -install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python_sitelib}/PyNUT.py +install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python3_sitelib}/PyNUT.py # install nut-monitor +%if %{with python2} mkdir -p %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps install -p -m 755 scripts/python/app/NUT-Monitor %{buildroot}%{_datadir}/nut/nut-monitor/nut-monitor install -p -m 644 scripts/python/app/gui-1.3.glade %{buildroot}%{_datadir}/nut/nut-monitor @@ -230,11 +237,12 @@ install -p -m 644 scripts/python/app/pixmaps/* %{buildroot}%{_datadir}/nut/nut-m install -p -D scripts/python/app/nut-monitor.png %{buildroot}%{_datadir}/pixmaps/nut-monitor.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications scripts/python/app/nut-monitor.desktop ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor +%endif %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} # do not let upsmon run during upgrade rhbz#916472 # phase 1: stop upsmon before upsd changes @@ -247,7 +255,6 @@ fi %post /sbin/ldconfig -systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || : %systemd_post nut-driver.service nut-server.service %preun @@ -260,16 +267,15 @@ systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/nul %pre client /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} %pre cgi /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout %{name} +/usr/sbin/usermod -G dialout,tty %{name} %post client /sbin/ldconfig -systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || : %systemd_post nut-monitor.service %preun client @@ -277,6 +283,7 @@ systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/nul %postun client /sbin/ldconfig +%systemd_postun_with_restart nut-monitor.service %posttrans # phase 2: start upsmon again @@ -295,26 +302,30 @@ fi %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users -%if %{?fedora}0 > 140 || %{?rhel}0 > 60 -/usr/lib/tmpfiles.d/nut-run.conf -%endif %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* %exclude %{modeldir}/netxml-ups -%{_unitdir}/nut-driver.service +%{_unitdir}/nut-driver-enumerator.path +%{_unitdir}/nut-driver-enumerator.service +%{_unitdir}/nut-driver@.service +%{_unitdir}/nut-driver.target %{_unitdir}/nut-server.service -%ghost %{piddir} +%{_unitdir}/nut.target %{_sbindir}/upsd %{_bindir}/nut-scanner %{_bindir}/upslog %{_libdir}/libnutscan.so.* +%{_libexecdir}/nut-driver-enumerator.sh +%{_datadir}/augeas/lenses/dist/nut* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list %{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/ups.conf.5.gz %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz + + %{_mandir}/man8/al175.8.gz %{_mandir}/man8/apcsmart.8.gz %{_mandir}/man8/apcsmart-old.8.gz @@ -342,10 +353,13 @@ fi %{_mandir}/man8/masterguard.8.gz %{_mandir}/man8/metasys.8.gz %{_mandir}/man8/microdowell.8.gz +%{_mandir}/man8/microsol-apc.8.gz %{_mandir}/man8/mge-utalk.8.gz %{_mandir}/man8/mge-shut.8.gz %{_mandir}/man8/nutupsdrv.8.gz %{_mandir}/man8/nutdrv_atcl_usb.8.gz +%{_mandir}/man8/nutdrv_siemens_sitop.8.gz +%{_mandir}/man8/nut-driver-enumerator.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz %{_mandir}/man8/nut-recorder.8.gz %{_mandir}/man8/nut-scanner.8.gz @@ -353,7 +367,9 @@ fi %{_mandir}/man8/oneac.8.gz %{_mandir}/man8/optiups.8.gz %{_mandir}/man8/powercom.8.gz -#%{_mandir}/man8/powerman-pdu.8.gz +%if %{with powerman} +%{_mandir}/man8/powerman-pdu.8.gz +%endif %{_mandir}/man8/powerpanel.8.gz %{_mandir}/man8/rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz @@ -369,6 +385,7 @@ fi %{_mandir}/man8/upscode2.8* %{_mandir}/man8/upsd.8.gz %{_mandir}/man8/upsdrvctl.8.gz +%{_mandir}/man8/upsdrvsvcctl.8.gz %{_mandir}/man8/upslog.8.gz %{_mandir}/man8/usbhid-ups.8.gz @@ -377,9 +394,7 @@ fi %dir %{_sysconfdir}/ups %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf -%if %{?fedora}0 > 140 || %{?rhel}0 > 60 -/usr/lib/tmpfiles.d/nut-run.conf -%endif +%{_tmpfilesdir}/nut-common.conf %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups # upsmon.pid is written as root, so root needs access for now %ghost %attr(770,root,nut) %{piddir} @@ -393,6 +408,7 @@ fi /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* %{_libdir}/libnutclient.so.* +%{_libdir}/libnutclientstub.so.* %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz %{_mandir}/man8/upsc.8.gz @@ -400,11 +416,15 @@ fi %{_mandir}/man8/upsrw.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz -%{_bindir}/nut-monitor -%{python_sitelib}/PyNUT.* +#%%pycached %%{python3_sitelib}/PyNUT.py +# use glob list, as %%pycached does not work... +%{python3_sitelib}/* %{_datadir}/nut +%if %{with python2} +%{_bindir}/nut-monitor %{_datadir}/pixmaps/nut-monitor.png %{_datadir}/applications/nut-monitor.desktop +%endif %files cgi %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf @@ -431,12 +451,22 @@ fi %{_mandir}/man3/libnutclient* %{_libdir}/libupsclient.so %{_libdir}/libnutclient.so +%{_libdir}/libnutclientstub.so %{_libdir}/libnutscan.so %{_libdir}/pkgconfig/libupsclient.pc %{_libdir}/pkgconfig/libnutclient.pc +%{_libdir}/pkgconfig/libnutclientstub.pc %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Dec 06 2022 Michal Hlavinka - 2.8.0-2 +- fix STATEPATH location and creation (#2024651) +- merged C99 related changes to configure from fedora +- trim changelog + +* Tue Sep 13 2022 Michal Hlavinka - 2.8.0-1 +- update to 2.8.0 + * Tue Jun 02 2020 Michal Hlavinka - 2.7.4-3 - update nut run directories @@ -539,460 +569,3 @@ fi * Thu Jan 05 2012 Michal Hlavinka - 2.6.3-1 - nut updated to 2.6.3 - -* Tue Dec 06 2011 Adam Jackson - 2.6.2-2 -- Rebuild for new libpng - -* Fri Sep 16 2011 Michal Hlavinka - 2.6.2-1 -- nut updated to 2.6.2 - -* Tue Aug 16 2011 Michal Hlavinka - 2.6.1-4 -- update requirements of packages - -* Fri Jul 22 2011 Michal Hlavinka - 2.6.1-3 -- add initial support for systemd - -* Fri Jul 08 2011 Michal Hlavinka - 2.6.1-2 -- rebuilt for net-snmp update - -* Tue Jun 07 2011 Michal Hlavinka - 2.6.1-1 -- nut updated to 2.6.1 - -* Thu Apr 21 2011 Michal Hlavinka - 2.6.0-8 -- fix usb report reading (#698512) - -* Thu Apr 21 2011 Michal Hlavinka - 2.6.0-7 -- nut-hal should be obsoleted to prevent broken dependency in yum - -* Wed Apr 20 2011 Michal Hlavinka - 2.6.0-6 -- standard dependency adds udev, but we need it for %%pre script - -* Wed Apr 20 2011 Michal Hlavinka - 2.6.0-5 -- drop hal support, it was removed from rawhide - -* Mon Mar 28 2011 Michal Hlavinka - 2.6.0-4 -- fix list of ssl libraries in libupsclient.pc - -* Mon Feb 21 2011 Michal Hlavinka - 2.6.0-3 -- add nut-monitor (gui) to client sub-package - -* Tue Feb 08 2011 Fedora Release Engineering - 2.6.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Jan 17 2011 Michal Hlavinka - 2.6.0-1 -- nut updated to 2.6.0 -- fixed reading of reports bigger than 8 bytes - -* Fri Nov 26 2010 Michal Hlavinka - 2.4.3-9 -- use %%ghost for /var/run/nut (#656645) - -* Fri Nov 05 2010 Michal Hlavinka - 2.4.3-8 -- rebuild because libraries were updated - -* Wed Sep 29 2010 jkeating - 2.4.3-7 -- Rebuilt for gcc bug 634757 - -* Fri Sep 17 2010 Michal Hlavinka - 2.4.3-6 -- fix inconsitent name of upsdrvctl in init script (#633116) - -* Mon Jul 26 2010 Michal Hlavinka - 2.4.3-5 -- fix crash when port= is ommited (#616375) -- fix issue where nut fails to restart because it did not finished termination - yet and old instance blocks devices (#193058) - -* Wed Jul 07 2010 Michal Hlavinka - 2.4.3-4 -- follow licensing guideline update - -* Fri Mar 26 2010 Michal Hlavinka - 2.4.3-3 -- replace BUS with SUBSYSTEMS in udev rules (#573806) - -* Tue Mar 23 2010 Michal Hlavinka - 2.4.3-2 -- reduced size of buffer to maximum size supported by low-speed USB devices -- fixes #575334 - -* Wed Feb 24 2010 Michal Hlavinka - 2.4.3-1 -- cyberpower driver was replaced by the powerpanel driver -- general USB support has been vastly improved, including many bug - fixes, new features and devices -- the virtual driver has been renamed to 'clone' -- the UPower (previously known as DeviceKit-power) rules file is now - generated by NUT -- a lot of new devices supported - -* Thu Nov 05 2009 Michal Hlavinka - 2.4.1-9 -- spec cleanup - -* Fri Aug 21 2009 Tomas Mraz - 2.4.1-8 -- rebuilt with new openssl - -* Sat Jul 25 2009 Fedora Release Engineering - 2.4.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed May 20 2009 Michal Hlavinka - 2.4.1-6 -- fix coexistence with virtualbox (#488368) - -* Wed May 20 2009 Michal Hlavinka - 2.4.1-5 -- add requires for hal (#501687) - -* Fri Apr 17 2009 Michal Hlavinka - 2.4.1-4 -- change group even for existing nut user (#495999) - -* Tue Apr 14 2009 Michal Hlavinka - 2.4.1-3 -- udev changed group from uucp to dialout, follow the change (#494020) - -* Wed Feb 25 2009 Fedora Release Engineering - 2.4.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Tue Feb 17 2009 Michal Hlavinka 2.4.1-1 -- update to 2.4.1 -- added support for microdowell ups - -* Mon Feb 16 2009 Michal Hlavinka 2.4.0-1 -- update to new stable branch 2.4 - -* Sat Jan 17 2009 Tomas Mraz 2.2.2-6 -- rebuild with new openssl - -* Thu Dec 18 2008 Michal Hlavinka 2.2.2-5 -- remove rpath, fix libtool - -* Wed Dec 17 2008 Michal Hlavinka 2.2.2-4 -- fix #476850 - tripplite_usb driver segfaults when UPS on battery - -* Mon Sep 15 2008 Tomas Smetana 2.2.2-3 -- fix #461374 - add missing udev rules - -* Mon Aug 25 2008 Tomas Smetana 2.2.2-2 -- fix requirements in spec file -- build a separate hal package - -* Mon May 12 2008 Tomas Smetana 2.2.2-1 -- new upstream version - -* Tue Feb 12 2008 Tomas Smetana 2.2.1-3 -- fix compilation error with new glibc headers - -* Tue Feb 12 2008 Tomas Smetana 2.2.1-2 -- rebuild (gcc-4.3) - -* Wed Jan 09 2008 Tomas Smetana 2.2.1-1 -- new upstream version - -* Wed Dec 05 2007 Tomas Smetana 2.2.0-6.2 -- rebuild - -* Thu Nov 29 2007 Tomas Smetana 2.2.0-6.1 -- init script update, fix a typo - -* Wed Nov 28 2007 Tomas Smetana 2.2.0-6 -- fix forgotten bug in init script -- do not hardcode the uucp group in udev patch - -* Tue Nov 27 2007 Tomas Smetana 2.2.0-5 -- fix udev rules and hal information files -- fix init script - -* Wed Sep 19 2007 Tomas Smetana 2.2.0-4 -- fix manpages encodings -- run ldconfig after client (un)install -- fix HAL support - -* Thu Sep 06 2007 Tomas Smetana 2.2.0-3 -- fix wrong libssl flags in devel, fix devel package dependencies - -* Wed Aug 15 2007 Tomas Smetana 2.2.0-2 -- fix #249028 - usb udev rules -- update initscript and sysconfig file -- fix calls to open() for compatibility with the new glibc - -* Fri Jul 13 2007 Tomas Smetana 2.2.0-1.1 -- rebuild - -* Fri Jul 13 2007 Tomas Smetana 2.2.0-1 -- new upstream version (Resolves: #248074) -- initscripts update -- spec file cleanup - -* Mon May 07 2007 Arnaud Quette 2.1.0-1 -- update to 2.1.0 development tree -- HAL, ... - -* Mon Mar 26 2007 Than Ngo 2.0.5-3 -- cleanup - -* Tue Jan 23 2007 Karsten Hopp 2.0.5-2 -- rename fatal to fatal_with_errno in ipv6 patch -- fix filelist - -* Tue Jan 23 2007 Karsten Hopp 2.0.5-1 -- update to 2.0.5 - -* Wed Nov 29 2006 Karsten Hopp 2.0.4-2 -- rebuild with new net-snmp-libs -- disable nut-2.0.1-bad.patch, not required - -* Tue Nov 21 2006 Than Ngo - 2.0.4-1 -- add IPv6 support, thanks to Dan KopeÄek (#198394) - -* Wed Jul 12 2006 Jesse Keating - 2.0.3-2.1 -- rebuild - -* Tue May 16 2006 Than Ngo 2.0.3-2 -- fix #191914, BR fontconfig-devel for cgi - -* Mon Apr 24 2006 Than Ngo 2.0.3-1 -- update to 2.0.3 -- drop nut-2.0.2-buffer.patch, it's included in new upstream -- add udev rule #189674, #187105 - -* Fri Feb 10 2006 Jesse Keating - 2.0.2-6.2 -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Jesse Keating - 2.0.2-6.1 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Tue Jan 03 2006 Radek Vokal 2.0.2-6 -- rebuilt against new libnetsnmp - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Wed Nov 23 2005 Than Ngo 2.0.2-5 -- fix for modular X - -* Wed Nov 09 2005 Than Ngo 2.0.2-4 -- rebuilt - -* Mon Nov 07 2005 Than Ngo 2.0.2-3 -- rebuilt - -* Thu Nov 03 2005 Than Ngo 2.0.2-2 -- rebuilt against new libnetsnmp - -* Wed Jul 20 2005 Than Ngo 2.0.2-1 -- fix compiler warnings #156027 -- fix pid issue #159450 -- fix wrong ownership and permissions #159449, #141123 -- update to 2.0.2 - -* Thu Mar 10 2005 Than Ngo 2.0.1-1 -- 2.0.1 -- fix uninit local variable, #131773 - -* Wed Dec 08 2004 Than Ngo 2.0.0-7 -- don't requires libusb-devel on s390/s390x -- add %%{release} in buildroot - -* Thu Nov 25 2004 Miloslav Trmac - 2.0.0-6 -- Convert newhidups.8 to UTF-8 - -* Tue Oct 05 2004 Than Ngo 2.0.0-5 -- more buildrequires -- don't build on s390/s390x - -* Thu Aug 26 2004 Nalin Dahyabhai 2.0.0-4 -- fix syntax error in -client postun scriptlet (#131040) - -* Tue Jun 15 2004 Elliot Lee -- rebuilt - -* Mon May 10 2004 Than Ngo 2.0.0-2 -- fixed permission problem, bug #122867 - -* Fri Apr 02 2004 Than Ngo 2.0.0-1 -- 2.0.0 - -* Sat Feb 14 2004 Than Ngo 1.4.1-3 -- add some missing drivers - -* Fri Feb 13 2004 Elliot Lee -- rebuilt - -* Wed Feb 11 2004 Than Ngo 1.4.1-1 -- 1.4.1 -- fixed permission problem (bug #115290) - -* Wed Sep 24 2003 Mike McLean 1.4.0-3 -- fixed 'nut' user problem with nut-cgi (bug#104872) - -* Mon Sep 15 2003 Than Ngo 1.4.0-2 -- added missing hidups driver (bug #104412) - -* Tue Sep 09 2003 Than Ngo 1.4.0-1 -- 1.4.0 -- fixed permission problem (bug #103023) -- fixed rpm file list (bug #90848) -- added support multiple drivers, thanks to Gilbert E. Detillieux (bug #79465) - -* Thu Jun 26 2003 Than Ngo 1.2.2-3 -- Add variable to ups sysconfig file for upsd (bug #97900) - -* Wed Jun 04 2003 Elliot Lee -- rebuilt - -* Wed May 7 2003 Than Ngo 1.2.2-1 -- 1.2.2 - -* Tue May 06 2003 Phil Knirsch 1.2.0-7 -- Bumped release and rebuilt because of new gd version. - -* Thu Feb 13 2003 Than Ngo 1.2.0-6 -- build with correct userid #84199 -- fix directory permission - -* Tue Feb 11 2003 Than Ngo 1.2.0-5 -- add user nut, bug #81500 -- fix permission issue, bug #81524, #83997 -- own /etc/ups, bug #73959 - -* Wed Jan 22 2003 Tim Powers -- rebuilt - -* Wed Jan 8 2003 Thomas Woerner 1.2.0-3 -- added html templates for cgi scripts (#78532) -- added hidups driver (#80334) - -* Wed Dec 18 2002 Dan Walsh 1.2.0-2 -- Fix service description - -* Wed Nov 6 2002 han Ngo 1.2.0-1 -- update to 1.2.0 - -* Mon Nov 4 2002 Than Ngo 1.00-1 -- update to 1.00 - -* Wed Jul 31 2002 Than Ngo 0.45.4-5 -- Fixed wrong CMDSCRIPT (bug #69817) - -* Fri Jun 21 2002 Tim Powers -- automated rebuild - -* Sun Jun 02 2002 Than Ngo 0.45.4-3 -- fix forced shutdown (bug #65824, #60516) -- enable hidups driver -- add missing manages (bug #65188) - -* Thu May 23 2002 Tim Powers -- automated rebuild - -* Tue Feb 26 2002 Than Ngo 0.45.4-1 -- update to 0.45.4 - -* Wed Jan 09 2002 Tim Powers -- automated rebuild - -* Fri Dec 14 2001 Than Ngo 0.45.3-1 -- update to 0.45.2 -- fix bug #57417 - -* Tue Nov 27 2001 Than Ngo 0.45.2-1 -- update to 0.45.2 -- clean up some patch files for 0.45.2 - -* Tue Jul 24 2001 Than Ngo 0.45.0-3 -- fix build dependencies (bug #49858) - -* Fri Jul 6 2001 Than Ngo 0.45.0-2 -- rebuild - -* Wed Jun 13 2001 Than Ngo -- update to 0.45.0 -- add some patches from alane@geeksrus.net (bug #44361, #44363) - -* Sun Apr 22 2001 Than Ngo -- add all available UPS drivers (Bug #36937) - -* Fri Apr 13 2001 Than Ngo -- update to 0.44.3 (Bug #35255) - -* Fri Feb 9 2001 Than Ngo -- fixed typo (Bug #26535) - -* Tue Feb 6 2001 Trond Eivind Glomsrd -- Fix some of the i18n -- make it exit cleanly if not configured - -* Fri Jan 26 2001 Than Ngo -- initscript internationalisation - -* Thu Jan 11 2001 Than Ngo -- fixed init script error (bug #23525) - -* Sat Oct 21 2000 Than Ngo -- update to 0.44.1 - -* Tue Aug 01 2000 Than Ngo -- rebuilt with Michael changes - -* Mon Jul 31 2000 Michael Stefaniuc -- changed /etc/sysconfig/ups to adress the changes in 0.44.0 -- moved /etc/sysconfig/ups to the server package -- changed the initscript -- small config file patch - -* Fri Jul 28 2000 Than Ngo -- fixed initscripts so that condrestart doesn't return 1 when the test fails - -* Mon Jul 24 2000 Than Ngo -- nut CGIs is disable as default (Bug #14282) - -* Tue Jul 18 2000 Than Ngo -- update to 0.44.0 -- inits back to rc.d/init.d, using service to fire them up - -* Wed Jul 12 2000 Than Ngo -- fix initscript and specfile, it should work with 6.x and 7.x -- add --with-statepath and --sysconfdir to %%configure (thanks Michael) - -* Sat Jul 08 2000 Than Ngo -- add Prereq: /etc/init.d - -* Tue Jun 27 2000 Than Ngo -- don't prereq, only require initscripts - -* Mon Jun 26 2000 Than Ngo -- /etc/rc.d/init.d -> /etc/init.d -- prereq initscripts >= 5.20 - -* Fri Jun 16 2000 Bill Nottingham -- don't run by default - -* Mon Jun 12 2000 Preston Brown -- adopted for Winston. Use our new path macros. -- change nocgi pkg to a cgi pkg (inclusive rather than exclusive). -- new init script - -* Sat May 06 2000 (0.43.2-1) -- Updated Package to new release - -* Thu Jan 20 2000 (0.42.2-1) -- Updated package to new release -- Dropped bestups patch since that is fixed in 0.42.2 - -* Sat Dec 18 1999 (0.42.1-4) -- Package now uses chkconfig - -* Sat Dec 18 1999 (0.42.1-3) -- applied an improved patch to deal with the - bestups string length issue. - -* Sat Dec 11 1999 (0.42.1-1) -- fixed string length in bestups.c line 279. -- upgraded package to 0.42.1 from 0.42.0 - -* Mon Dec 6 1999 (0.42.0-8) -- added requirement of nut-client for nut. - -* Mon Dec 6 1999 (0.42.0-7) -- removed overlapping files between the nut and nut-client rpms - -* Tue Nov 23 1999 (0.42.0-6) -- stop ups before uninstalling - -* Tue Nov 23 1999 (0.42.0-5) -- build against gd 1.6.3 - -* Wed Nov 03 1999 (0.42.0-4) -- Initial build of nut (well almost). -- Removed chmod from the make file so that the package - does not have to be built as root..... diff --git a/sources b/sources index 58940c6..3574636 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.7.4.tar.gz) = 320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a +SHA512 (nut-2.8.0.tar.gz) = 3c413ae54088045a713eb80cf1bdda474f41bb3b67c7c0248aa7a0c4d441dce1ff42627a2735273d7e36892d1f2eeb895220cf28af63fec2fa0c7a267f82d577 From 8debbe8226955e0b70226827d26accc2a6689345 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 4 Jan 2023 13:12:09 +0100 Subject: [PATCH 109/142] move upslog to nut-client, some small spec file changes (#2156504) --- nut.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index c681f2e..059600d 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ and GPLv3+ Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -314,6 +314,7 @@ fi %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users +%{_tmpfilesdir}/nut-common.conf %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* @@ -326,7 +327,6 @@ fi %{_unitdir}/nut.target %{_sbindir}/upsd %{_bindir}/nut-scanner -%{_bindir}/upslog %{_libdir}/libnutscan.so.* %{_libexecdir}/nut-driver-enumerator.sh %{_datadir}/augeas/lenses/dist/nut* @@ -406,12 +406,12 @@ fi %{_mandir}/man8/upsd.8.gz %{_mandir}/man8/upsdrvctl.8.gz %{_mandir}/man8/upsdrvsvcctl.8.gz -%{_mandir}/man8/upslog.8.gz %{_mandir}/man8/usbhid-ups.8.gz %files client %license COPYING LICENSE-GPL2 LICENSE-GPL3 %dir %{_sysconfdir}/ups +%config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf %{_tmpfilesdir}/nut-common.conf @@ -420,19 +420,23 @@ fi %ghost %attr(770,root,nut) %{piddir} %{_bindir}/upsc %{_bindir}/upscmd +%{_bindir}/upslog %{_bindir}/upsrw %{_sbindir}/upsmon %{_sbindir}/upssched %{_bindir}/upssched-cmd %{_unitdir}/nut-monitor.service +%{_unitdir}/nut.target /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* %{_libdir}/libnutclient.so.* %{_libdir}/libnutclientstub.so.* +%{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz %{_mandir}/man8/upsc.8.gz %{_mandir}/man8/upscmd.8.gz +%{_mandir}/man8/upslog.8.gz %{_mandir}/man8/upsrw.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz @@ -477,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Jan 04 2023 Michal Hlavinka - 2.8.0-8 +- move upslog to nut-client, some small spec file changes (#2156504) + * Wed Nov 30 2022 Charles R. Anderson - 2.8.0-7 - use piddir for specifying restart_flag location - use piddir for specifying configure --with-statepath/pidpath/altpidpath From aad68762c36f5863ac83c4025e303cb9a5ed5240 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 21:54:34 +0000 Subject: [PATCH 110/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 059600d..391ac90 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ and GPLv3+ Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 2.8.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Wed Jan 04 2023 Michal Hlavinka - 2.8.0-8 - move upslog to nut-client, some small spec file changes (#2156504) From dc7efebac0f2cd2d19ec01be97e0e116092c9a97 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 14 Feb 2023 22:19:17 +0100 Subject: [PATCH 111/142] add nut-xml to nut recommends (#2151810) --- nut.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index 391ac90..57ca2e7 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ and GPLv3+ Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -40,7 +40,7 @@ Requires(pre): shadow-utils Requires(post): coreutils systemd Requires(preun): systemd Requires(postun): coreutils systemd -Obsoletes: nut-hal < 2.6.0-7 +Recommends: nut-xml BuildRequires: make BuildRequires: autoconf @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Feb 14 2023 Michal Hlavinka - 2.8.0-10 +- add nut-xml to nut recommends (#2151810) + * Thu Jan 19 2023 Fedora Release Engineering - 2.8.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 64fdb722821f241107c1180020897fe9cbddc291 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 26 Apr 2023 10:57:21 +0200 Subject: [PATCH 112/142] update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 --- nut.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nut.spec b/nut.spec index 57ca2e7..6ee77f3 100644 --- a/nut.spec +++ b/nut.spec @@ -14,8 +14,8 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 10%{?dist} -License: GPLv2+ and GPLv3+ +Release: 11%{?dist} +License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz Source4: libs.sh @@ -267,14 +267,14 @@ fi %post /sbin/ldconfig -%systemd_post nut-driver.service nut-server.service +%systemd_post nut-driver.target nut.target %preun -%systemd_preun nut-driver.service nut-server.service +%systemd_preun nut-driver.target nut.target %postun /sbin/ldconfig -%systemd_postun_with_restart nut-driver.service nut-server.service +%systemd_postun_with_restart nut-driver.target nut.target %pre client /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Apr 26 2023 Michal Hlavinka - 2.8.0-11 +- update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 + * Tue Feb 14 2023 Michal Hlavinka - 2.8.0-10 - add nut-xml to nut recommends (#2151810) From d7132ee907c842fb8b6d0475996d549f29f2e2d1 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 3 May 2023 12:26:49 +0200 Subject: [PATCH 113/142] use new patch macro format, with epel compatibility --- nut.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nut.spec b/nut.spec index 6ee77f3..9b6bb19 100644 --- a/nut.spec +++ b/nut.spec @@ -138,18 +138,18 @@ necessary to develop NUT client applications. %prep %setup -q #patch0 -p1 -b .openssl -%patch1 -p1 -b .tmpfiles -%patch2 -p1 -b .piddir-owner +%patch -P1 -p1 -b .tmpfiles +%patch -P2 -p1 -b .piddir-owner #patch5 -p1 -b .dlfix #%patch7 -p1 -b .foreground -%patch8 -p1 -b .unreachable -%patch9 -p1 -b .rmpidf +%patch -P8 -p1 -b .unreachable +%patch -P9 -p1 -b .rmpidf #%patch10 -p1 -b .cloexec #%patch11 -p1 -b .nutscanner-FTBFS #%patch12 -p1 -b .scratchdes -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 +%patch -P13 -p1 +%patch -P14 -p1 +%patch -P15 -p1 sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in From ea13be436ad067245373701f7c2879f631c4ec10 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 13 Jun 2023 20:23:11 +0200 Subject: [PATCH 114/142] Rebuilt for Python 3.12 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 9b6bb19..0ed1625 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 11%{?dist} +Release: 12%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Jun 13 2023 Python Maint - 2.8.0-12 +- Rebuilt for Python 3.12 + * Wed Apr 26 2023 Michal Hlavinka - 2.8.0-11 - update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 From d4f6d893fc05b16459fe7a0b2e5b626c5bedc1fd Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 14 Jun 2023 20:56:01 -0600 Subject: [PATCH 115/142] Drop BR on /usr/bin/pathfix.py --- nut.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/nut.spec b/nut.spec index 0ed1625..cde284b 100644 --- a/nut.spec +++ b/nut.spec @@ -76,7 +76,6 @@ BuildRequires: powerman-devel %endif BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: /usr/bin/pathfix.py BuildRequires: systemd-rpm-macros %ifnarch s390 s390x From 25721327233b407d5ea5a456dcd31e72c37b3500 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 17:01:05 +0000 Subject: [PATCH 116/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index cde284b..11ffab6 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 12%{?dist} +Release: 13%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -480,6 +480,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 2.8.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jun 13 2023 Python Maint - 2.8.0-12 - Rebuilt for Python 3.12 From f9d1f583d7a3ecc02d42da4252c621a13334b4fb Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 10 Oct 2023 00:11:39 +0200 Subject: [PATCH 117/142] spec cleanup, based on PR#14 by Orion Poplawski --- 504.patch | 333 ------------------ nut-2.6.5-dlfix.patch | 25 -- nut-2.6.5-foreground.patch | 129 ------- nut-2.6.5-quickfix.patch | 12 - nut-2.7.4-cloexec.patch | 82 ----- nut-2.7.4-nutscanner-FTBFS.patch | 20 -- nut-2.7.4-scratchdes.patch | 16 - nut-client.tmpfiles | 1 - nut.spec | 561 ++----------------------------- ups.init | 147 -------- ups.sysconfig | 8 - 11 files changed, 25 insertions(+), 1309 deletions(-) delete mode 100644 504.patch delete mode 100644 nut-2.6.5-dlfix.patch delete mode 100644 nut-2.6.5-foreground.patch delete mode 100644 nut-2.6.5-quickfix.patch delete mode 100644 nut-2.7.4-cloexec.patch delete mode 100644 nut-2.7.4-nutscanner-FTBFS.patch delete mode 100644 nut-2.7.4-scratchdes.patch delete mode 100644 nut-client.tmpfiles delete mode 100644 ups.init delete mode 100644 ups.sysconfig diff --git a/504.patch b/504.patch deleted file mode 100644 index 71e1bf4..0000000 --- a/504.patch +++ /dev/null @@ -1,333 +0,0 @@ -From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Mon, 27 Nov 2017 21:10:13 +0100 -Subject: [PATCH 1/7] Add support for openssl-1.1.0 - ---- - clients/upsclient.c | 4 ++++ - m4/nut_check_libopenssl.m4 | 5 +++-- - server/netssl.c | 4 ++++ - 3 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index b90587b00..fc5e7523c 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -316,7 +316,11 @@ int upscli_init(int certverify, const char *certpath, - - #ifdef WITH_OPENSSL - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+#else -+ OPENSSL_init_ssl(0, NULL); -+#endif - SSL_load_error_strings(); - - ssl_method = TLSv1_client_method(); -diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 -index 1b875077b..5f29f4a38 100644 ---- a/m4/nut_check_libopenssl.m4 -+++ b/m4/nut_check_libopenssl.m4 -@@ -57,8 +57,9 @@ if test -z "${nut_have_libopenssl_seen}"; then - AC_MSG_RESULT([${LIBS}]) - - dnl check if openssl is usable -- AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no]) -+ AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) -+ AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) -+ AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) - - if test "${nut_have_openssl}" = "yes"; then - nut_with_ssl="yes" -diff --git a/server/netssl.c b/server/netssl.c -index c2f409899..0f9a70acf 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -388,7 +388,11 @@ void ssl_init(void) - #ifdef WITH_OPENSSL - - SSL_load_error_strings(); -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+#else -+ OPENSSL_init_ssl(0, NULL); -+#endif - - if ((ssl_method = TLSv1_server_method()) == NULL) { - ssl_debug(); - -From b15656efb2575647ca0e0b6439b6380373767b8f Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Tue, 28 Nov 2017 20:00:52 +0100 -Subject: [PATCH 2/7] Allow TLSv1 and higher (not just TLSv1) - ---- - clients/upsclient.c | 30 +++++++++++++++++------------- - server/netssl.c | 26 +++++++++++++++----------- - 2 files changed, 32 insertions(+), 24 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index fc5e7523c..bd951e854 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -299,11 +299,6 @@ int upscli_init(int certverify, const char *certpath, - { - #ifdef WITH_OPENSSL - int ret, ssl_mode = SSL_VERIFY_NONE; --#if OPENSSL_VERSION_NUMBER >= 0x10000000L -- const SSL_METHOD *ssl_method; --#else -- SSL_METHOD *ssl_method; --#endif - #elif defined(WITH_NSS) /* WITH_OPENSSL */ - SECStatus status; - #endif /* WITH_OPENSSL | WITH_NSS */ -@@ -315,26 +310,35 @@ int upscli_init(int certverify, const char *certpath, - } - - #ifdef WITH_OPENSSL -+ -+ SSL_load_error_strings(); - - #if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+ -+ ssl_ctx = SSL_CTX_new(SSLv23_client_method()); - #else - OPENSSL_init_ssl(0, NULL); --#endif -- SSL_load_error_strings(); - -- ssl_method = TLSv1_client_method(); -- -- if (!ssl_method) { -- return 0; -- } -+ ssl_ctx = SSL_CTX_new(TLS_client_method()); -+#endif - -- ssl_ctx = SSL_CTX_new(ssl_method); - if (!ssl_ctx) { - upslogx(LOG_ERR, "Can not initialize SSL context"); - return -1; - } - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ /* set minimum protocol TLSv1 */ -+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); -+#else -+ ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION); -+ if (ret != 1) { -+ upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1"); -+ return -1; -+ } -+#endif -+ - if (!certpath) { - if (certverify == 1) { - upslogx(LOG_ERR, "Can not verify certificate if any is specified"); -diff --git a/server/netssl.c b/server/netssl.c -index 0f9a70acf..98680d25e 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -371,13 +371,7 @@ void ssl_init(void) - { - #ifdef WITH_NSS - SECStatus status; --#elif defined(WITH_OPENSSL) --#if OPENSSL_VERSION_NUMBER >= 0x10000000L -- const SSL_METHOD *ssl_method; --#else -- SSL_METHOD *ssl_method; --#endif --#endif /* WITH_NSS|WITH_OPENSSL */ -+#endif /* WITH_NSS */ - - if (!certfile) { - return; -@@ -388,21 +382,31 @@ void ssl_init(void) - #ifdef WITH_OPENSSL - - SSL_load_error_strings(); -+ - #if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_library_init(); -+ -+ ssl_ctx = SSL_CTX_new(SSLv23_server_method()); - #else - OPENSSL_init_ssl(0, NULL); -+ -+ ssl_ctx = SSL_CTX_new(TLS_server_method()); - #endif - -- if ((ssl_method = TLSv1_server_method()) == NULL) { -+ if (!ssl_ctx) { - ssl_debug(); -- fatalx(EXIT_FAILURE, "TLSv1_server_method failed"); -+ fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); - } - -- if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ /* set minimum protocol TLSv1 */ -+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); -+#else -+ if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) { - ssl_debug(); -- fatalx(EXIT_FAILURE, "SSL_CTX_new failed"); -+ fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)"); - } -+#endif - - if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) { - ssl_debug(); - -From 5a8308aef9884017754fb70620c8ded34fa44290 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Tue, 28 Nov 2017 22:01:41 +0100 -Subject: [PATCH 3/7] Fix check for empty string - ---- - clients/upssched.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clients/upssched.c b/clients/upssched.c -index 97b3ed42d..3fdf118ed 100644 ---- a/clients/upssched.c -+++ b/clients/upssched.c -@@ -794,7 +794,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd, - } - - if (!strcmp(cmd, "EXECUTE")) { -- if (ca1 == '\0') { -+ if (ca1[0] == '\0') { - upslogx(LOG_ERR, "Empty EXECUTE command argument"); - return; - } - -From 5ecfb0ffe3d89a5116dd287ff2c3f60de67ecbb9 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Fri, 1 Dec 2017 12:24:00 +0100 -Subject: [PATCH 4/7] Report TLS handshake in debug mode - ---- - clients/upsclient.c | 2 +- - server/netssl.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index bd951e854..b7dd8f424 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -745,7 +745,7 @@ static int upscli_sslinit(UPSCONN_t *ups, int verifycert) - switch(res) - { - case 1: -- upsdebugx(3, "SSL connected"); -+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl)); - break; - case 0: - upslog_with_errno(1, "SSL_connect do not accept handshake."); -diff --git a/server/netssl.c b/server/netssl.c -index 98680d25e..6ae13e8d3 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -275,7 +275,7 @@ void net_starttls(nut_ctype_t *client, int numarg, const char **arg) - { - case 1: - client->ssl_connected = 1; -- upsdebugx(3, "SSL connected"); -+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl)); - break; - - case 0: - -From ab0c8b41c0530d3706e4997257939026cfd29ccc Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:31:21 +0100 -Subject: [PATCH 5/7] Update nut_check_libopenssl.m4 - ---- - m4/nut_check_libopenssl.m4 | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4 -index 5f29f4a38..7eb401cd9 100644 ---- a/m4/nut_check_libopenssl.m4 -+++ b/m4/nut_check_libopenssl.m4 -@@ -57,9 +57,8 @@ if test -z "${nut_have_libopenssl_seen}"; then - AC_MSG_RESULT([${LIBS}]) - - dnl check if openssl is usable -- AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no]) -- AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], []) -- AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -+ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT]) -+ AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no]) - - if test "${nut_have_openssl}" = "yes"; then - nut_with_ssl="yes" - -From 1dc34a5da7308f0f85537a6761fefb3ff3098863 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:34:53 +0100 -Subject: [PATCH 6/7] Update upsclient.c - ---- - clients/upsclient.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/clients/upsclient.c b/clients/upsclient.c -index b7dd8f424..541664f36 100644 ---- a/clients/upsclient.c -+++ b/clients/upsclient.c -@@ -311,15 +311,12 @@ int upscli_init(int certverify, const char *certpath, - - #ifdef WITH_OPENSSL - -- SSL_load_error_strings(); -- - #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ SSL_load_error_strings(); - SSL_library_init(); - - ssl_ctx = SSL_CTX_new(SSLv23_client_method()); - #else -- OPENSSL_init_ssl(0, NULL); -- - ssl_ctx = SSL_CTX_new(TLS_client_method()); - #endif - - -From 108c31c9b170da2ee34a25fd373d21837d4d10a3 Mon Sep 17 00:00:00 2001 -From: Arjen de Korte -Date: Sun, 24 Feb 2019 18:37:42 +0100 -Subject: [PATCH 7/7] Update netssl.c - ---- - server/netssl.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/server/netssl.c b/server/netssl.c -index 6ae13e8d3..cf9419edf 100644 ---- a/server/netssl.c -+++ b/server/netssl.c -@@ -381,15 +381,12 @@ void ssl_init(void) - - #ifdef WITH_OPENSSL - -- SSL_load_error_strings(); -- - #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ SSL_load_error_strings(); - SSL_library_init(); - - ssl_ctx = SSL_CTX_new(SSLv23_server_method()); - #else -- OPENSSL_init_ssl(0, NULL); -- - ssl_ctx = SSL_CTX_new(TLS_server_method()); - #endif - diff --git a/nut-2.6.5-dlfix.patch b/nut-2.6.5-dlfix.patch deleted file mode 100644 index f93b5ea..0000000 --- a/nut-2.6.5-dlfix.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up nut-2.7.4/tools/nut-scanner/scan_avahi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_avahi.c -diff -up nut-2.7.4/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.7.4/tools/nut-scanner/scan_ipmi.c -diff -up nut-2.7.4/tools/nut-scanner/scan_nut.c.dlfix nut-2.7.4/tools/nut-scanner/scan_nut.c -diff -up nut-2.7.4/tools/nut-scanner/scan_snmp.c.dlfix nut-2.7.4/tools/nut-scanner/scan_snmp.c -diff -up nut-2.7.4/tools/nut-scanner/scan_usb.c.dlfix nut-2.7.4/tools/nut-scanner/scan_usb.c -diff -up nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.7.4/tools/nut-scanner/scan_xml_http.c ---- nut-2.7.4/tools/nut-scanner/scan_xml_http.c.dlfix 2016-03-08 13:01:11.000000000 +0100 -+++ nut-2.7.4/tools/nut-scanner/scan_xml_http.c 2016-03-12 00:23:02.554826665 +0100 -@@ -37,7 +37,6 @@ - #include - - /* dynamic link library stuff */ --static char * libname = "libneon"; - static lt_dlhandle dl_handle = NULL; - static const char *dl_error = NULL; - -@@ -102,7 +101,7 @@ int nutscan_load_neon_library(const char - - return 1; - err: -- fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname, dl_error); -+ fprintf(stderr, "Cannot load XML library (%s) : %s. XML search disabled.\n", libname_path, dl_error); - dl_handle = (void *)1; - lt_dlexit(); - return 0; diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch deleted file mode 100644 index 4064b86..0000000 --- a/nut-2.6.5-foreground.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -up nut-2.7.1/clients/upsmon.c.foreground nut-2.7.1/clients/upsmon.c ---- nut-2.7.1/clients/upsmon.c.foreground 2013-07-26 21:41:10.000000000 +0200 -+++ nut-2.7.1/clients/upsmon.c 2014-02-27 11:39:58.158784578 +0100 -@@ -1645,6 +1645,7 @@ static void help(const char *progname) - printf(" - reload: reread configuration\n"); - printf(" - stop: stop monitoring and exit\n"); - printf(" -D raise debugging level\n"); -+ printf(" -F run in foreground, do not daemonize\n"); - printf(" -h display this help\n"); - printf(" -K checks POWERDOWNFLAG, sets exit code to 0 if set\n"); - printf(" -p always run privileged (disable privileged parent)\n"); -@@ -1859,7 +1860,7 @@ static void check_parent(void) - int main(int argc, char *argv[]) - { - const char *prog = xbasename(argv[0]); -- int i, cmd = 0, checking_flag = 0; -+ int i, cmd = 0, checking_flag = 0, foreground = 0; - - printf("Network UPS Tools %s %s\n", prog, UPS_VERSION); - -@@ -1870,7 +1871,7 @@ int main(int argc, char *argv[]) - - run_as_user = xstrdup(RUN_AS_USER); - -- while ((i = getopt(argc, argv, "+Dhic:f:pu:VK46")) != -1) { -+ while ((i = getopt(argc, argv, "+DFhic:f:pu:VK46")) != -1) { - switch (i) { - case 'c': - if (!strncmp(optarg, "fsd", strlen(optarg))) -@@ -1887,6 +1888,9 @@ int main(int argc, char *argv[]) - case 'D': - nut_debug_level++; - break; -+ case 'F': -+ foreground = 1; -+ break; - case 'f': - free(configfile); - configfile = xstrdup(optarg); -@@ -1962,9 +1966,9 @@ int main(int argc, char *argv[]) - exit(EXIT_FAILURE); - } - -- if (nut_debug_level < 1) { -+ if (!foreground && nut_debug_level < 1) { - background(); -- } else { -+ } else if (nut_debug_level >= 1) { - upsdebugx(1, "debug level is '%d'", nut_debug_level); - } - -diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/scripts/systemd/nut-monitor.service.in ---- nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground 2014-02-27 11:39:58.141784438 +0100 -+++ nut-2.7.1/scripts/systemd/nut-monitor.service.in 2014-02-27 11:39:58.152784529 +0100 -@@ -4,9 +4,8 @@ After=local-fs.target network.target nut - - [Service] - ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-client.conf --ExecStart=@SBINDIR@/upsmon --PIDFile=@PIDPATH@/upsmon.pid --Type=forking -+ExecStart=@SBINDIR@/upsmon -F -+Type=simple - - [Install] - WantedBy=multi-user.target -diff -up nut-2.7.1/scripts/systemd/nut-server.service.in.foreground nut-2.7.1/scripts/systemd/nut-server.service.in ---- nut-2.7.1/scripts/systemd/nut-server.service.in.foreground 2013-07-26 21:41:11.000000000 +0200 -+++ nut-2.7.1/scripts/systemd/nut-server.service.in 2014-02-27 11:39:58.152784529 +0100 -@@ -5,8 +5,8 @@ Requires=nut-driver.service - Before=nut-monitor.service - - [Service] --ExecStart=@SBINDIR@/upsd --Type=forking -+ExecStart=@SBINDIR@/upsd -F -+Type=simple - - [Install] - WantedBy=multi-user.target -diff -up nut-2.7.1/server/upsd.c.foreground nut-2.7.1/server/upsd.c ---- nut-2.7.1/server/upsd.c.foreground 2013-07-26 21:41:11.000000000 +0200 -+++ nut-2.7.1/server/upsd.c 2014-02-27 11:39:58.153784537 +0100 -@@ -827,6 +827,7 @@ static void help(const char *progname) - printf(" - reload: reread configuration files\n"); - printf(" - stop: stop process and exit\n"); - printf(" -D raise debugging level\n"); -+ printf(" -F run in foreground, do not daemonize\n"); - printf(" -h display this help\n"); - printf(" -r chroots to \n"); - printf(" -q raise log level threshold\n"); -@@ -890,7 +891,7 @@ void check_perms(const char *fn) - - int main(int argc, char **argv) - { -- int i, cmd = 0; -+ int i, cmd = 0, foreground = 0; - char *chroot_path = NULL; - const char *user = RUN_AS_USER; - struct passwd *new_uid = NULL; -@@ -906,7 +907,7 @@ int main(int argc, char **argv) - - printf("Network UPS Tools %s %s\n", progname, UPS_VERSION); - -- while ((i = getopt(argc, argv, "+h46p:qr:i:fu:Vc:D")) != -1) { -+ while ((i = getopt(argc, argv, "+hF46p:qr:i:fu:Vc:D")) != -1) { - switch (i) { - case 'h': - help(progname); -@@ -944,6 +945,10 @@ int main(int argc, char **argv) - nut_debug_level++; - break; - -+ case 'F': -+ foreground = 1; -+ break; -+ - case '4': - opt_af = AF_INET; - break; -@@ -1031,7 +1036,7 @@ int main(int argc, char **argv) - /* handle upsd.users */ - user_load(); - -- if (!nut_debug_level) { -+ if (!nut_debug_level && !foreground) { - background(); - writepid(pidfn); - } else { diff --git a/nut-2.6.5-quickfix.patch b/nut-2.6.5-quickfix.patch deleted file mode 100644 index aa11fe6..0000000 --- a/nut-2.6.5-quickfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up nut-2.7.3/configure.ac.quickfix nut-2.7.3/configure.ac ---- nut-2.7.3/configure.ac.quickfix 2015-04-23 12:05:21.219228670 +0200 -+++ nut-2.7.3/configure.ac 2015-04-23 12:05:21.230228646 +0200 -@@ -1065,7 +1065,7 @@ dnl Override installation directory, wit - dnl prefix. This is needed for 'distcheck*' targets, otherwise - dnl files will try to get intalled to the actual system directories - if test -n "${systemdsystemunitdir}"; then -- systemdsystemshutdowndir="${libdir}/systemd/system-shutdown" -+ systemdsystemshutdowndir="/lib/systemd/system-shutdown" - AC_MSG_RESULT(using ${systemdsystemunitdir}) - else - AC_MSG_RESULT(no) diff --git a/nut-2.7.4-cloexec.patch b/nut-2.7.4-cloexec.patch deleted file mode 100644 index 1061e17..0000000 --- a/nut-2.7.4-cloexec.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- nut-2.7.4/common/parseconf.c.cloexec 2018-12-07 15:56:22.989381441 -0800 -+++ nut-2.7.4/common/parseconf.c 2018-12-07 16:48:33.912337591 -0800 -@@ -83,6 +83,7 @@ - #include - #include - #include -+#include - - #include "parseconf.h" - -@@ -443,6 +444,9 @@ - return 0; - } - -+ /* prevent fd leaking to child processes */ -+ fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC); -+ - return 1; /* OK */ - } - ---- nut-2.7.4/clients/upsmon.c.cloexec 2018-12-07 16:22:42.185376803 -0800 -+++ nut-2.7.4/clients/upsmon.c 2018-12-07 17:18:44.662093479 -0800 -@@ -24,6 +24,8 @@ - #include - #include - #include -+#include -+#include - - #include "upsclient.h" - #include "upsmon.h" -@@ -1432,6 +1434,9 @@ - /* we're definitely connected now */ - setflag(&ups->status, ST_CONNECTED); - -+ /* prevent connection leaking to NOTIFYCMD */ -+ fcntl(upscli_fd(&ups->conn), F_SETFD, FD_CLOEXEC); -+ - /* now try to authenticate to upsd */ - - ret = do_upsd_auth(ups); -@@ -1715,6 +1720,9 @@ - } - - close(pipefd[0]); -+ -+ /* prevent pipe leaking to NOTIFYCMD */ -+ fcntl(pipefd[1], F_SETFD, FD_CLOEXEC); - } - - static void delete_ups(utype_t *target) ---- nut-2.7.4/clients/upssched.c.cloexec 2018-12-07 17:09:13.081914570 -0800 -+++ nut-2.7.4/clients/upssched.c 2018-12-07 18:28:54.380512191 -0800 -@@ -46,6 +46,8 @@ - #include - #include - #include -+#include -+#include - - #include "upssched.h" - #include "timehead.h" -@@ -297,6 +299,9 @@ - if (ret < 0) - fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG); - -+ /* don't leak socket to CMDSCRIPT */ -+ fcntl(fd, F_SETFD, FD_CLOEXEC); -+ - return fd; - } - -@@ -370,6 +375,9 @@ - return; - } - -+ /* don't leak connection to CMDSCRIPT */ -+ fcntl(acc, F_SETFD, FD_CLOEXEC); -+ - /* enable nonblocking I/O */ - - ret = fcntl(acc, F_GETFL, 0); diff --git a/nut-2.7.4-nutscanner-FTBFS.patch b/nut-2.7.4-nutscanner-FTBFS.patch deleted file mode 100644 index fcb4f37..0000000 --- a/nut-2.7.4-nutscanner-FTBFS.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -urNp a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am ---- a/tools/nut-scanner/Makefile.am 2020-09-02 10:16:27.304816091 +0200 -+++ b/tools/nut-scanner/Makefile.am 2020-09-02 10:17:58.119811844 +0200 -@@ -14,14 +14,14 @@ libnutscan_la_SOURCES = scan_nut.c scan_ - scan_avahi.c scan_eaton_serial.c nutscan-serial.c \ - ../../drivers/serial.c \ - ../../drivers/bcmxcp_ser.c \ -- ../../common/common.c -+ ../../common/common.c ../../common/str.c - libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) - libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0 - libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL_CFLAGS) -I$(top_srcdir)/drivers - - nut_scanner_SOURCES = nut-scanner.c - nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include --nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la -+nut_scanner_LDADD = libnutscan.la - - if WITH_SSL - libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) diff --git a/nut-2.7.4-scratchdes.patch b/nut-2.7.4-scratchdes.patch deleted file mode 100644 index eb793d2..0000000 --- a/nut-2.7.4-scratchdes.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up nut-2.7.4/drivers/snmp-ups.c.scratchdes nut-2.7.4/drivers/snmp-ups.c ---- nut-2.7.4/drivers/snmp-ups.c.scratchdes 2021-06-08 13:56:32.608702337 +0200 -+++ nut-2.7.4/drivers/snmp-ups.c 2021-06-08 13:56:32.622702201 +0200 -@@ -471,11 +471,7 @@ void nut_snmp_init(const char *type, con - - privProtocol = testvar(SU_VAR_PRIVPROT) ? getval(SU_VAR_PRIVPROT) : "DES"; - -- if (strcmp(privProtocol, "DES") == 0) { -- g_snmp_sess.securityPrivProto = usmDESPrivProtocol; -- g_snmp_sess.securityPrivProtoLen = sizeof(usmDESPrivProtocol)/sizeof(oid); -- } -- else if (strcmp(privProtocol, "AES") == 0) { -+ if (strcmp(privProtocol, "AES") == 0) { - g_snmp_sess.securityPrivProto = usmAESPrivProtocol; - g_snmp_sess.securityPrivProtoLen = sizeof(usmAESPrivProtocol)/sizeof(oid); - } diff --git a/nut-client.tmpfiles b/nut-client.tmpfiles deleted file mode 100644 index df35b88..0000000 --- a/nut-client.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -D /run/nut 0770 root nut - diff --git a/nut.spec b/nut.spec index 11ffab6..eaad9cf 100644 --- a/nut.spec +++ b/nut.spec @@ -14,24 +14,16 @@ Summary: Network UPS Tools Name: nut Version: 2.8.0 -Release: 13%{?dist} +Release: 14%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz Source4: libs.sh -# Upstream support for OpenSSL-1.1.0, TLS > 1.0 -Patch0: https://patch-diff.githubusercontent.com/raw/networkupstools/nut/pull/504.patch -Patch1: nut-2.6.3-tmpfiles.patch Patch2: nut-2.8.0-piddir-owner.patch #quick fix. TODO: fix it properly -Patch5: nut-2.6.5-dlfix.patch -Patch7: nut-2.6.5-foreground.patch Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -Patch10: nut-2.7.4-cloexec.patch -Patch11: nut-2.7.4-nutscanner-FTBFS.patch -Patch12: nut-2.7.4-scratchdes.patch Patch13: nut-c99-c_attribute.patch Patch14: nut-c99-ax_c_printf_null.patch Patch15: nut-c99-strdup.patch @@ -87,10 +79,10 @@ ExcludeArch: s390 s390x %global restart_flag %{piddir}/%{name}-restart-after-rpm-install %description -These programs are part of a developing project to monitor the assortment -of UPSes that are found out there in the field. Many models have serial +These programs are part of a developing project to monitor the assortment +of UPSes that are found out there in the field. Many models have serial ports of some kind that allow some form of state checking. This -capability has been harnessed where possible to allow for safe shutdowns, +capability has been harnessed where possible to allow for safe shutdowns, live status tracking on web pages, and more. %package client @@ -136,16 +128,9 @@ necessary to develop NUT client applications. %prep %setup -q -#patch0 -p1 -b .openssl -%patch -P1 -p1 -b .tmpfiles %patch -P2 -p1 -b .piddir-owner -#patch5 -p1 -b .dlfix -#%patch7 -p1 -b .foreground %patch -P8 -p1 -b .unreachable %patch -P9 -p1 -b .rmpidf -#%patch10 -p1 -b .cloexec -#%patch11 -p1 -b .nutscanner-FTBFS -#%patch12 -p1 -b .scratchdes %patch -P13 -p1 %patch -P14 -p1 %patch -P15 -p1 @@ -217,7 +202,7 @@ rm -rf docs/man rm -rf %{buildroot}%{_datadir}/nut/solaris-init find docs/ -name 'Makefile*' -delete -pushd conf; +pushd conf; %make_install for file in %{buildroot}%{_sysconfdir}/ups/*.sample do @@ -237,7 +222,7 @@ do mv -f $fe.new $fe done -# install PyNUT +# install PyNUT install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python3_sitelib}/PyNUT.py # install nut-monitor %if %{with python2} @@ -250,6 +235,10 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications scripts/python/a ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor %endif +# Setup permissions for pid file +touch %{buildroot}/%{piddir}/upsmon.pid +chmod 0644 %{buildroot}/%{piddir}/upsmon.pid + %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : @@ -265,15 +254,13 @@ fi %post -/sbin/ldconfig -%systemd_post nut-driver.target nut.target +%systemd_post nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut-server.service nut.target %preun -%systemd_preun nut-driver.target nut.target +%systemd_preun nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut-server.service nut.target -%postun -/sbin/ldconfig -%systemd_postun_with_restart nut-driver.target nut.target +%postun +%systemd_postun_with_restart nut-driver.target nut-server.service %pre client /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ @@ -286,34 +273,30 @@ fi /usr/sbin/usermod -G dialout,tty %{name} %post client -/sbin/ldconfig %systemd_post nut-monitor.service %preun client %systemd_preun nut-monitor.service %postun client -/sbin/ldconfig %systemd_postun_with_restart nut-monitor.service %posttrans # phase 2: start upsmon again -if [ -e %restart_flag ]; then - /bin/systemctl restart nut-monitor.service >/dev/null 2>&1 || : - rm -f %restart_flag +if [ -e %restart_flag ]; then + /bin/systemctl restart nut-monitor.service >/dev/null 2>&1 || : + rm -f %restart_flag else # maybe we did not stop it - if we reinstalled just nut-client - /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : -fi + /bin/systemctl try-restart nut-monitor.service >/dev/null 2>&1 || : +fi %files %license COPYING LICENSE-GPL2 LICENSE-GPL3 %doc ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS -%config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users -%{_tmpfilesdir}/nut-common.conf %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules %{modeldir}/* @@ -331,7 +314,6 @@ fi %{_datadir}/augeas/lenses/dist/nut* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list -%{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/ups.conf.5.gz %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz @@ -416,7 +398,8 @@ fi %{_tmpfilesdir}/nut-common.conf %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups # upsmon.pid is written as root, so root needs access for now -%ghost %attr(770,root,nut) %{piddir} +%dir %attr(770,root,dialout) %{piddir} +%attr(644,nut,nut) %verify(not size mtime md5) /run/%{name}/upsmon.pid %{_bindir}/upsc %{_bindir}/upscmd %{_bindir}/upslog @@ -425,7 +408,6 @@ fi %{_sbindir}/upssched %{_bindir}/upssched-cmd %{_unitdir}/nut-monitor.service -%{_unitdir}/nut.target /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* %{_libdir}/libnutclient.so.* @@ -480,6 +462,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Oct 10 2023 Michal Hlavinka - 2.8.0-14 +- spec cleanup, based on PR#14 by Orion Poplawski + * Thu Jul 20 2023 Fedora Release Engineering - 2.8.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild @@ -502,7 +487,7 @@ fi - use piddir for specifying restart_flag location - use piddir for specifying configure --with-statepath/pidpath/altpidpath - add nut-2.8.0-piddir-owner.patch for upstream tmpfiles config creation to not append /nut and always use owner root -- update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name +- update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name - remove unused downstream tmpfiles source and code * Sun Nov 27 2022 Florian Weimer - 2.8.0-6 @@ -740,499 +725,3 @@ fi * Mon Jan 07 2013 Michal Hlavinka - 2.6.5-8 - do not traceback when ups is not reachable -* Fri Dec 21 2012 Adam Tkac - 2.6.5-7 -- rebuild against new libjpeg - -* Fri Sep 14 2012 Michal Hlavinka - 2.6.5-6 -- use new systemd macros (#857416) - -* Tue Sep 11 2012 Michal Hlavinka - 2.6.5-5 -- add support for foreground mode - -* Tue Sep 11 2012 Michal Hlavinka - 2.6.5-4 -- do not forget to restart nut-driver.service in postun - -* Thu Sep 06 2012 Michal Hlavinka - 2.6.5-3 -- do not depend on devel files (#838139) - -* Mon Sep 03 2012 Michal Hlavinka - 2.6.5-2 -- rebuilt with updated freeipmi - -* Fri Aug 10 2012 Michal Hlavinka - 2.6.5-1 -- nut updated to 2.6.5 - -* Fri Jul 20 2012 Fedora Release Engineering - 2.6.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Thu Jun 14 2012 Michal Hlavinka - 2.6.4-1 -- nut updated to 2.6.4 - -* Thu May 31 2012 Michal Hlavinka - 2.6.3-4 -- fix heap-based buffer overflow due improper processing of non-printable - characters in random network data (CVE-2012-2944) - -* Mon May 28 2012 Michal Hlavinka - 2.6.3-3 -- bump release nubmer to fix upgrade path - -* Mon Apr 16 2012 Michal Hlavinka - 2.6.3-2 -- do not forget to create /var/run/nut before starting service (#812825) - -* Thu Jan 05 2012 Michal Hlavinka - 2.6.3-1 -- nut updated to 2.6.3 - -* Tue Dec 06 2011 Adam Jackson - 2.6.2-2 -- Rebuild for new libpng - -* Fri Sep 16 2011 Michal Hlavinka - 2.6.2-1 -- nut updated to 2.6.2 - -* Tue Aug 16 2011 Michal Hlavinka - 2.6.1-4 -- update requirements of packages - -* Fri Jul 22 2011 Michal Hlavinka - 2.6.1-3 -- add initial support for systemd - -* Fri Jul 08 2011 Michal Hlavinka - 2.6.1-2 -- rebuilt for net-snmp update - -* Tue Jun 07 2011 Michal Hlavinka - 2.6.1-1 -- nut updated to 2.6.1 - -* Thu Apr 21 2011 Michal Hlavinka - 2.6.0-8 -- fix usb report reading (#698512) - -* Thu Apr 21 2011 Michal Hlavinka - 2.6.0-7 -- nut-hal should be obsoleted to prevent broken dependency in yum - -* Wed Apr 20 2011 Michal Hlavinka - 2.6.0-6 -- standard dependency adds udev, but we need it for %%pre script - -* Wed Apr 20 2011 Michal Hlavinka - 2.6.0-5 -- drop hal support, it was removed from rawhide - -* Mon Mar 28 2011 Michal Hlavinka - 2.6.0-4 -- fix list of ssl libraries in libupsclient.pc - -* Mon Feb 21 2011 Michal Hlavinka - 2.6.0-3 -- add nut-monitor (gui) to client sub-package - -* Tue Feb 08 2011 Fedora Release Engineering - 2.6.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Jan 17 2011 Michal Hlavinka - 2.6.0-1 -- nut updated to 2.6.0 -- fixed reading of reports bigger than 8 bytes - -* Fri Nov 26 2010 Michal Hlavinka - 2.4.3-9 -- use %%ghost for /var/run/nut (#656645) - -* Fri Nov 05 2010 Michal Hlavinka - 2.4.3-8 -- rebuild because libraries were updated - -* Wed Sep 29 2010 jkeating - 2.4.3-7 -- Rebuilt for gcc bug 634757 - -* Fri Sep 17 2010 Michal Hlavinka - 2.4.3-6 -- fix inconsitent name of upsdrvctl in init script (#633116) - -* Mon Jul 26 2010 Michal Hlavinka - 2.4.3-5 -- fix crash when port= is ommited (#616375) -- fix issue where nut fails to restart because it did not finished termination - yet and old instance blocks devices (#193058) - -* Wed Jul 07 2010 Michal Hlavinka - 2.4.3-4 -- follow licensing guideline update - -* Fri Mar 26 2010 Michal Hlavinka - 2.4.3-3 -- replace BUS with SUBSYSTEMS in udev rules (#573806) - -* Tue Mar 23 2010 Michal Hlavinka - 2.4.3-2 -- reduced size of buffer to maximum size supported by low-speed USB devices -- fixes #575334 - -* Wed Feb 24 2010 Michal Hlavinka - 2.4.3-1 -- cyberpower driver was replaced by the powerpanel driver -- general USB support has been vastly improved, including many bug - fixes, new features and devices -- the virtual driver has been renamed to 'clone' -- the UPower (previously known as DeviceKit-power) rules file is now - generated by NUT -- a lot of new devices supported - -* Thu Nov 05 2009 Michal Hlavinka - 2.4.1-9 -- spec cleanup - -* Fri Aug 21 2009 Tomas Mraz - 2.4.1-8 -- rebuilt with new openssl - -* Sat Jul 25 2009 Fedora Release Engineering - 2.4.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed May 20 2009 Michal Hlavinka - 2.4.1-6 -- fix coexistence with virtualbox (#488368) - -* Wed May 20 2009 Michal Hlavinka - 2.4.1-5 -- add requires for hal (#501687) - -* Fri Apr 17 2009 Michal Hlavinka - 2.4.1-4 -- change group even for existing nut user (#495999) - -* Tue Apr 14 2009 Michal Hlavinka - 2.4.1-3 -- udev changed group from uucp to dialout, follow the change (#494020) - -* Wed Feb 25 2009 Fedora Release Engineering - 2.4.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Tue Feb 17 2009 Michal Hlavinka 2.4.1-1 -- update to 2.4.1 -- added support for microdowell ups - -* Mon Feb 16 2009 Michal Hlavinka 2.4.0-1 -- update to new stable branch 2.4 - -* Sat Jan 17 2009 Tomas Mraz 2.2.2-6 -- rebuild with new openssl - -* Thu Dec 18 2008 Michal Hlavinka 2.2.2-5 -- remove rpath, fix libtool - -* Wed Dec 17 2008 Michal Hlavinka 2.2.2-4 -- fix #476850 - tripplite_usb driver segfaults when UPS on battery - -* Mon Sep 15 2008 Tomas Smetana 2.2.2-3 -- fix #461374 - add missing udev rules - -* Mon Aug 25 2008 Tomas Smetana 2.2.2-2 -- fix requirements in spec file -- build a separate hal package - -* Mon May 12 2008 Tomas Smetana 2.2.2-1 -- new upstream version - -* Tue Feb 12 2008 Tomas Smetana 2.2.1-3 -- fix compilation error with new glibc headers - -* Tue Feb 12 2008 Tomas Smetana 2.2.1-2 -- rebuild (gcc-4.3) - -* Wed Jan 09 2008 Tomas Smetana 2.2.1-1 -- new upstream version - -* Wed Dec 05 2007 Tomas Smetana 2.2.0-6.2 -- rebuild - -* Thu Nov 29 2007 Tomas Smetana 2.2.0-6.1 -- init script update, fix a typo - -* Wed Nov 28 2007 Tomas Smetana 2.2.0-6 -- fix forgotten bug in init script -- do not hardcode the uucp group in udev patch - -* Tue Nov 27 2007 Tomas Smetana 2.2.0-5 -- fix udev rules and hal information files -- fix init script - -* Wed Sep 19 2007 Tomas Smetana 2.2.0-4 -- fix manpages encodings -- run ldconfig after client (un)install -- fix HAL support - -* Thu Sep 06 2007 Tomas Smetana 2.2.0-3 -- fix wrong libssl flags in devel, fix devel package dependencies - -* Wed Aug 15 2007 Tomas Smetana 2.2.0-2 -- fix #249028 - usb udev rules -- update initscript and sysconfig file -- fix calls to open() for compatibility with the new glibc - -* Fri Jul 13 2007 Tomas Smetana 2.2.0-1.1 -- rebuild - -* Fri Jul 13 2007 Tomas Smetana 2.2.0-1 -- new upstream version (Resolves: #248074) -- initscripts update -- spec file cleanup - -* Mon May 07 2007 Arnaud Quette 2.1.0-1 -- update to 2.1.0 development tree -- HAL, ... - -* Mon Mar 26 2007 Than Ngo 2.0.5-3 -- cleanup - -* Tue Jan 23 2007 Karsten Hopp 2.0.5-2 -- rename fatal to fatal_with_errno in ipv6 patch -- fix filelist - -* Tue Jan 23 2007 Karsten Hopp 2.0.5-1 -- update to 2.0.5 - -* Wed Nov 29 2006 Karsten Hopp 2.0.4-2 -- rebuild with new net-snmp-libs -- disable nut-2.0.1-bad.patch, not required - -* Tue Nov 21 2006 Than Ngo - 2.0.4-1 -- add IPv6 support, thanks to Dan KopeÄek (#198394) - -* Wed Jul 12 2006 Jesse Keating - 2.0.3-2.1 -- rebuild - -* Tue May 16 2006 Than Ngo 2.0.3-2 -- fix #191914, BR fontconfig-devel for cgi - -* Mon Apr 24 2006 Than Ngo 2.0.3-1 -- update to 2.0.3 -- drop nut-2.0.2-buffer.patch, it's included in new upstream -- add udev rule #189674, #187105 - -* Fri Feb 10 2006 Jesse Keating - 2.0.2-6.2 -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Jesse Keating - 2.0.2-6.1 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Tue Jan 03 2006 Radek Vokal 2.0.2-6 -- rebuilt against new libnetsnmp - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Wed Nov 23 2005 Than Ngo 2.0.2-5 -- fix for modular X - -* Wed Nov 09 2005 Than Ngo 2.0.2-4 -- rebuilt - -* Mon Nov 07 2005 Than Ngo 2.0.2-3 -- rebuilt - -* Thu Nov 03 2005 Than Ngo 2.0.2-2 -- rebuilt against new libnetsnmp - -* Wed Jul 20 2005 Than Ngo 2.0.2-1 -- fix compiler warnings #156027 -- fix pid issue #159450 -- fix wrong ownership and permissions #159449, #141123 -- update to 2.0.2 - -* Thu Mar 10 2005 Than Ngo 2.0.1-1 -- 2.0.1 -- fix uninit local variable, #131773 - -* Wed Dec 08 2004 Than Ngo 2.0.0-7 -- don't requires libusb-devel on s390/s390x -- add %%{release} in buildroot - -* Thu Nov 25 2004 Miloslav Trmac - 2.0.0-6 -- Convert newhidups.8 to UTF-8 - -* Tue Oct 05 2004 Than Ngo 2.0.0-5 -- more buildrequires -- don't build on s390/s390x - -* Thu Aug 26 2004 Nalin Dahyabhai 2.0.0-4 -- fix syntax error in -client postun scriptlet (#131040) - -* Tue Jun 15 2004 Elliot Lee -- rebuilt - -* Mon May 10 2004 Than Ngo 2.0.0-2 -- fixed permission problem, bug #122867 - -* Fri Apr 02 2004 Than Ngo 2.0.0-1 -- 2.0.0 - -* Sat Feb 14 2004 Than Ngo 1.4.1-3 -- add some missing drivers - -* Fri Feb 13 2004 Elliot Lee -- rebuilt - -* Wed Feb 11 2004 Than Ngo 1.4.1-1 -- 1.4.1 -- fixed permission problem (bug #115290) - -* Wed Sep 24 2003 Mike McLean 1.4.0-3 -- fixed 'nut' user problem with nut-cgi (bug#104872) - -* Mon Sep 15 2003 Than Ngo 1.4.0-2 -- added missing hidups driver (bug #104412) - -* Tue Sep 09 2003 Than Ngo 1.4.0-1 -- 1.4.0 -- fixed permission problem (bug #103023) -- fixed rpm file list (bug #90848) -- added support multiple drivers, thanks to Gilbert E. Detillieux (bug #79465) - -* Thu Jun 26 2003 Than Ngo 1.2.2-3 -- Add variable to ups sysconfig file for upsd (bug #97900) - -* Wed Jun 04 2003 Elliot Lee -- rebuilt - -* Wed May 7 2003 Than Ngo 1.2.2-1 -- 1.2.2 - -* Tue May 06 2003 Phil Knirsch 1.2.0-7 -- Bumped release and rebuilt because of new gd version. - -* Thu Feb 13 2003 Than Ngo 1.2.0-6 -- build with correct userid #84199 -- fix directory permission - -* Tue Feb 11 2003 Than Ngo 1.2.0-5 -- add user nut, bug #81500 -- fix permission issue, bug #81524, #83997 -- own /etc/ups, bug #73959 - -* Wed Jan 22 2003 Tim Powers -- rebuilt - -* Wed Jan 8 2003 Thomas Woerner 1.2.0-3 -- added html templates for cgi scripts (#78532) -- added hidups driver (#80334) - -* Wed Dec 18 2002 Dan Walsh 1.2.0-2 -- Fix service description - -* Wed Nov 6 2002 han Ngo 1.2.0-1 -- update to 1.2.0 - -* Mon Nov 4 2002 Than Ngo 1.00-1 -- update to 1.00 - -* Wed Jul 31 2002 Than Ngo 0.45.4-5 -- Fixed wrong CMDSCRIPT (bug #69817) - -* Fri Jun 21 2002 Tim Powers -- automated rebuild - -* Sun Jun 02 2002 Than Ngo 0.45.4-3 -- fix forced shutdown (bug #65824, #60516) -- enable hidups driver -- add missing manages (bug #65188) - -* Thu May 23 2002 Tim Powers -- automated rebuild - -* Tue Feb 26 2002 Than Ngo 0.45.4-1 -- update to 0.45.4 - -* Wed Jan 09 2002 Tim Powers -- automated rebuild - -* Fri Dec 14 2001 Than Ngo 0.45.3-1 -- update to 0.45.2 -- fix bug #57417 - -* Tue Nov 27 2001 Than Ngo 0.45.2-1 -- update to 0.45.2 -- clean up some patch files for 0.45.2 - -* Tue Jul 24 2001 Than Ngo 0.45.0-3 -- fix build dependencies (bug #49858) - -* Fri Jul 6 2001 Than Ngo 0.45.0-2 -- rebuild - -* Wed Jun 13 2001 Than Ngo -- update to 0.45.0 -- add some patches from alane@geeksrus.net (bug #44361, #44363) - -* Sun Apr 22 2001 Than Ngo -- add all available UPS drivers (Bug #36937) - -* Fri Apr 13 2001 Than Ngo -- update to 0.44.3 (Bug #35255) - -* Fri Feb 9 2001 Than Ngo -- fixed typo (Bug #26535) - -* Tue Feb 6 2001 Trond Eivind Glomsrd -- Fix some of the i18n -- make it exit cleanly if not configured - -* Fri Jan 26 2001 Than Ngo -- initscript internationalisation - -* Thu Jan 11 2001 Than Ngo -- fixed init script error (bug #23525) - -* Sat Oct 21 2000 Than Ngo -- update to 0.44.1 - -* Tue Aug 01 2000 Than Ngo -- rebuilt with Michael changes - -* Mon Jul 31 2000 Michael Stefaniuc -- changed /etc/sysconfig/ups to adress the changes in 0.44.0 -- moved /etc/sysconfig/ups to the server package -- changed the initscript -- small config file patch - -* Fri Jul 28 2000 Than Ngo -- fixed initscripts so that condrestart doesn't return 1 when the test fails - -* Mon Jul 24 2000 Than Ngo -- nut CGIs is disable as default (Bug #14282) - -* Tue Jul 18 2000 Than Ngo -- update to 0.44.0 -- inits back to rc.d/init.d, using service to fire them up - -* Wed Jul 12 2000 Than Ngo -- fix initscript and specfile, it should work with 6.x and 7.x -- add --with-statepath and --sysconfdir to %%configure (thanks Michael) - -* Sat Jul 08 2000 Than Ngo -- add Prereq: /etc/init.d - -* Tue Jun 27 2000 Than Ngo -- don't prereq, only require initscripts - -* Mon Jun 26 2000 Than Ngo -- /etc/rc.d/init.d -> /etc/init.d -- prereq initscripts >= 5.20 - -* Fri Jun 16 2000 Bill Nottingham -- don't run by default - -* Mon Jun 12 2000 Preston Brown -- adopted for Winston. Use our new path macros. -- change nocgi pkg to a cgi pkg (inclusive rather than exclusive). -- new init script - -* Sat May 06 2000 (0.43.2-1) -- Updated Package to new release - -* Thu Jan 20 2000 (0.42.2-1) -- Updated package to new release -- Dropped bestups patch since that is fixed in 0.42.2 - -* Sat Dec 18 1999 (0.42.1-4) -- Package now uses chkconfig - -* Sat Dec 18 1999 (0.42.1-3) -- applied an improved patch to deal with the - bestups string length issue. - -* Sat Dec 11 1999 (0.42.1-1) -- fixed string length in bestups.c line 279. -- upgraded package to 0.42.1 from 0.42.0 - -* Mon Dec 6 1999 (0.42.0-8) -- added requirement of nut-client for nut. - -* Mon Dec 6 1999 (0.42.0-7) -- removed overlapping files between the nut and nut-client rpms - -* Tue Nov 23 1999 (0.42.0-6) -- stop ups before uninstalling - -* Tue Nov 23 1999 (0.42.0-5) -- build against gd 1.6.3 - -* Wed Nov 03 1999 (0.42.0-4) -- Initial build of nut (well almost). -- Removed chmod from the make file so that the package - does not have to be built as root..... diff --git a/ups.init b/ups.init deleted file mode 100644 index fab3c92..0000000 --- a/ups.init +++ /dev/null @@ -1,147 +0,0 @@ -#! /bin/bash -# -# ups: Starts the Network UPS Tools -# -# chkconfig: - 26 74 -# description: Network UPS Tools is a collection of programs which provide a common \ -# interface for monitoring and administering UPS hardware. -# processname: upsd -# config: /etc/ups/ -# config: /etc/sysconfig/ups -# -### BEGIN INIT INFO -# Provides: ups -# Required-Start: $syslog $network $named -# Required-Stop: $local_fs -# Default-Stop: 0 1 6 -# Short-Description: Starts the Network UPS tools -# Description: Network UPS Tools is a collection of programs which provide a common \ -# interface for monitoring and administering UPS hardware. -### END INIT INFO - -# Source function library. -if [ -f /etc/init.d/functions ]; then - . /etc/init.d/functions -elif [ -f /etc/rc.d/init.d/functions ]; then - . /etc/rc.d/init.d/functions -else - exit 0 -fi - -# Get config. -if [ -f /etc/sysconfig/ups ]; then - . /etc/sysconfig/ups -else - SERVER="no" -fi - -start() { - if [ "$SERVER" = "yes" ]; then - echo -n $"Starting UPS driver controller: " - daemon /sbin/upsdrvctl start > /dev/null 2>&1 && success || failure - RETVAL=$? - echo - - prog="upsd" - echo -n $"Starting $prog: " - daemon /usr/sbin/upsd $UPSD_OPTIONS > /dev/null 2>&1 && success || failure - if [ "$RETVAL" = 0 ]; then - RETVAL=$? - fi - echo - - echo -n $"Starting UPS monitor (master): " - daemon --pidfile /var/run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure - if [ "$RETVAL" = 0 ]; then - RETVAL=$? - fi - echo - else - echo -n $"Starting UPS monitor (slave): " - daemon --pidfile /var/run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure - echo - fi - - [ "$RETVAL" = 0 ] && touch /var/lock/subsys/ups -} - -stop() { - echo -n $"Stopping UPS monitor: " - killproc -p /var/run/nut/upsmon.pid upsmon - echo - - if [ "$SERVER" = "yes" ]; then - prog="upsd" - echo -n $"Stopping $prog: " - killproc upsd > /dev/null 2>&1 && success || failure - RETVAL=$? - echo - - echo -n $"Shutting down UPS driver controller: " - /sbin/upsdrvctl stop > /dev/null 2>&1 && success || failure - if [ "$RETVAL" = 0 ]; then - RETVAL=$? - fi - echo - fi - [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups -} - -restart() { - stop - waitmore=5 - while [ -n "$(ls /var/run/nut/)" -a $waitmore -ge 1 ] - do - sleep 1 - waitmore=$((waitmore-1)) - done - start -} - -reload() { - # FIXME: upsd and upsmon always return 0 - # => can't tell if reload was successful - if [ "$SERVER" = "yes" ]; then - action "Reloading upsd:" /usr/sbin/upsd -c reload - RETVAL=$? - fi - action "Reloading upsmon:" /usr/sbin/upsmon -c reload - if [ "$RETVAL" = 0 ]; then - RETVAL=$? - fi -} - -# See how we are called. -case "$1" in - start) - start ;; - - stop) - stop ;; - - restart) - restart ;; - - try-restart) - [ -f /var/lock/subsys/ups ] && restart || : - ;; - - reload) - reload ;; - - force-reload) - restart ;; - - status) - if [ "$SERVER" = "yes" ]; then - status upsd - fi - status upsmon - ;; - - *) - echo $"Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}" - RETVAL=3 -esac - -exit $RETVAL diff --git a/ups.sysconfig b/ups.sysconfig deleted file mode 100644 index 58f4f28..0000000 --- a/ups.sysconfig +++ /dev/null @@ -1,8 +0,0 @@ -# If the UPS is locally attached set it to "yes" -SERVER=yes -# Any options to pass to upsd -UPSD_OPTIONS= -# This *must* be the same as in /etc/ups/upsmon.conf -POWERDOWNFLAG=/etc/killpower -# -# [End] From 182c96a020196cd338ae4634b61dc2dcc803ba63 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 1 Nov 2023 22:31:34 +0100 Subject: [PATCH 118/142] updated to 2.8.1(2247337) --- .gitignore | 1 + libs.sh | 2 +- nut-2.6.5-rmpidf.patch | 39 ++++++++--------- nut-2.6.5-unreachable.patch | 40 ----------------- nut-2.8.0-piddir-owner.patch | 80 +++++++++++++++++----------------- nut-c99-ax_c_printf_null.patch | 60 ------------------------- nut-c99-c_attribute.patch | 17 -------- nut.spec | 35 +++++++++------ sources | 2 +- 9 files changed, 85 insertions(+), 191 deletions(-) delete mode 100644 nut-2.6.5-unreachable.patch delete mode 100644 nut-c99-ax_c_printf_null.patch delete mode 100644 nut-c99-c_attribute.patch diff --git a/.gitignore b/.gitignore index b466deb..152bf81 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ nut-2.4.3.tar.gz /nut-2.7.3.tar.gz /nut-2.7.4.tar.gz /nut-2.8.0.tar.gz +/nut-2.8.1.tar.gz diff --git a/libs.sh b/libs.sh index a6ca8a8..641d9ad 100644 --- a/libs.sh +++ b/libs.sh @@ -28,5 +28,5 @@ do echo "#define $( echo "$l" | tr '[a-z]-' '[A-Z]_')_PATH \"$rp\"" done -VINFO=$(sed -e '/version-info/!d' -e 's/#.*$//' -e 's/^.*-version-info//' -e 's/[[:space:]]//g' clients/Makefile) +VINFO=$(sed -e '/version-info/!d' -e 's/#.*$//' -e 's/^.*-version-info//' -e 's/[[:space:]]//g' -e 's/\\//g' clients/Makefile) echo "#define LIBUPSCLIENT_PATH \"libupsclient.so.$(( ${VINFO%%:*}-${VINFO##*:} ))\"" diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index 54c6e1e..7755382 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,18 +1,18 @@ -diff -up nut-2.8.0/clients/upsmon.c.rmpidf nut-2.8.0/clients/upsmon.c ---- nut-2.8.0/clients/upsmon.c.rmpidf 2022-04-23 13:56:06.000000000 +0200 -+++ nut-2.8.0/clients/upsmon.c 2022-05-09 17:22:34.329547283 +0200 -@@ -2314,6 +2314,7 @@ int main(int argc, char *argv[]) - +diff -up nut-2.8.1/clients/upsmon.c.rmpidf nut-2.8.1/clients/upsmon.c +--- nut-2.8.1/clients/upsmon.c.rmpidf 2023-11-01 10:10:03.039782733 +0100 ++++ nut-2.8.1/clients/upsmon.c 2023-11-01 10:14:48.824806113 +0100 +@@ -3059,6 +3059,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); + upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag); upsmon_cleanup(); + cleanpid(prog); exit(EXIT_SUCCESS); } -diff -up nut-2.8.0/common/common.c.rmpidf nut-2.8.0/common/common.c ---- nut-2.8.0/common/common.c.rmpidf 2022-05-09 17:22:34.329547283 +0200 -+++ nut-2.8.0/common/common.c 2022-05-09 17:26:48.671847245 +0200 -@@ -358,6 +358,20 @@ pid_t parsepid(const char *buf) +diff -up nut-2.8.1/common/common.c.rmpidf nut-2.8.1/common/common.c +--- nut-2.8.1/common/common.c.rmpidf 2023-10-30 00:02:33.000000000 +0100 ++++ nut-2.8.1/common/common.c 2023-11-01 10:10:03.040782744 +0100 +@@ -519,6 +519,20 @@ pid_t parsepid(const char *buf) return pid; } @@ -33,10 +33,10 @@ diff -up nut-2.8.0/common/common.c.rmpidf nut-2.8.0/common/common.c /* open pidfn, get the pid, then send it sig * returns negative codes for errors, or * zero for a successfully sent signal -diff -up nut-2.8.0/include/common.h.rmpidf nut-2.8.0/include/common.h ---- nut-2.8.0/include/common.h.rmpidf 2022-05-09 17:22:34.329547283 +0200 -+++ nut-2.8.0/include/common.h 2022-05-09 17:25:47.439740973 +0200 -@@ -103,6 +103,9 @@ void chroot_start(const char *path); +diff -up nut-2.8.1/include/common.h.rmpidf nut-2.8.1/include/common.h +--- nut-2.8.1/include/common.h.rmpidf 2023-10-24 10:45:21.000000000 +0200 ++++ nut-2.8.1/include/common.h 2023-11-01 10:10:03.040782744 +0100 +@@ -211,6 +211,9 @@ void chroot_start(const char *path); /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); @@ -46,14 +46,13 @@ diff -up nut-2.8.0/include/common.h.rmpidf nut-2.8.0/include/common.h /* parses string buffer into a pid_t if it passes * a few sanity checks; returns -1 on error */ pid_t parsepid(const char *buf); -diff -up nut-2.8.0/server/upsd.c.rmpidf nut-2.8.0/server/upsd.c ---- nut-2.8.0/server/upsd.c.rmpidf 2022-04-23 13:56:07.000000000 +0200 -+++ nut-2.8.0/server/upsd.c 2022-05-09 17:22:34.330547269 +0200 -@@ -1515,6 +1515,7 @@ int main(int argc, char **argv) - ssl_cleanup(); +diff -up nut-2.8.1/server/upsd.c.rmpidf nut-2.8.1/server/upsd.c +--- nut-2.8.1/server/upsd.c.rmpidf 2023-11-01 10:10:03.040782744 +0100 ++++ nut-2.8.1/server/upsd.c 2023-11-01 10:15:57.176529218 +0100 +@@ -2137,5 +2137,6 @@ int main(int argc, char **argv) + upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag); - upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); + ssl_cleanup(); + if (*pidfn) cleanpid(pidfn); return EXIT_SUCCESS; } - diff --git a/nut-2.6.5-unreachable.patch b/nut-2.6.5-unreachable.patch deleted file mode 100644 index 4166e84..0000000 --- a/nut-2.6.5-unreachable.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -up nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in ---- nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in.unreachable 2022-05-09 17:20:11.629621005 +0200 -+++ nut-2.8.0/scripts/python/app/NUT-Monitor-py3qt5.in 2022-05-09 17:20:52.674024537 +0200 -@@ -693,6 +693,11 @@ along with this program. If not, see "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF - # State file (e.g. upsd to driver) and pidfile location for NUT: --d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @STATEPATH@/nut +diff -up nut-2.8.1/configure.ac.piddir-owner nut-2.8.1/configure.ac +--- nut-2.8.1/configure.ac.piddir-owner 2023-11-01 09:39:24.267596406 +0100 ++++ nut-2.8.1/configure.ac 2023-11-01 10:00:35.425987029 +0100 +@@ -4451,7 +4451,7 @@ AS_IF([test -n "$systemdtmpfilesdir"], + + # See also: https://github.com/networkupstools/nut/wiki/Technicalities:-Work-with-PID-and-state-file-paths#pidpath-altpidpath-statepath + # State file (e.g. upsd to driver pipes) and PID file location for NUT: +-d @STATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @STATEPATH@ - EOF - AS_IF([test "$STATEPATH" != "$PIDPATH"], - [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF --d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @PIDPATH@/nut + # Default PIPEFN and LOCKFN locations per upssched.conf: + d @STATEPATH@/upssched 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - + X @STATEPATH@ +@@ -4461,7 +4461,7 @@ EOF + [*/run|*/tmp|*/shm], [], dnl Do not intrude into system paths; TODO: add more if appropriate for some Linux distro + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF + # Primarily used by upsmon and upslog, possibly running as root: +-d @PIDPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @PIDPATH@ - EOF]) - AS_IF([test -n "$ALTPIDPATH" && test "$STATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTPIDPATH"], - [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF --d @ALTPIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @ALTPIDPATH@/nut + X @PIDPATH@ + EOF + ])]) +@@ -4469,14 +4469,14 @@ EOF + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF + # Should be used as upsd and driver PID file location for NUT + # (if ALTPIDPATH differs from STATEPATH): +-d @ALTPIDPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +d @ALTPIDPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @ALTPIDPATH@ + X @ALTPIDPATH@ EOF]) + dnl Generally added to support some forks AS_IF([test -n "$ALTSTATEPATH" && test "$STATEPATH" != "$ALTSTATEPATH" && test "$ALTSTATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTSTATEPATH"], - [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common.tmpfiles.in << EOF --d @ALTSTATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @ALTSTATEPATH@/nut + [cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF + # Some NUT variants also maintain an ALTSTATEPATH: +-d @ALTSTATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +d @ALTSTATEPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @ALTSTATEPATH@ + X @ALTSTATEPATH@ EOF]) ]) - AC_MSG_RESULT([done]) -diff -up nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in ---- nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in.piddir-owner 2022-04-26 18:06:27.000000000 -0400 -+++ nut-2.8.0/scripts/systemd/nut-common.tmpfiles.in 2022-11-30 13:30:11.651106256 -0500 -@@ -1,5 +1,5 @@ - # State file (e.g. upsd to driver) and pidfile location for NUT: --d @STATEPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @STATEPATH@/nut --d @PIDPATH@/nut 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - --X @PIDPATH@/nut +diff -up nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in.piddir-owner nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in +--- nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in.piddir-owner 2023-10-31 23:05:03.000000000 +0100 ++++ nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in 2023-11-01 10:03:46.970845553 +0100 +@@ -5,7 +5,7 @@ + + # See also: https://github.com/networkupstools/nut/wiki/Technicalities:-Work-with-PID-and-state-file-paths#pidpath-altpidpath-statepath + # State file (e.g. upsd to driver pipes) and PID file location for NUT: +-d @STATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - +d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @STATEPATH@ -+d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - - -+X @PIDPATH@ + # Default PIPEFN and LOCKFN locations per upssched.conf: + d @STATEPATH@/upssched 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - - + X @STATEPATH@ diff --git a/nut-c99-ax_c_printf_null.patch b/nut-c99-ax_c_printf_null.patch deleted file mode 100644 index 9db80b0..0000000 --- a/nut-c99-ax_c_printf_null.patch +++ /dev/null @@ -1,60 +0,0 @@ -Fix several issues with the AX_C_PRINTF_STRING_NULL check: - -Adjust quoting in the AX_C_PRINTF_STRING_NULL definition. Switch to -strstr from strcasestr (a GNU extension, requires -D_GNU_SOURCE) -and include instead of . Add missing braces -and parentheses. Use double-quote for string literals. - -Submitted upstream: - -diff --git a/m4/ax_c_pragmas.m4 b/m4/ax_c_pragmas.m4 -index 53c1aebf8ea35a1e..14ecd596d3b36573 100644 ---- a/m4/ax_c_pragmas.m4 -+++ b/m4/ax_c_pragmas.m4 -@@ -943,32 +943,32 @@ if test -z "${nut_have_ax_c_printf_string_null_seen}"; then - dnl ### To be sure, bolt the language - AC_LANG_PUSH([C]) - -- AC_CACHE_CHECK([for practical support to pritnf("%s", NULL)], -+ AC_CACHE_CHECK([for practical support to printf("%s", NULL)], - [ax_cv__printf_string_null], - [AX_RUN_OR_LINK_IFELSE( - [AC_LANG_PROGRAM([dnl - #include --#include --], [dnl -+#include -+], [[ - char buf[128]; - char *s = NULL; - int res = snprintf(buf, sizeof(buf), "%s", s); - buf[sizeof(buf)-1] = '\0'; - if (res < 0) { -- printf(stderr, "FAILED to snprintf() a NULL string argument"); -- exit 1; -+ fprintf(stderr, "FAILED to snprintf() a NULL string argument\n"); -+ return 1; - } --if (buf[0] == '\0') -- printf(stderr, "RETURNED empty string from snprintf() with a NULL string argument"); -- exit 0; -+if (buf[0] == '\0') { -+ fprintf(stderr, "RETURNED empty string from snprintf() with a NULL string argument\n"); -+ return 0; - } --if (strcasestr(buf, 'null') == NULL) -- printf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'", buf); -- exit 0; -+if (strstr(buf, "null") == NULL) { -+ fprintf(stderr, "RETURNED some string from snprintf() with a NULL string argument: '%s'\n", buf); -+ return 0; - } --printf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'", buf); --exit 0; -- ])], -+fprintf(stderr, "SUCCESS: RETURNED a string that contains something like 'null' from snprintf() with a NULL string argument: '%s'\n", buf); -+return 0; -+ ]])], - [ax_cv__printf_string_null=yes], - [ax_cv__printf_string_null=no] - )] diff --git a/nut-c99-c_attribute.patch b/nut-c99-c_attribute.patch deleted file mode 100644 index aff6495..0000000 --- a/nut-c99-c_attribute.patch +++ /dev/null @@ -1,17 +0,0 @@ -Call the defined foo function instead of the undeclared func function. - -Submitted upstream: - -diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4 -index 0e952e7841c35b60..780bc2bb14ac5a78 100644 ---- a/m4/ax_c___attribute__.m4 -+++ b/m4/ax_c___attribute__.m4 -@@ -67,7 +67,7 @@ AC_DEFUN([AX_C___ATTRIBUTE__], [ - foo(__attribute__ ((unused)) int i) { - return; - } -- ]], [func(1);])], -+ ]], [foo(1);])], - [ax_cv___attribute__unused_arg=yes], - [ax_cv___attribute__unused_arg=no] - ) diff --git a/nut.spec b/nut.spec index eaad9cf..547cc10 100644 --- a/nut.spec +++ b/nut.spec @@ -13,8 +13,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.8.0 -Release: 14%{?dist} +Version: 2.8.1 +Release: 1%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -22,10 +22,7 @@ Source4: libs.sh Patch2: nut-2.8.0-piddir-owner.patch #quick fix. TODO: fix it properly -Patch8: nut-2.6.5-unreachable.patch Patch9: nut-2.6.5-rmpidf.patch -Patch13: nut-c99-c_attribute.patch -Patch14: nut-c99-ax_c_printf_null.patch Patch15: nut-c99-strdup.patch Requires(pre): shadow-utils @@ -49,6 +46,7 @@ BuildRequires: freetype-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gd-devel +BuildRequires: libgpiod-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtool @@ -129,10 +127,7 @@ necessary to develop NUT client applications. %prep %setup -q %patch -P2 -p1 -b .piddir-owner -%patch -P8 -p1 -b .unreachable %patch -P9 -p1 -b .rmpidf -%patch -P13 -p1 -%patch -P14 -p1 %patch -P15 -p1 sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop @@ -143,6 +138,9 @@ sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in # workaround for multilib conflicts - caused by patch changing modification time of scripts find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} +# fix python site packages check +sed -i 's|\(PYTHON3\?_SITE_PACKAGES=\)".*"|\1"%{python3_sitelib}"|' m4/nut_check_python.m4 + %build autoreconf -i export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" @@ -159,7 +157,9 @@ export LDFLAGS="-Wl,-z,now" %endif --without-wrap \ --with-cgi \ - --with-python3 \ + --with-python=%{python3} \ + --with-python3=%{python3} \ + --without-python2 \ --datadir=%{_datadir}/%{name} \ --with-user=%{name} \ --with-group=dialout \ @@ -177,6 +177,7 @@ export LDFLAGS="-Wl,-z,now" --libdir=%{_libdir} # --with-doc # does not work in 2.7.1 +# for rhbz#838139 check if still needed? sh %{SOURCE4} >>include/config.h #remove rpath @@ -194,7 +195,7 @@ mkdir -p %{buildroot}%{modeldir} \ %make_install -mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/nut-common.conf +#mv %{buildroot}%{_tmpfilesdir}/nut-common.tmpfiles %{buildroot}%{_tmpfilesdir}/nut-common.conf rm -rf %{buildroot}%{_prefix}/html rm -f %{buildroot}%{_libdir}/*.la @@ -293,7 +294,7 @@ fi %files %license COPYING LICENSE-GPL2 LICENSE-GPL3 -%doc ChangeLog AUTHORS MAINTAINERS README docs UPGRADING INSTALL NEWS +%doc ChangeLog AUTHORS MAINTAINERS README docs INSTALL NEWS %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users @@ -311,6 +312,7 @@ fi %{_bindir}/nut-scanner %{_libdir}/libnutscan.so.* %{_libexecdir}/nut-driver-enumerator.sh +%{_libexecdir}/sockdebug %{_datadir}/augeas/lenses/dist/nut* %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list @@ -319,7 +321,7 @@ fi %{_mandir}/man5/upsd.users.5.gz %{_mandir}/man8/adelsystem_cbi.8.gz - +%{_mandir}/man8/apc_modbus.8.gz %{_mandir}/man8/al175.8.gz %{_mandir}/man8/apcsmart.8.gz @@ -343,6 +345,7 @@ fi %{_mandir}/man8/gamatronic.8.gz %{_mandir}/man8/generic_modbus.8.gz %{_mandir}/man8/genericups.8.gz +%{_mandir}/man8/generic_gpio.8.gz %{_mandir}/man8/huawei-ups2000.8.gz %{_mandir}/man8/isbmex.8.gz %{_mandir}/man8/ivtscd.8.gz @@ -376,8 +379,10 @@ fi %{_mandir}/man8/riello_ser.8.gz %{_mandir}/man8/riello_usb.8.gz %{_mandir}/man8/safenet.8.gz +%{_mandir}/man8/sms_ser.8.gz %{_mandir}/man8/snmp-ups.8.gz %{_mandir}/man8/solis.8* +%{_mandir}/man8/sockdebug.8.gz %{_mandir}/man8/socomec_jbus.8.gz %{_mandir}/man8/tripplite.8.gz %{_mandir}/man8/tripplite_usb.8.gz @@ -395,7 +400,7 @@ fi %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/nut.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf -%{_tmpfilesdir}/nut-common.conf +%{_tmpfilesdir}/nut-common-tmpfiles.conf %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups # upsmon.pid is written as root, so root needs access for now %dir %attr(770,root,dialout) %{piddir} @@ -422,6 +427,7 @@ fi %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz %pycached %{python3_sitelib}/PyNUT.py +%pycached %{python3_sitelib}/test_nutclient.py %{_datadir}/nut %if %{with python2} %{_bindir}/nut-monitor @@ -462,6 +468,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Nov 01 2023 Michal Hlavinka - 2.8.1-1 +- updated to 2.8.1(2247337) + * Tue Oct 10 2023 Michal Hlavinka - 2.8.0-14 - spec cleanup, based on PR#14 by Orion Poplawski diff --git a/sources b/sources index 3574636..df09b8e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.0.tar.gz) = 3c413ae54088045a713eb80cf1bdda474f41bb3b67c7c0248aa7a0c4d441dce1ff42627a2735273d7e36892d1f2eeb895220cf28af63fec2fa0c7a267f82d577 +SHA512 (nut-2.8.1.tar.gz) = 32bff67749ef28cf57860bb5859d06b0a76daeada7f22eba59962f1695edb1f0f444d912fc4ae8c14ac3af5ab08b9cdb64d0ed65884fd38adc4bc8e470ce2a4c From f74346c47dee28cf818f8e0b7aa51de763c68b57 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 2 Nov 2023 11:55:02 +0100 Subject: [PATCH 119/142] libgpiod v2 is not compatible, disable for now --- nut.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 547cc10..158e680 100644 --- a/nut.spec +++ b/nut.spec @@ -46,7 +46,9 @@ BuildRequires: freetype-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gd-devel +%if 0%{?fedora} < 39 BuildRequires: libgpiod-devel +%endif BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtool @@ -142,6 +144,8 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} sed -i 's|\(PYTHON3\?_SITE_PACKAGES=\)".*"|\1"%{python3_sitelib}"|' m4/nut_check_python.m4 %build +#--without-gpio is not enough to stop it complaining about missing library +sed -i 's|with_gpio="[^"]*"|with_gpio="no"|g' configure.ac autoreconf -i export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" # prevent assignment of default value, it would break configure's tests @@ -169,6 +173,9 @@ export LDFLAGS="-Wl,-z,now" --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ +%if 0%{?fedora} < 39 + --without-gpio \ +%endif --with-systemdsystemunitdir=%{_unitdir} \ --with-systemdshutdowndir=/lib/systemd/system-shutdown \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ @@ -345,7 +352,9 @@ fi %{_mandir}/man8/gamatronic.8.gz %{_mandir}/man8/generic_modbus.8.gz %{_mandir}/man8/genericups.8.gz +%if 0%{?fedora} < 39 %{_mandir}/man8/generic_gpio.8.gz +%endif %{_mandir}/man8/huawei-ups2000.8.gz %{_mandir}/man8/isbmex.8.gz %{_mandir}/man8/ivtscd.8.gz @@ -469,7 +478,7 @@ fi %changelog * Wed Nov 01 2023 Michal Hlavinka - 2.8.1-1 -- updated to 2.8.1(2247337) +- updated to 2.8.1 (#2247337) * Tue Oct 10 2023 Michal Hlavinka - 2.8.0-14 - spec cleanup, based on PR#14 by Orion Poplawski From 0089d1127728a3c7310830c441db2a62e5b5e76e Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 30 Nov 2023 11:52:01 -0700 Subject: [PATCH 120/142] Re-add nut.target to nut-client (bz#2156504) --- nut.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index 158e680..14f79cb 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -281,10 +281,10 @@ fi /usr/sbin/usermod -G dialout,tty %{name} %post client -%systemd_post nut-monitor.service +%systemd_post nut-monitor.service nut.target %preun client -%systemd_preun nut-monitor.service +%systemd_preun nut-monitor.service nut.target %postun client %systemd_postun_with_restart nut-monitor.service @@ -422,6 +422,8 @@ fi %{_sbindir}/upssched %{_bindir}/upssched-cmd %{_unitdir}/nut-monitor.service +# nut-monitor.service also needs nut.target +%{_unitdir}/nut.target /lib/systemd/system-shutdown/nutshutdown %{_libdir}/libupsclient.so.* %{_libdir}/libnutclient.so.* @@ -477,6 +479,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Nov 30 2023 Orion Poplawski - 2.8.1-2 +- Re-add nut.target to nut-client (bz#2156504) + * Wed Nov 01 2023 Michal Hlavinka - 2.8.1-1 - updated to 2.8.1 (#2247337) From 9b811d068831d168b2d4b3e3a4743b08ac625905 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 6 Dec 2023 12:29:26 +0100 Subject: [PATCH 121/142] fix gpio check conditions --- nut.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 14f79cb..53018a6 100644 --- a/nut.spec +++ b/nut.spec @@ -144,8 +144,10 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} sed -i 's|\(PYTHON3\?_SITE_PACKAGES=\)".*"|\1"%{python3_sitelib}"|' m4/nut_check_python.m4 %build +%if 0%{?fedora} > 38 #--without-gpio is not enough to stop it complaining about missing library sed -i 's|with_gpio="[^"]*"|with_gpio="no"|g' configure.ac +%endif autoreconf -i export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" # prevent assignment of default value, it would break configure's tests @@ -173,7 +175,7 @@ export LDFLAGS="-Wl,-z,now" --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ -%if 0%{?fedora} < 39 +%if 0%{?fedora} > 38 --without-gpio \ %endif --with-systemdsystemunitdir=%{_unitdir} \ From 03a2bff29ba0f1d36b7d6b7bd36d32645457f31d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 10:02:08 +0000 Subject: [PATCH 122/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 53018a6..21983cf 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 2.8.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Nov 30 2023 Orion Poplawski - 2.8.1-2 - Re-add nut.target to nut-client (bz#2156504) From 17e960e14007eb3c6a4ce489719c5c9127cb7278 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 09:32:03 +0000 Subject: [PATCH 123/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 21983cf..eb5d704 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -481,6 +481,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 2.8.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 2.8.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From ada5bd73a723fa4a5e1c19a31ef83e73877f8793 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 3 Apr 2024 11:56:12 +0200 Subject: [PATCH 124/142] updated to 2.8.2(2272586) --- .gitignore | 1 + nut.spec | 13 +++++++++++-- sources | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 152bf81..61da205 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ nut-2.4.3.tar.gz /nut-2.7.4.tar.gz /nut-2.8.0.tar.gz /nut-2.8.1.tar.gz +/nut-2.8.2.tar.gz diff --git a/nut.spec b/nut.spec index eb5d704..8b68b23 100644 --- a/nut.spec +++ b/nut.spec @@ -13,8 +13,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.8.1 -Release: 4%{?dist} +Version: 2.8.2 +Release: 1%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -313,11 +313,15 @@ fi %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver-enumerator.path %{_unitdir}/nut-driver-enumerator.service +%{_unitdir}/nut-driver-enumerator-daemon-activator.path +%{_unitdir}/nut-driver-enumerator-daemon-activator.service +%{_unitdir}/nut-driver-enumerator-daemon.service %{_unitdir}/nut-driver@.service %{_unitdir}/nut-driver.target %{_unitdir}/nut-server.service %{_unitdir}/nut.target %{_sbindir}/upsd +%{_bindir}/nutconf %{_bindir}/nut-scanner %{_libdir}/libnutscan.so.* %{_libexecdir}/nut-driver-enumerator.sh @@ -329,6 +333,8 @@ fi %{_mandir}/man5/upsd.conf.5.gz %{_mandir}/man5/upsd.users.5.gz +%{_mandir}/man8/nutconf.8.gz + %{_mandir}/man8/adelsystem_cbi.8.gz %{_mandir}/man8/apc_modbus.8.gz @@ -481,6 +487,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Apr 03 2024 Michal Hlavinka - 2.8.2-1 +- updated to 2.8.2(2272586) + * Thu Jan 25 2024 Fedora Release Engineering - 2.8.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index df09b8e..474d28c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.1.tar.gz) = 32bff67749ef28cf57860bb5859d06b0a76daeada7f22eba59962f1695edb1f0f444d912fc4ae8c14ac3af5ab08b9cdb64d0ed65884fd38adc4bc8e470ce2a4c +SHA512 (nut-2.8.2.tar.gz) = b6f8f22318e4a4fcb8073a63132b1cb083952c665191b82a7d6765a61b859575a4b0c2ba84ed17cfb8c88d34179876d64520dd2f75f02fe8707b406da2c0821c From 59f9744317892c15b4612c3130c53e5da7b46cbd Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:33:13 +0200 Subject: [PATCH 125/142] Rebuilt for Python 3.13 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 8b68b23..0fc584b 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -487,6 +487,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Jun 07 2024 Python Maint - 2.8.2-2 +- Rebuilt for Python 3.13 + * Wed Apr 03 2024 Michal Hlavinka - 2.8.2-1 - updated to 2.8.2(2272586) From 810e8f234e416e1e588860ca355472832580a21d Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 3 Jul 2024 12:59:09 +0200 Subject: [PATCH 126/142] fix python FTBFS, uses git snapshot as of 20240703 with PR 2505 --- .gitignore | 1 + nut-2.6.5-rmpidf.patch | 34 +++++++++++++++++----------------- nut.spec | 16 +++++++++++----- sources | 2 +- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 61da205..56f7b98 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ nut-2.4.3.tar.gz /nut-2.8.0.tar.gz /nut-2.8.1.tar.gz /nut-2.8.2.tar.gz +/nut-2.8.2.1.tar.gz diff --git a/nut-2.6.5-rmpidf.patch b/nut-2.6.5-rmpidf.patch index 7755382..40365b8 100644 --- a/nut-2.6.5-rmpidf.patch +++ b/nut-2.6.5-rmpidf.patch @@ -1,18 +1,18 @@ -diff -up nut-2.8.1/clients/upsmon.c.rmpidf nut-2.8.1/clients/upsmon.c ---- nut-2.8.1/clients/upsmon.c.rmpidf 2023-11-01 10:10:03.039782733 +0100 -+++ nut-2.8.1/clients/upsmon.c 2023-11-01 10:14:48.824806113 +0100 -@@ -3059,6 +3059,7 @@ int main(int argc, char *argv[]) +diff -up nut-2.8.2.1/clients/upsmon.c.rmpidf nut-2.8.2.1/clients/upsmon.c +--- nut-2.8.2.1/clients/upsmon.c.rmpidf 2024-07-03 12:18:04.788135176 +0200 ++++ nut-2.8.2.1/clients/upsmon.c 2024-07-03 12:19:33.164964473 +0200 +@@ -3309,6 +3309,7 @@ int main(int argc, char *argv[]) upslogx(LOG_INFO, "Signal %d: exiting", exit_flag); upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag); upsmon_cleanup(); + cleanpid(prog); + upsdebugx(1, "Finally exiting due to signal %d", exit_flag); exit(EXIT_SUCCESS); - } -diff -up nut-2.8.1/common/common.c.rmpidf nut-2.8.1/common/common.c ---- nut-2.8.1/common/common.c.rmpidf 2023-10-30 00:02:33.000000000 +0100 -+++ nut-2.8.1/common/common.c 2023-11-01 10:10:03.040782744 +0100 -@@ -519,6 +519,20 @@ pid_t parsepid(const char *buf) +diff -up nut-2.8.2.1/common/common.c.rmpidf nut-2.8.2.1/common/common.c +--- nut-2.8.2.1/common/common.c.rmpidf 2024-07-03 12:14:56.000000000 +0200 ++++ nut-2.8.2.1/common/common.c 2024-07-03 12:18:04.788135176 +0200 +@@ -1338,6 +1338,20 @@ pid_t parsepid(const char *buf) return pid; } @@ -33,10 +33,10 @@ diff -up nut-2.8.1/common/common.c.rmpidf nut-2.8.1/common/common.c /* open pidfn, get the pid, then send it sig * returns negative codes for errors, or * zero for a successfully sent signal -diff -up nut-2.8.1/include/common.h.rmpidf nut-2.8.1/include/common.h ---- nut-2.8.1/include/common.h.rmpidf 2023-10-24 10:45:21.000000000 +0200 -+++ nut-2.8.1/include/common.h 2023-11-01 10:10:03.040782744 +0100 -@@ -211,6 +211,9 @@ void chroot_start(const char *path); +diff -up nut-2.8.2.1/include/common.h.rmpidf nut-2.8.2.1/include/common.h +--- nut-2.8.2.1/include/common.h.rmpidf 2024-07-03 12:14:56.000000000 +0200 ++++ nut-2.8.2.1/include/common.h 2024-07-03 12:18:04.788135176 +0200 +@@ -262,6 +262,9 @@ int checkprocname(pid_t pid, const char /* write a pid file - is a full pathname *or* just the program name */ void writepid(const char *name); @@ -46,10 +46,10 @@ diff -up nut-2.8.1/include/common.h.rmpidf nut-2.8.1/include/common.h /* parses string buffer into a pid_t if it passes * a few sanity checks; returns -1 on error */ pid_t parsepid(const char *buf); -diff -up nut-2.8.1/server/upsd.c.rmpidf nut-2.8.1/server/upsd.c ---- nut-2.8.1/server/upsd.c.rmpidf 2023-11-01 10:10:03.040782744 +0100 -+++ nut-2.8.1/server/upsd.c 2023-11-01 10:15:57.176529218 +0100 -@@ -2137,5 +2137,6 @@ int main(int argc, char **argv) +diff -up nut-2.8.2.1/server/upsd.c.rmpidf nut-2.8.2.1/server/upsd.c +--- nut-2.8.2.1/server/upsd.c.rmpidf 2024-07-03 12:14:56.000000000 +0200 ++++ nut-2.8.2.1/server/upsd.c 2024-07-03 12:18:04.789135186 +0200 +@@ -2304,5 +2304,6 @@ int main(int argc, char **argv) upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag); ssl_cleanup(); diff --git a/nut.spec b/nut.spec index 0fc584b..5e9b504 100644 --- a/nut.spec +++ b/nut.spec @@ -13,8 +13,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.8.2 -Release: 2%{?dist} +Version: 2.8.2.1 +Release: 0%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -128,9 +128,9 @@ necessary to develop NUT client applications. %prep %setup -q -%patch -P2 -p1 -b .piddir-owner -%patch -P9 -p1 -b .rmpidf -%patch -P15 -p1 +%patch -P 2 -p1 -b .piddir-owner +%patch -P 9 -p1 -b .rmpidf +%patch -P 15 -p1 sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in @@ -327,6 +327,7 @@ fi %{_libexecdir}/nut-driver-enumerator.sh %{_libexecdir}/sockdebug %{_datadir}/augeas/lenses/dist/nut* +%{_datadir}/augeas/lenses/dist/tests/test_nut.aug %{_datadir}/%{name}/cmdvartab %{_datadir}/%{name}/driver.list %{_mandir}/man5/ups.conf.5.gz @@ -351,6 +352,7 @@ fi %{_mandir}/man8/bestfortress.8.gz %{_mandir}/man8/bestups.8.gz %{_mandir}/man8/bestuferrups.8.gz +%{_mandir}/man8/bicker_ser.8.gz %{_mandir}/man8/blazer_ser.8.gz %{_mandir}/man8/blazer_usb.8.gz %{_mandir}/man8/clone.8.gz @@ -363,6 +365,7 @@ fi %if 0%{?fedora} < 39 %{_mandir}/man8/generic_gpio.8.gz %endif +%{_mandir}/man8/hwmon_ina219.8.gz %{_mandir}/man8/huawei-ups2000.8.gz %{_mandir}/man8/isbmex.8.gz %{_mandir}/man8/ivtscd.8.gz @@ -487,6 +490,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Jul 03 2024 Michal Hlavinka - 2.8.2.1-0.1.git20240703pr2505 +- fix python FTBFS, uses git snapshot as of 20240703 with PR 2505 + * Fri Jun 07 2024 Python Maint - 2.8.2-2 - Rebuilt for Python 3.13 diff --git a/sources b/sources index 474d28c..379e679 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.2.tar.gz) = b6f8f22318e4a4fcb8073a63132b1cb083952c665191b82a7d6765a61b859575a4b0c2ba84ed17cfb8c88d34179876d64520dd2f75f02fe8707b406da2c0821c +SHA512 (nut-2.8.2.1.tar.gz) = 62457781758be939919d1c9bbed4b2895d2c434c73ec6d36ab6120898f84a24131cf7796d320117c5f8780e63da1aa6966e59156466ff78f20267b0a4eed1652 From 02a191e84075841c913ce7a77d4cf5e5602681a1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 19:52:32 +0000 Subject: [PATCH 127/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 5e9b504..a59d7b0 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 0%{?dist}.1.git20240703pr2505 +Release: 1%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -490,6 +490,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 2.8.2.1-1.1.git20240703pr2505 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jul 03 2024 Michal Hlavinka - 2.8.2.1-0.1.git20240703pr2505 - fix python FTBFS, uses git snapshot as of 20240703 with PR 2505 From 3cb725a9a6c01ad316d99206f6b084a019020e2a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 15 Nov 2024 16:08:05 -0700 Subject: [PATCH 128/142] Add BR systemd-devel to enable systemd notification support --- nut.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index a59d7b0..16d14a0 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 1%{?dist}.1.git20240703pr2505 +Release: 2%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -68,6 +68,7 @@ BuildRequires: powerman-devel %endif BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros %ifnarch s390 s390x @@ -490,6 +491,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Nov 15 2024 Orion Poplawski - 2.8.2.1-2.1.git20240703pr2505 +- Add BR systemd-devel to enable systemd notification support + * Thu Jul 18 2024 Fedora Release Engineering - 2.8.2.1-1.1.git20240703pr2505 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From b278271309d8cf3d09befa772e3cb3fbbbabb9dc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 20:31:55 +0000 Subject: [PATCH 129/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 16d14a0..d3f0edc 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 2%{?dist}.1.git20240703pr2505 +Release: 3%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -491,6 +491,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 2.8.2.1-3.1.git20240703pr2505 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Nov 15 2024 Orion Poplawski - 2.8.2.1-2.1.git20240703pr2505 - Add BR systemd-devel to enable systemd notification support From 7d3c0ad65dd96dc0a6a0be8052c55a13bfcff8a3 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 29 Jan 2025 00:09:31 +0100 Subject: [PATCH 130/142] fix ftbfs, make it build with unified bin/sbin fix ftbfs, make it build with unified bin/sbin fix ftbfs, make it build with unified bin/sbin fix ftbfs, make it build with unified bin/sbin fix ftbfs, make it build with unified bin/sbin --- nut.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index d3f0edc..68cc7d3 100644 --- a/nut.spec +++ b/nut.spec @@ -7,14 +7,14 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /run/nut -%global modeldir /usr/sbin +%global modeldir %{_sbindir} # powerman is retired on Fedora, therefore disable it by default %bcond_with powerman Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 3%{?dist}.1.git20240703pr2505 +Release: 4%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -491,6 +491,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed Jan 29 2025 Michal Hlavinka - 2.8.2.1-4 +- fix ftbfs, make it build with unified bin/sbin + * Fri Jan 17 2025 Fedora Release Engineering - 2.8.2.1-3.1.git20240703pr2505 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From ce21c14155b825c63c8217d9446a4dea1ba681f3 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 31 Jan 2025 21:00:34 +0100 Subject: [PATCH 131/142] add back git snapshot part of release number --- nut.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nut.spec b/nut.spec index 68cc7d3..5aa094d 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 4%{?dist} +Release: 4%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -491,7 +491,7 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog -* Wed Jan 29 2025 Michal Hlavinka - 2.8.2.1-4 +* Wed Jan 29 2025 Michal Hlavinka - 2.8.2.1-4.1.git20240703pr2505 - fix ftbfs, make it build with unified bin/sbin * Fri Jan 17 2025 Fedora Release Engineering - 2.8.2.1-3.1.git20240703pr2505 From 91e5a19370127ef353d8f2f1a970253c2eee6085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 11 Feb 2025 15:53:26 +0100 Subject: [PATCH 132/142] Add sysusers.d config file to allow rpm to create users/groups automatically See https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers. -cgi requires -client, so it doesn't need it's copy of the file. setup Provides group(dialout) and group(tty), but let's add the Requires for clarity. --- nut.spec | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/nut.spec b/nut.spec index 5aa094d..2d04cd3 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.2.1 -Release: 4%{?dist}.1.git20240703pr2505 +Release: 5%{?dist}.1.git20240703pr2505 License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -25,11 +25,12 @@ Patch2: nut-2.8.0-piddir-owner.patch Patch9: nut-2.6.5-rmpidf.patch Patch15: nut-c99-strdup.patch -Requires(pre): shadow-utils Requires(post): coreutils systemd Requires(preun): systemd Requires(postun): coreutils systemd Recommends: nut-xml +Requires: group(dialout) +Requires: group(tty) BuildRequires: make BuildRequires: autoconf @@ -90,12 +91,12 @@ live status tracking on web pages, and more. Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd -Requires(pre): shadow-utils %if %{with python2} Requires: pygtk2, pygtk2-libglade #only for python and gui part %endif -#Requires: +Requires: group(dialout) +Requires: group(tty) %description client This package includes the client utilities that are required to monitor a @@ -105,7 +106,6 @@ attached to a different computer on the network. %package cgi Summary: CGI utilities for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} webserver -Requires(pre): shadow-utils %description cgi This package includes CGI programs for accessing UPS status via a web @@ -144,6 +144,13 @@ find . -mtime -1 -print0 | xargs -0 touch --reference %{SOURCE0} # fix python site packages check sed -i 's|\(PYTHON3\?_SITE_PACKAGES=\)".*"|\1"%{python3_sitelib}"|' m4/nut_check_python.m4 +# Create a sysusers.d config file +cat >nut.sysusers.conf < 38 #--without-gpio is not enough to stop it complaining about missing library @@ -250,11 +257,9 @@ ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor touch %{buildroot}/%{piddir}/upsmon.pid chmod 0644 %{buildroot}/%{piddir}/upsmon.pid -%pre -/usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ - -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout,tty %{name} +install -m0644 -D nut.sysusers.conf %{buildroot}%{_sysusersdir}/nut.conf +%pre # do not let upsmon run during upgrade rhbz#916472 # phase 1: stop upsmon before upsd changes if [ "$1" = "2" ]; then @@ -273,15 +278,7 @@ fi %postun %systemd_postun_with_restart nut-driver.target nut-server.service -%pre client -/usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ - -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout,tty %{name} -%pre cgi -/usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \ - -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : -/usr/sbin/usermod -G dialout,tty %{name} %post client %systemd_post nut-monitor.service nut.target @@ -414,6 +411,7 @@ fi %{_mandir}/man8/upsdrvctl.8.gz %{_mandir}/man8/upsdrvsvcctl.8.gz %{_mandir}/man8/usbhid-ups.8.gz +%{_sysusersdir}/nut.conf %files client %license COPYING LICENSE-GPL2 LICENSE-GPL3 @@ -457,6 +455,7 @@ fi %{_datadir}/pixmaps/nut-monitor.png %{_datadir}/applications/nut-monitor.desktop %endif +%{_sysusersdir}/nut.conf %files cgi %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf @@ -491,6 +490,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 2.8.2.1-5.1.git20240703pr2505 +- Add sysusers.d config file to allow rpm to create users/groups automatically + * Wed Jan 29 2025 Michal Hlavinka - 2.8.2.1-4.1.git20240703pr2505 - fix ftbfs, make it build with unified bin/sbin From 760ad72a05c80afc4eabe4e4191dde6bf16bb9c3 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 29 Apr 2025 16:46:04 +0200 Subject: [PATCH 133/142] updated to 2.8.3 (#2352734) --- .gitignore | 1 + nut.spec | 18 ++++++++++++++++-- sources | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 56f7b98..cae0d0a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ nut-2.4.3.tar.gz /nut-2.8.1.tar.gz /nut-2.8.2.tar.gz /nut-2.8.2.1.tar.gz +/nut-2.8.3.tar.gz diff --git a/nut.spec b/nut.spec index 2d04cd3..29c2656 100644 --- a/nut.spec +++ b/nut.spec @@ -13,8 +13,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.8.2.1 -Release: 5%{?dist}.1.git20240703pr2505 +Version: 2.8.3 +Release: 1%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -318,12 +318,18 @@ fi %{_unitdir}/nut-driver.target %{_unitdir}/nut-server.service %{_unitdir}/nut.target +%{_presetdir}/nut-systemd.preset +%{_unitdir}/enphase-monitor@.service +%{_unitdir}/nut-logger.service +%{_unitdir}/nut-udev-settle.service %{_sbindir}/upsd %{_bindir}/nutconf %{_bindir}/nut-scanner %{_libdir}/libnutscan.so.* +%{_libdir}/libnutconf.so.* %{_libexecdir}/nut-driver-enumerator.sh %{_libexecdir}/sockdebug +%{_libexecdir}/enphase-monitor %{_datadir}/augeas/lenses/dist/nut* %{_datadir}/augeas/lenses/dist/tests/test_nut.aug %{_datadir}/%{name}/cmdvartab @@ -354,6 +360,7 @@ fi %{_mandir}/man8/blazer_ser.8.gz %{_mandir}/man8/blazer_usb.8.gz %{_mandir}/man8/clone.8.gz +%{_mandir}/man8/clone-outlet.8.gz %{_mandir}/man8/dummy-ups.8.gz %{_mandir}/man8/everups.8.gz %{_mandir}/man8/etapro.8.gz @@ -369,12 +376,14 @@ fi %{_mandir}/man8/ivtscd.8.gz %{_mandir}/man8/liebert.8.gz %{_mandir}/man8/liebert-esp2.8.gz +%{_mandir}/man8/liebert-gxe.8.gz %{_mandir}/man8/masterguard.8.gz %{_mandir}/man8/metasys.8.gz %{_mandir}/man8/microdowell.8.gz %{_mandir}/man8/microsol-apc.8.gz %{_mandir}/man8/mge-utalk.8.gz %{_mandir}/man8/mge-shut.8.gz +%{_mandir}/man8/nhs_ser.8.gz %{_mandir}/man8/nutupsdrv.8.gz %{_mandir}/man8/nutdrv_atcl_usb.8.gz %{_mandir}/man8/nutdrv_siemens_sitop.8.gz @@ -483,13 +492,18 @@ fi %{_libdir}/libupsclient.so %{_libdir}/libnutclient.so %{_libdir}/libnutclientstub.so +%{_libdir}/libnutconf.so %{_libdir}/libnutscan.so %{_libdir}/pkgconfig/libupsclient.pc %{_libdir}/pkgconfig/libnutclient.pc +%{_libdir}/pkgconfig/libnutconf.pc %{_libdir}/pkgconfig/libnutclientstub.pc %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Apr 29 2025 Michal Hlavinka - 2.8.3-1 +- updated to 2.8.3 (#2352734) + * Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 2.8.2.1-5.1.git20240703pr2505 - Add sysusers.d config file to allow rpm to create users/groups automatically diff --git a/sources b/sources index 379e679..f63aad6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.2.1.tar.gz) = 62457781758be939919d1c9bbed4b2895d2c434c73ec6d36ab6120898f84a24131cf7796d320117c5f8780e63da1aa6966e59156466ff78f20267b0a4eed1652 +SHA512 (nut-2.8.3.tar.gz) = 0aeafad02ab323b02041a370c586dede91483cab57e0a9d1256a685716ca9f0d0f114df904ef472d48fa53ac1896690b7878828eb3b00934959c7aeaa63af99f From 9867e182417607deb337c2112a8f1c45f4e33179 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 29 Apr 2025 17:37:37 +0200 Subject: [PATCH 134/142] add needed buildrequire jq --- nut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nut.spec b/nut.spec index 29c2656..2945107 100644 --- a/nut.spec +++ b/nut.spec @@ -47,6 +47,7 @@ BuildRequires: freetype-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gd-devel +BuildRequires: jq %if 0%{?fedora} < 39 BuildRequires: libgpiod-devel %endif From 1f502ae93a12806f866df25d2c9860b1b790a656 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Wed, 21 May 2025 13:43:14 +0200 Subject: [PATCH 135/142] rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) --- nut-2.8.3-rhinoname.patch | 23 +++++++++++++++++++++++ nut.spec | 12 ++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 nut-2.8.3-rhinoname.patch diff --git a/nut-2.8.3-rhinoname.patch b/nut-2.8.3-rhinoname.patch new file mode 100644 index 0000000..5e978c0 --- /dev/null +++ b/nut-2.8.3-rhinoname.patch @@ -0,0 +1,23 @@ +diff -up nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am.rhinoname nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am +--- nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am.rhinoname 2025-05-21 13:16:02.566975097 +0200 ++++ nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am 2025-05-21 13:17:07.563528645 +0200 +@@ -62,7 +62,7 @@ NUTSW_DRIVERLIST = $(NUTSW_DRIVERLIST_DU + SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \ + bestfortress bestuferrups bestups etapro everups \ + gamatronic genericups isbmex liebert liebert-esp2 liebert-gxe masterguard metasys \ +- mge-utalk microdowell microsol-apc mge-shut oneac optiups powercom rhino \ ++ mge-utalk microdowell microsol-apc mge-shut oneac optiups powercom nutdrv_rhino \ + safenet nutdrv_siemens-sitop solis tripplite tripplitesu upscode2 victronups powerpanel \ + blazer_ser ivtscd apcsmart apcsmart-old riello_ser sms_ser bicker_ser + if HAVE_LINUX_SERIAL_H +@@ -182,8 +182,8 @@ powercom_SOURCES = powercom.c + powercom_LDADD = $(LDADD) -lm + powerpanel_SOURCES = powerpanel.c powerp-bin.c powerp-txt.c + powerpanel_LDADD = $(LDADD) -lm +-rhino_SOURCES = rhino.c +-rhino_LDADD = $(LDADD) -lm ++nutdrv_rhino_SOURCES = rhino.c ++nutdrv_rhino_LDADD = $(LDADD) -lm + safenet_SOURCES = safenet.c + nutdrv_siemens_sitop_SOURCES = nutdrv_siemens_sitop.c + solis_SOURCES = solis.c diff --git a/nut.spec b/nut.spec index 2945107..4e922f8 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -24,6 +24,7 @@ Patch2: nut-2.8.0-piddir-owner.patch #quick fix. TODO: fix it properly Patch9: nut-2.6.5-rmpidf.patch Patch15: nut-c99-strdup.patch +Patch16: nut-2.8.3-rhinoname.patch Requires(post): coreutils systemd Requires(preun): systemd @@ -133,6 +134,7 @@ necessary to develop NUT client applications. %patch -P 2 -p1 -b .piddir-owner %patch -P 9 -p1 -b .rmpidf %patch -P 15 -p1 +%patch -P 16 -p2 -b .rhinoname sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in @@ -241,6 +243,9 @@ do mv -f $fe.new $fe done +# rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) +mv %{buildroot}%{_mandir}/man8/rhino.8 %{buildroot}%{_mandir}/man8/nutdrv_rhino.8 + # install PyNUT install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python3_sitelib}/PyNUT.py # install nut-monitor @@ -402,7 +407,7 @@ fi %{_mandir}/man8/powerman-pdu.8.gz %endif %{_mandir}/man8/powerpanel.8.gz -%{_mandir}/man8/rhino.8.gz +%{_mandir}/man8/nutdrv_rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz %{_mandir}/man8/riello_ser.8.gz %{_mandir}/man8/riello_usb.8.gz @@ -502,6 +507,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Wed May 21 2025 Michal Hlavinka - 2.8.3-2 +- rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) + * Tue Apr 29 2025 Michal Hlavinka - 2.8.3-1 - updated to 2.8.3 (#2352734) From 38f34fb51d56b22b5711bdaa510da1f5bdbbbd05 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 19:58:22 +0200 Subject: [PATCH 136/142] Rebuilt for Python 3.14 --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 4e922f8..84cb6e9 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -507,6 +507,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Mon Jun 02 2025 Python Maint - 2.8.3-3 +- Rebuilt for Python 3.14 + * Wed May 21 2025 Michal Hlavinka - 2.8.3-2 - rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) From cc9daebf1e3d7a6ebe0e4fd8c62cae1ebb88761a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 23:02:13 +0000 Subject: [PATCH 137/142] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index 84cb6e9..f2d0381 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.3 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -507,6 +507,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 2.8.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jun 02 2025 Python Maint - 2.8.3-3 - Rebuilt for Python 3.14 From 4870df85c6f447c4a0956d8728ecee5c9101901b Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 14 Aug 2025 12:13:59 +0200 Subject: [PATCH 138/142] updated to 2.8.4 (#2387244) --- .gitignore | 1 + nut-2.8.3-rhinoname.patch | 20 ++++++++++---------- nut.spec | 23 +++++++++++++++++------ sources | 2 +- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index cae0d0a..a737052 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ nut-2.4.3.tar.gz /nut-2.8.2.tar.gz /nut-2.8.2.1.tar.gz /nut-2.8.3.tar.gz +/nut-2.8.4.tar.gz diff --git a/nut-2.8.3-rhinoname.patch b/nut-2.8.3-rhinoname.patch index 5e978c0..71be46d 100644 --- a/nut-2.8.3-rhinoname.patch +++ b/nut-2.8.3-rhinoname.patch @@ -1,19 +1,19 @@ -diff -up nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am.rhinoname nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am ---- nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am.rhinoname 2025-05-21 13:16:02.566975097 +0200 -+++ nut-2.8.3-build/nut-2.8.3/drivers/Makefile.am 2025-05-21 13:17:07.563528645 +0200 -@@ -62,7 +62,7 @@ NUTSW_DRIVERLIST = $(NUTSW_DRIVERLIST_DU +diff -up nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am.rhinoname nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am +--- nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am.rhinoname 2025-08-14 11:08:48.763700333 +0200 ++++ nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am 2025-08-14 11:29:43.803846801 +0200 +@@ -74,7 +74,7 @@ NUTSW_DRIVERLIST = $(NUTSW_DRIVERLIST_DU SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \ bestfortress bestuferrups bestups etapro everups \ gamatronic genericups isbmex liebert liebert-esp2 liebert-gxe masterguard metasys \ -- mge-utalk microdowell microsol-apc mge-shut oneac optiups powercom rhino \ -+ mge-utalk microdowell microsol-apc mge-shut oneac optiups powercom nutdrv_rhino \ +- mge-utalk microdowell microsol-apc mge-shut nutdrv_hashx oneac optiups powercom powervar_cx_ser rhino \ ++ mge-utalk microdowell microsol-apc mge-shut nutdrv_hashx oneac optiups powercom powervar_cx_ser nutdrv_rhino \ safenet nutdrv_siemens-sitop solis tripplite tripplitesu upscode2 victronups powerpanel \ - blazer_ser ivtscd apcsmart apcsmart-old riello_ser sms_ser bicker_ser + blazer_ser ivtscd apcsmart apcsmart-old riello_ser sms_ser bicker_ser ve-direct if HAVE_LINUX_SERIAL_H -@@ -182,8 +182,8 @@ powercom_SOURCES = powercom.c - powercom_LDADD = $(LDADD) -lm - powerpanel_SOURCES = powerpanel.c powerp-bin.c powerp-txt.c +@@ -198,8 +198,8 @@ powerpanel_SOURCES = powerpanel.c powerp powerpanel_LDADD = $(LDADD) -lm + powervar_cx_ser_SOURCES = powervar_cx_ser.c powervar_cx.c + powervar_cx_ser_CFLAGS = $(AM_CFLAGS) -DPVAR_SERIAL=1 -rhino_SOURCES = rhino.c -rhino_LDADD = $(LDADD) -lm +nutdrv_rhino_SOURCES = rhino.c diff --git a/nut.spec b/nut.spec index f2d0381..f88dc36 100644 --- a/nut.spec +++ b/nut.spec @@ -13,8 +13,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.8.3 -Release: 4%{?dist} +Version: 2.8.4 +Release: 1%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -33,6 +33,7 @@ Recommends: nut-xml Requires: group(dialout) Requires: group(tty) +BuildRequires: asciidoc BuildRequires: make BuildRequires: autoconf BuildRequires: automake @@ -131,9 +132,9 @@ necessary to develop NUT client applications. %prep %setup -q -%patch -P 2 -p1 -b .piddir-owner +#patch -P 2 -p1 -b .piddir-owner %patch -P 9 -p1 -b .rmpidf -%patch -P 15 -p1 +#patch -P 15 -p1 %patch -P 16 -p2 -b .rhinoname sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop @@ -194,7 +195,8 @@ export LDFLAGS="-Wl,-z,now" --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --with-udev-dir=%{_usr}/lib/udev \ - --libdir=%{_libdir} + --libdir=%{_libdir} \ + --enable-docs-changelog=no # --with-doc # does not work in 2.7.1 # for rhbz#838139 check if still needed? @@ -370,6 +372,7 @@ fi %{_mandir}/man8/dummy-ups.8.gz %{_mandir}/man8/everups.8.gz %{_mandir}/man8/etapro.8.gz +%{_mandir}/man8/failover.8.gz %{_mandir}/man8/gamatronic.8.gz %{_mandir}/man8/generic_modbus.8.gz %{_mandir}/man8/genericups.8.gz @@ -392,6 +395,7 @@ fi %{_mandir}/man8/nhs_ser.8.gz %{_mandir}/man8/nutupsdrv.8.gz %{_mandir}/man8/nutdrv_atcl_usb.8.gz +%{_mandir}/man8/nutdrv_hashx.8.gz %{_mandir}/man8/nutdrv_siemens_sitop.8.gz %{_mandir}/man8/nut-driver-enumerator.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz @@ -407,6 +411,8 @@ fi %{_mandir}/man8/powerman-pdu.8.gz %endif %{_mandir}/man8/powerpanel.8.gz +%{_mandir}/man8/powervar_cx_ser.8.gz +%{_mandir}/man8/powervar_cx_usb.8.gz %{_mandir}/man8/nutdrv_rhino.8.gz %{_mandir}/man8/richcomm_usb.8.gz %{_mandir}/man8/riello_ser.8.gz @@ -420,12 +426,13 @@ fi %{_mandir}/man8/tripplite.8.gz %{_mandir}/man8/tripplite_usb.8.gz %{_mandir}/man8/tripplitesu.8.gz -%{_mandir}/man8/victronups.8.gz %{_mandir}/man8/upscode2.8* %{_mandir}/man8/upsd.8.gz %{_mandir}/man8/upsdrvctl.8.gz %{_mandir}/man8/upsdrvsvcctl.8.gz %{_mandir}/man8/usbhid-ups.8.gz +%{_mandir}/man8/victronups.8.gz +%{_mandir}/man8/ve-direct.8.gz %{_sysusersdir}/nut.conf %files client @@ -456,6 +463,7 @@ fi %{_mandir}/man5/nut.conf.5.gz %{_mandir}/man5/upsmon.conf.5.gz %{_mandir}/man5/upssched.conf.5.gz +%{_mandir}/man7/nut.7.gz %{_mandir}/man8/upsc.8.gz %{_mandir}/man8/upscmd.8.gz %{_mandir}/man8/upslog.8.gz @@ -507,6 +515,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Thu Aug 14 2025 Michal Hlavinka - 2.8.4-1 +- updated to 2.8.4 (#2387244) + * Thu Jul 24 2025 Fedora Release Engineering - 2.8.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index f63aad6..5f00a02 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.3.tar.gz) = 0aeafad02ab323b02041a370c586dede91483cab57e0a9d1256a685716ca9f0d0f114df904ef472d48fa53ac1896690b7878828eb3b00934959c7aeaa63af99f +SHA512 (nut-2.8.4.tar.gz) = 0d87c0006608f92ae54f8a500f93d9a81eac1d9abf57f32e7718dd72f265b8293a0b6cdba04c802b81eaf8907b52669c36b47b6875a4377f9752845ac6c5e8fa From 7164fc2d6d1759622c72b07eda35a07e217864af Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 13:02:57 +0200 Subject: [PATCH 139/142] Rebuilt for Python 3.14.0rc2 bytecode --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index f88dc36..ff9aa07 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -515,6 +515,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Aug 15 2025 Python Maint - 2.8.4-2 +- Rebuilt for Python 3.14.0rc2 bytecode + * Thu Aug 14 2025 Michal Hlavinka - 2.8.4-1 - updated to 2.8.4 (#2387244) From 069b76a3a8ee7a2e188b0e8e936758f7b811f8dc Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 12:33:37 +0200 Subject: [PATCH 140/142] Rebuilt for Python 3.14.0rc3 bytecode --- nut.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nut.spec b/nut.spec index ff9aa07..40f63d1 100644 --- a/nut.spec +++ b/nut.spec @@ -14,7 +14,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -515,6 +515,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Sep 19 2025 Python Maint - 2.8.4-3 +- Rebuilt for Python 3.14.0rc3 bytecode + * Fri Aug 15 2025 Python Maint - 2.8.4-2 - Rebuilt for Python 3.14.0rc2 bytecode From 77706a32be789aa4285c7626aa024b30fd7fd414 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 30 Sep 2025 12:11:02 +0200 Subject: [PATCH 141/142] based on PR#18 by Orion Poplawski Build NUT-Monitor and ship in separate nut-monitor package (rhbz#2359149) Move UPS drivers into /usr/libexec/nut --- nut.spec | 80 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/nut.spec b/nut.spec index 40f63d1..aecfb12 100644 --- a/nut.spec +++ b/nut.spec @@ -1,5 +1,4 @@ %global _hardened_build 1 -%bcond_with python2 #TODO: split nut-client so it does not require python %global nut_uid 57 @@ -7,14 +6,14 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /run/nut -%global modeldir %{_sbindir} +%global modeldir %{_libexecdir}/%{name} # powerman is retired on Fedora, therefore disable it by default %bcond_with powerman Summary: Network UPS Tools Name: nut Version: 2.8.4 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -94,10 +93,6 @@ live status tracking on web pages, and more. Summary: Network UPS Tools client monitoring utilities Requires(post): systemd Requires(preun): systemd -%if %{with python2} -Requires: pygtk2, pygtk2-libglade -#only for python and gui part -%endif Requires: group(dialout) Requires: group(tty) @@ -114,6 +109,14 @@ Requires: %{name}-client = %{version}-%{release} webserver This package includes CGI programs for accessing UPS status via a web browser. +%package monitor +Summary: Network UPS Tools monitor application +BuildRequires: python3-pyqt6 + +%description monitor +This package contain the Python NUT-Monitor GUI application to +monitor a UPS. + %package xml Summary: XML UPS driver for the Network UPS Tools Requires: %{name}-client = %{version}-%{release} @@ -137,8 +140,6 @@ necessary to develop NUT client applications. #patch -P 15 -p1 %patch -P 16 -p2 -b .rhinoname -sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor-py3qt5.desktop -sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor-py3qt5.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in @@ -156,7 +157,7 @@ m nut tty EOF %build -%if 0%{?fedora} > 38 +%if 0%{?fedora} #--without-gpio is not enough to stop it complaining about missing library sed -i 's|with_gpio="[^"]*"|with_gpio="no"|g' configure.ac %endif @@ -170,7 +171,7 @@ export LDFLAGS="-Wl,-z,now" --without-powerman \ %endif --with-libltdl \ -%if (0%{?fedora} && 0%{?fedora} < 33) || 0%{?el8} +%if 0%{?el8} --with-nss \ %endif --without-wrap \ @@ -187,7 +188,7 @@ export LDFLAGS="-Wl,-z,now" --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ -%if 0%{?fedora} > 38 +%if 0%{?fedora} --without-gpio \ %endif --with-systemdsystemunitdir=%{_unitdir} \ @@ -250,16 +251,20 @@ mv %{buildroot}%{_mandir}/man8/rhino.8 %{buildroot}%{_mandir}/man8/nutdrv_rhino. # install PyNUT install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python3_sitelib}/PyNUT.py -# install nut-monitor -%if %{with python2} -mkdir -p %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps -install -p -m 755 scripts/python/app/NUT-Monitor %{buildroot}%{_datadir}/nut/nut-monitor/nut-monitor -install -p -m 644 scripts/python/app/gui-1.3.glade %{buildroot}%{_datadir}/nut/nut-monitor -install -p -m 644 scripts/python/app/pixmaps/* %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps/ -install -p -D scripts/python/app/nut-monitor.png %{buildroot}%{_datadir}/pixmaps/nut-monitor.png -desktop-file-install --dir=%{buildroot}%{_datadir}/applications scripts/python/app/nut-monitor.desktop -ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor -%endif +# add lowercase name +ln %{buildroot}%{_bindir}/{NUT-Monitor,nut-monitor} +# install desktop file +mkdir -p %{buildroot}%{_datadir}/applications +desktop-file-install \ + --dir=%{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/nut-monitor/app/nut-monitor.desktop +# install icons +for res in 256x256 48x48 64x64 scalable +do + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${res}/apps + ln %{buildroot}%{_datadir}/nut-monitor/app/icons/${res}/nut-monitor.* \ + %{buildroot}%{_datadir}/icons/hicolor/${res}/apps/ +done # Setup permissions for pid file touch %{buildroot}/%{piddir}/upsmon.pid @@ -315,7 +320,9 @@ fi %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules -%{modeldir}/* +%{modeldir}/ +# dummy-ups requires libupsclient +%exclude %{modeldir}/dummy-ups %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver-enumerator.path %{_unitdir}/nut-driver-enumerator.service @@ -333,6 +340,8 @@ fi %{_sbindir}/upsd %{_bindir}/nutconf %{_bindir}/nut-scanner +%{_sbindir}/upsdrvctl +%{_sbindir}/upsdrvsvcctl %{_libdir}/libnutscan.so.* %{_libdir}/libnutconf.so.* %{_libexecdir}/nut-driver-enumerator.sh @@ -453,6 +462,8 @@ fi %{_sbindir}/upsmon %{_sbindir}/upssched %{_bindir}/upssched-cmd +# dummy-ups requires libupsclient +%{modeldir}/dummy-ups %{_unitdir}/nut-monitor.service # nut-monitor.service also needs nut.target %{_unitdir}/nut.target @@ -470,15 +481,19 @@ fi %{_mandir}/man8/upsrw.8.gz %{_mandir}/man8/upsmon.8.gz %{_mandir}/man8/upssched.8.gz +%{_datadir}/nut +%{_sysusersdir}/nut.conf + +%files monitor +%{_bindir}/nut-monitor +%{_bindir}/NUT-Monitor +%{_datadir}/applications/nut-monitor.desktop +%{_datadir}/icons/hicolor/*/apps/nut-monitor.png +%{_datadir}/icons/hicolor/scalable/apps/nut-monitor.svg +%{_datadir}/nut-monitor/ +%{_mandir}/man8/NUT-Monitor*.8.gz %pycached %{python3_sitelib}/PyNUT.py %pycached %{python3_sitelib}/test_nutclient.py -%{_datadir}/nut -%if %{with python2} -%{_bindir}/nut-monitor -%{_datadir}/pixmaps/nut-monitor.png -%{_datadir}/applications/nut-monitor.desktop -%endif -%{_sysusersdir}/nut.conf %files cgi %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf @@ -515,6 +530,11 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Tue Sep 30 2025 Michal Hlavinka - 2.8.4-4 +- based on PR#18 by Orion Poplawski +- Build NUT-Monitor and ship in separate nut-monitor package (rhbz#2359149) +- Move UPS drivers into /usr/libexec/nut + * Fri Sep 19 2025 Python Maint - 2.8.4-3 - Rebuilt for Python 3.14.0rc3 bytecode From 98284f631bc0248fc780cc86b979cf8470d4d83c Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 5 Dec 2025 18:34:11 -0700 Subject: [PATCH 142/142] Add missing || : to preinstall scriptlet (rhbz#241964) --- nut.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nut.spec b/nut.spec index aecfb12..dba51af 100644 --- a/nut.spec +++ b/nut.spec @@ -13,7 +13,7 @@ Summary: Network UPS Tools Name: nut Version: 2.8.4 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL-2.0-or-later AND GPL-3.0-or-later Url: https://www.networkupstools.org/ Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz @@ -277,8 +277,8 @@ install -m0644 -D nut.sysusers.conf %{buildroot}%{_sysusersdir}/nut.conf # phase 1: stop upsmon before upsd changes if [ "$1" = "2" ]; then rm -f %restart_flag - /bin/systemctl is-active nut-monitor.service >/dev/null 2>&1 && touch %restart_flag ||: - /bin/systemctl stop nut-monitor.service >/dev/null 2>&1 + /bin/systemctl is-active nut-monitor.service >/dev/null 2>&1 && touch %restart_flag || : + /bin/systemctl stop nut-monitor.service >/dev/null 2>&1 || : fi @@ -530,6 +530,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Sat Dec 06 2025 Orion Poplawski - 2.8.4-5 +- Add missing || : to preinstall scriptlet (rhbz#2419644) + * Tue Sep 30 2025 Michal Hlavinka - 2.8.4-4 - based on PR#18 by Orion Poplawski - Build NUT-Monitor and ship in separate nut-monitor package (rhbz#2359149)