diff --git a/.gitignore b/.gitignore index 56f7b98..a737052 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ 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 +/nut-2.8.4.tar.gz diff --git a/nut-2.8.3-rhinoname.patch b/nut-2.8.3-rhinoname.patch new file mode 100644 index 0000000..71be46d --- /dev/null +++ b/nut-2.8.3-rhinoname.patch @@ -0,0 +1,23 @@ +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 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 ve-direct + if HAVE_LINUX_SERIAL_H +@@ -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 ++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 2d04cd3..dba51af 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.2.1 -Release: 5%{?dist}.1.git20240703pr2505 +Version: 2.8.4 +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 @@ -24,6 +23,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 @@ -32,6 +32,7 @@ Recommends: nut-xml Requires: group(dialout) Requires: group(tty) +BuildRequires: asciidoc BuildRequires: make BuildRequires: autoconf BuildRequires: automake @@ -47,6 +48,7 @@ BuildRequires: freetype-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gd-devel +BuildRequires: jq %if 0%{?fedora} < 39 BuildRequires: libgpiod-devel %endif @@ -91,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) @@ -111,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} @@ -129,12 +135,11 @@ 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 -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 @@ -152,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 @@ -166,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 \ @@ -183,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} \ @@ -191,7 +196,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? @@ -240,18 +246,25 @@ 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 -%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 @@ -264,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 @@ -307,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 @@ -318,12 +333,20 @@ 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 +%{_sbindir}/upsdrvctl +%{_sbindir}/upsdrvsvcctl %{_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,9 +377,11 @@ 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 +%{_mandir}/man8/failover.8.gz %{_mandir}/man8/gamatronic.8.gz %{_mandir}/man8/generic_modbus.8.gz %{_mandir}/man8/genericups.8.gz @@ -369,14 +394,17 @@ 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_hashx.8.gz %{_mandir}/man8/nutdrv_siemens_sitop.8.gz %{_mandir}/man8/nut-driver-enumerator.8.gz %{_mandir}/man8/nut-ipmipsu.8.gz @@ -392,7 +420,9 @@ fi %{_mandir}/man8/powerman-pdu.8.gz %endif %{_mandir}/man8/powerpanel.8.gz -%{_mandir}/man8/rhino.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 %{_mandir}/man8/riello_usb.8.gz @@ -405,12 +435,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 @@ -431,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 @@ -441,21 +474,26 @@ 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 %{_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 @@ -483,13 +521,44 @@ 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 +* 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 diff --git a/sources b/sources index 379e679..5f00a02 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nut-2.8.2.1.tar.gz) = 62457781758be939919d1c9bbed4b2895d2c434c73ec6d36ab6120898f84a24131cf7796d320117c5f8780e63da1aa6966e59156466ff78f20267b0a4eed1652 +SHA512 (nut-2.8.4.tar.gz) = 0d87c0006608f92ae54f8a500f93d9a81eac1d9abf57f32e7718dd72f265b8293a0b6cdba04c802b81eaf8907b52669c36b47b6875a4377f9752845ac6c5e8fa