From 4056ce4e827d4a1c307b5a8cb992cfb8a5a5e388 Mon Sep 17 00:00:00 2001 From: Tim Jackson Date: Oct 11 2019 19:35:16 +0000 Subject: [PATCH 1/4] Fix failure of nut-client to install on EL8 due to missing pygtk2 --- diff --git a/nut.spec b/nut.spec index 7ac1d95..5ed0b6c 100644 --- a/nut.spec +++ b/nut.spec @@ -1,6 +1,7 @@ %global _hardened_build 1 #global with_python2 0 -%bcond_with python2 +#EL8 doesn't have pygtk2 +#%bcond_with python2 #TODO: split nut-client so it does not require python %global nut_uid 57 @@ -15,7 +16,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 +442,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Oct 11 2019 Tim Jackson - 2.7.4-27 +- Build without python2 for EL8 + * Fri Oct 04 2019 Michal Hlavinka - 2.7.4-26 - drop pygtk2 requirements From e8feea994ef9bad8afb880b81efe6f9c89b1b745 Mon Sep 17 00:00:00 2001 From: Tim Jackson Date: Oct 11 2019 22:24:33 +0000 Subject: [PATCH 2/4] Update /var/run -> /run --- 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 5ed0b6c..76fbc33 100644 --- a/nut.spec +++ b/nut.spec @@ -8,7 +8,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 @@ -16,7 +16,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 @@ -76,7 +76,7 @@ BuildRequires: libusb-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 @@ -442,6 +442,9 @@ fi %{_libdir}/pkgconfig/libnutscan.pc %changelog +* Fri Oct 11 2019 Tim Jackson - 2.7.4-28 +- Fix location of runtime files: now in /run instead of /var/run + * Fri Oct 11 2019 Tim Jackson - 2.7.4-27 - Build without python2 for EL8 diff --git a/ups.init b/ups.init index fab3c92..8abbe50 100644 --- a/ups.init +++ b/ups.init @@ -51,14 +51,14 @@ start() { echo echo -n $"Starting UPS monitor (master): " - daemon --pidfile /var/run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure + daemon --pidfile /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 + daemon --pidfile /run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure echo fi @@ -67,7 +67,7 @@ start() { stop() { echo -n $"Stopping UPS monitor: " - killproc -p /var/run/nut/upsmon.pid upsmon + killproc -p /run/nut/upsmon.pid upsmon echo if [ "$SERVER" = "yes" ]; then @@ -90,7 +90,7 @@ stop() { restart() { stop waitmore=5 - while [ -n "$(ls /var/run/nut/)" -a $waitmore -ge 1 ] + while [ -n "$(ls /run/nut/)" -a $waitmore -ge 1 ] do sleep 1 waitmore=$((waitmore-1)) From a1134bf756859e0b1dd72af43b79e04912fe149a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Oct 16 2019 15:40:44 +0000 Subject: [PATCH 3/4] Merge branch 'master' into epel8 --- diff --git a/nut.spec b/nut.spec index e937742..7ac1d95 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: 26%{?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 @@ -87,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 @@ -132,13 +136,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 +223,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 +233,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 +402,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 +441,12 @@ 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 + * Thu Jul 25 2019 Fedora Release Engineering - 2.7.4-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 6b21971bd729de7005eaf4d82dd49607a34e4a17 Mon Sep 17 00:00:00 2001 From: Tim Jackson Date: Jan 17 2020 22:01:28 +0000 Subject: [PATCH 4/4] Merge remote-tracking branch 'upstream/epel8' --- diff --git a/package.cfg b/package.cfg new file mode 100644 index 0000000..7e5a05b --- /dev/null +++ b/package.cfg @@ -0,0 +1,2 @@ +[koji] +targets = epel8 epel8-playground