diff --git a/nut-c99-strdup.patch b/nut-c99-strdup.patch deleted file mode 100644 index 90c83db..0000000 --- a/nut-c99-strdup.patch +++ /dev/null @@ -1,17 +0,0 @@ -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 dba51af..58cd826 100644 --- a/nut.spec +++ b/nut.spec @@ -1,4 +1,5 @@ %global _hardened_build 1 +%bcond_with python2 #TODO: split nut-client so it does not require python %global nut_uid 57 @@ -6,14 +7,14 @@ %global cgidir /var/www/nut-cgi-bin %global piddir /run/nut -%global modeldir %{_libexecdir}/%{name} +%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.4 -Release: 5%{?dist} +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,7 +23,6 @@ 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 @@ -93,6 +93,10 @@ 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) @@ -109,14 +113,6 @@ 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} @@ -135,11 +131,11 @@ necessary to develop NUT client applications. %prep %setup -q -#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 sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in @@ -157,7 +153,7 @@ m nut tty EOF %build -%if 0%{?fedora} +%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 @@ -171,10 +167,12 @@ export LDFLAGS="-Wl,-z,now" --without-powerman \ %endif --with-libltdl \ -%if 0%{?el8} +%if (0%{?fedora} && 0%{?fedora} < 33) || 0%{?el8} --with-nss \ %endif --without-wrap \ + --with-modbus \ + --without-linux-i2c \ --with-cgi \ --with-python=%{python3} \ --with-python3=%{python3} \ @@ -188,7 +186,7 @@ export LDFLAGS="-Wl,-z,now" --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ -%if 0%{?fedora} +%if 0%{?fedora} > 38 --without-gpio \ %endif --with-systemdsystemunitdir=%{_unitdir} \ @@ -251,20 +249,16 @@ 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 -# 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 +# 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 # Setup permissions for pid file touch %{buildroot}/%{piddir}/upsmon.pid @@ -277,8 +271,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 @@ -320,9 +314,7 @@ 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}/ -# dummy-ups requires libupsclient -%exclude %{modeldir}/dummy-ups +%{modeldir}/* %exclude %{modeldir}/netxml-ups %{_unitdir}/nut-driver-enumerator.path %{_unitdir}/nut-driver-enumerator.service @@ -340,8 +332,6 @@ fi %{_sbindir}/upsd %{_bindir}/nutconf %{_bindir}/nut-scanner -%{_sbindir}/upsdrvctl -%{_sbindir}/upsdrvsvcctl %{_libdir}/libnutscan.so.* %{_libdir}/libnutconf.so.* %{_libexecdir}/nut-driver-enumerator.sh @@ -364,7 +354,6 @@ fi %{_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 @@ -388,7 +377,6 @@ 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 @@ -414,7 +402,6 @@ fi %{_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 @@ -435,6 +422,7 @@ 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 @@ -462,8 +450,6 @@ 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 @@ -481,19 +467,15 @@ 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 @@ -530,64 +512,17 @@ 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) -- Move UPS drivers into /usr/libexec/nut - -* 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 - -* 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 - -* 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) - * 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 - -* 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 -- 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 -* 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 Oct 02 2024 Michal Hlavinka - 2.8.2-2 +- enable modbus drivers (rhbz#2314661) -* 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 - -* 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 - -* Sun Jan 21 2024 Fedora Release Engineering - 2.8.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild +* Wed Sep 04 2024 Michal Hlavinka - 2.8.2.1-1 +- updated to 2.8.2 (rhbz#2307300) * Thu Nov 30 2023 Orion Poplawski - 2.8.1-2 - Re-add nut.target to nut-client (bz#2156504) @@ -644,60 +579,22 @@ fi * 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 +* Tue Feb 14 2023 Michal Hlavinka - 2.8.0-4 +- add nut-xml to nut recommends (#1379382) -* Tue Sep 14 2021 Sahana Prasad - 2.7.4-42 -- Rebuilt with OpenSSL 3.0.0 +* Mon Dec 12 2022 Michal Hlavinka - 2.8.0-3 +- apply missing patch -* Thu Jul 22 2021 Fedora Release Engineering - 2.7.4-41 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild +* Tue Dec 06 2022 Michal Hlavinka - 2.8.0-2 +- fix STATEPATH location and creation (#2024651) +- merged C99 related changes to configure from fedora -* Tue Jun 08 2021 Michal Hlavinka - 2.7.4-40 -- drop snmp-ups support for DES, as required net-snmp no longer supports it +* Tue Sep 13 2022 Michal Hlavinka - 2.8.0-1 +- update to 2.8.0 -* 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. - -* 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 - -* 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 - -* 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 +* Tue Jun 02 2020 Michal Hlavinka - 2.7.4-27 - nut user needs tty group for wall (#1774591) -* 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 - -* 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 - -* 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