Compare commits

..

21 commits

Author SHA1 Message Date
Orion Poplawski
98284f631b Add missing || : to preinstall scriptlet (rhbz#241964) 2025-12-05 18:34:11 -07:00
Michal Hlavinka
77706a32be 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
2025-09-30 12:11:02 +02:00
Python Maint
069b76a3a8 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 12:33:37 +02:00
Python Maint
7164fc2d6d Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 13:02:57 +02:00
Michal Hlavinka
4870df85c6 updated to 2.8.4 (#2387244) 2025-08-14 12:13:59 +02:00
Fedora Release Engineering
cc9daebf1e Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 23:02:13 +00:00
Python Maint
38f34fb51d Rebuilt for Python 3.14 2025-06-02 19:58:22 +02:00
Michal Hlavinka
1f502ae93a rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) 2025-05-21 13:43:14 +02:00
Michal Hlavinka
9867e18241 add needed buildrequire jq 2025-04-29 17:37:37 +02:00
Michal Hlavinka
760ad72a05 updated to 2.8.3 (#2352734) 2025-04-29 16:46:04 +02:00
Zbigniew Jędrzejewski-Szmek
91e5a19370 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.
2025-02-11 16:33:00 +01:00
Michal Hlavinka
ce21c14155 add back git snapshot part of release number 2025-01-31 21:00:34 +01:00
Michal Hlavinka
7d3c0ad65d 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
2025-01-29 00:09:31 +01:00
Fedora Release Engineering
b278271309 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 20:31:55 +00:00
Orion Poplawski
3cb725a9a6 Add BR systemd-devel to enable systemd notification support 2024-11-15 16:08:05 -07:00
Fedora Release Engineering
02a191e840 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 19:52:32 +00:00
Michal Hlavinka
810e8f234e fix python FTBFS, uses git snapshot as of 20240703 with PR 2505 2024-07-03 12:59:09 +02:00
Python Maint
59f9744317 Rebuilt for Python 3.13 2024-06-07 08:33:13 +02:00
Michal Hlavinka
ada5bd73a7 updated to 2.8.2(2272586) 2024-04-03 11:56:12 +02:00
Fedora Release Engineering
17e960e140 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 09:32:03 +00:00
Fedora Release Engineering
03a2bff29b Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 10:02:08 +00:00
2 changed files with 169 additions and 49 deletions

17
nut-c99-strdup.patch Normal file
View file

@ -0,0 +1,17 @@
Fix strdup configure test: Remove a call to the undeclared free
function.
Submitted upstream: <https://github.com/networkupstools/nut/pull/1720>
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;" */
]])],

201
nut.spec
View file

@ -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: 1%{?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
@ -23,6 +22,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
@ -93,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)
@ -113,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}
@ -131,11 +135,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
@ -153,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
@ -167,12 +171,10 @@ 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 \
--with-modbus \
--without-linux-i2c \
--with-cgi \
--with-python=%{python3} \
--with-python3=%{python3} \
@ -186,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} \
@ -249,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
@ -271,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
@ -314,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
@ -332,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
@ -354,6 +364,7 @@ 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
@ -377,6 +388,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
@ -402,6 +414,7 @@ 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
@ -422,7 +435,6 @@ 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
@ -450,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
@ -467,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
@ -512,17 +530,64 @@ fi
%{_libdir}/pkgconfig/libnutscan.pc
%changelog
* Sat Dec 06 2025 Orion Poplawski <orion@nwra.com> - 2.8.4-5
- Add missing || : to preinstall scriptlet (rhbz#2419644)
* Tue Sep 30 2025 Michal Hlavinka <mhlavink@redhat.com> - 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 <python-maint@redhat.com> - 2.8.4-3
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 2.8.4-2
- Rebuilt for Python 3.14.0rc2 bytecode
* Thu Aug 14 2025 Michal Hlavinka <mhlavink@redhat.com> - 2.8.4-1
- updated to 2.8.4 (#2387244)
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 2.8.3-3
- Rebuilt for Python 3.14
* Wed May 21 2025 Michal Hlavinka <mhlavink@redhat.com> - 2.8.3-2
- rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057)
* Tue Apr 29 2025 Michal Hlavinka <mhlavink@redhat.com> - 2.8.3-1
- updated to 2.8.3 (#2352734)
* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 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 <mhlavink@redhat.com> - 2.8.2.1-4.1.git20240703pr2505
- fix ftbfs, make it build with unified bin/sbin
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2.1-3.1.git20240703pr2505
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Nov 15 2024 Orion Poplawski <orion@nwra.com> - 2.8.2.1-2.1.git20240703pr2505
- Add BR systemd-devel to enable systemd notification support
* Wed Oct 02 2024 Michal Hlavinka <mhlavink@redhat.com> - 2.8.2-2
- enable modbus drivers (rhbz#2314661)
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2.1-1.1.git20240703pr2505
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed Sep 04 2024 Michal Hlavinka <mhlavink@redhat.com> - 2.8.2.1-1
- updated to 2.8.2 (rhbz#2307300)
* Wed Jul 03 2024 Michal Hlavinka <mhlavink@redhat.com> - 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 <python-maint@redhat.com> - 2.8.2-2
- Rebuilt for Python 3.13
* Wed Apr 03 2024 Michal Hlavinka <mhlavink@redhat.com> - 2.8.2-1
- updated to 2.8.2(2272586)
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Nov 30 2023 Orion Poplawski <orion@nwra.com> - 2.8.1-2
- Re-add nut.target to nut-client (bz#2156504)
@ -579,22 +644,60 @@ fi
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Feb 14 2023 Michal Hlavinka <mhlavink@redhat.com> - 2.8.0-4
- add nut-xml to nut recommends (#1379382)
* Thu Sep 23 2021 Miro Hrončok <mhroncok@redhat.com> - 2.7.4-43
- Don't own /usr/lib/python3.X/site-packages
* Mon Dec 12 2022 Michal Hlavinka <mhlavink@redhat.com> - 2.8.0-3
- apply missing patch
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 2.7.4-42
- Rebuilt with OpenSSL 3.0.0
* Tue Dec 06 2022 Michal Hlavinka <mhlavink@redhat.com> - 2.8.0-2
- fix STATEPATH location and creation (#2024651)
- merged C99 related changes to configure from fedora
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Sep 13 2022 Michal Hlavinka <mhlavink@redhat.com> - 2.8.0-1
- update to 2.8.0
* Tue Jun 08 2021 Michal Hlavinka <mhlavink@redhat.com> - 2.7.4-40
- drop snmp-ups support for DES, as required net-snmp no longer supports it
* Tue Jun 02 2020 Michal Hlavinka <mhlavink@redhat.com> - 2.7.4-27
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.7.4-39
- Rebuilt for Python 3.10
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.7.4-38
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Sep 15 2020 Jeff Law <law@redhat.com> - 2.7.4-36
- Force C++14 as this code is not C++17 ready
* Wed Sep 02 2020 Josef Ridky <jridky@redhat.com> - 2.7.4-35
- Resolves: #1865077 - FTBFS in Fedora 33
- Rebuilt for new release of net-snmp
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-34
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jun 02 2020 Michal Hlavinka <mhlavink@redhat.com> - 2.7.4-32
- nut user needs tty group for wall (#1774591)
* Tue Jun 02 2020 Michal Hlavinka <mhlavink@redhat.com> - 2.7.4-31
- update tmpfiles nut run directory
* Tue May 26 2020 Orion Poplawski <orion@nwra.com> - 2.7.4-30
- Drop old udev requires/scriptlet
* Tue May 26 2020 Orion Poplawski <orion@nwra.com> - 2.7.4-29
- Add upstream patch for OpenSSL 1.1.0 support, enable for Fedora >= 33
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.7.4-28
- Rebuilt for Python 3.9
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Oct 04 2019 Michal Hlavinka <mhlavink@redhat.com> - 2.7.4-26
- drop pygtk2 requirements