SHA256
1
0
forked from pool/nut

Accepting request 1123362 from home:adkorte:branches:hardware

- Update to version 2.8.1
  For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
  (the list of changes is too long to list).
- Remove obsolete patch:
  * nut-Solaris-init-files.patch

OBS-URL: https://build.opensuse.org/request/show/1123362
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=109
This commit is contained in:
Antonio Teixeira 2023-11-19 19:26:20 +00:00 committed by Git OBS Bridge
parent 365511b7c9
commit 6bb3890ddb
13 changed files with 84 additions and 228 deletions

View File

@ -1,8 +1,7 @@
Index: nut-2.7.4/scripts/systemd/nut-driver.service.in
===================================================================
--- a/scripts/systemd/nut-driver@.service.in
+++ b/scripts/systemd/nut-driver@.service.in
@@ -38,6 +38,17 @@
diff -purN a/scripts/systemd/nut-driver@.service.in b/scripts/systemd/nut-driver@.service.in
--- a/scripts/systemd/nut-driver@.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-driver@.service.in 2023-11-03 19:46:30.856267504 +0100
@@ -46,6 +46,17 @@ PartOf=nut-driver.target
# Finally note that "nut-driver-enumerator.service" should take care of this.
[Service]
@ -17,6 +16,6 @@ Index: nut-2.7.4/scripts/systemd/nut-driver.service.in
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
Environment=NUT_IGNORE_NOWAIT=true
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
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"'

View File

@ -1,8 +1,7 @@
Index: nut-2.7.4/scripts/systemd/nut-monitor.service.in
===================================================================
--- a/scripts/systemd/nut-monitor.service.in
+++ b/scripts/systemd/nut-monitor.service.in
@@ -3,6 +3,17 @@
diff -purN a/scripts/systemd/nut-monitor.service.in b/scripts/systemd/nut-monitor.service.in
--- a/scripts/systemd/nut-monitor.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-monitor.service.in 2023-11-03 19:48:16.280004811 +0100
@@ -25,6 +25,17 @@ Wants=nut-server.service
PartOf=nut.target
[Service]
@ -19,4 +18,4 @@ Index: nut-2.7.4/scripts/systemd/nut-monitor.service.in
+# end of automatic additions
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
ExecStart=@SBINDIR@/upsmon -F
ExecStartPre=-@SYSTEMD_TMPFILES_PROGRAM@ --create @systemdtmpfilesdir@/nut-common-tmpfiles.conf

View File

@ -1,8 +1,7 @@
Index: nut-2.7.4/scripts/systemd/nut-server.service.in
===================================================================
--- nut-2.7.4.orig/scripts/systemd/nut-server.service.in
+++ nut-2.7.4/scripts/systemd/nut-server.service.in
@@ -18,6 +18,17 @@
diff -purN a/scripts/systemd/nut-server.service.in b/scripts/systemd/nut-server.service.in
--- a/scripts/systemd/nut-server.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-server.service.in 2023-11-03 19:49:51.496940092 +0100
@@ -26,6 +26,17 @@ Before=nut-monitor.service
PartOf=nut.target
[Service]
@ -19,4 +18,4 @@ Index: nut-2.7.4/scripts/systemd/nut-server.service.in
+# end of automatic additions
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
# Note: foreground mode by default skips writing a PID file (and
# Note: foreground mode "-F" by default skips writing a PID file (and

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5
size 3287640

Binary file not shown.

3
nut-2.8.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7da48ee23b1f0d8d72560bb0af84f5c5ae4dbe35452b84cb49840132e47f099c
size 4125263

BIN
nut-2.8.1.tar.gz.sig Normal file

Binary file not shown.

View File

@ -1,156 +0,0 @@
From 05ccf412f9212b8206ea33a56e5dde2e2a8016b8 Mon Sep 17 00:00:00 2001
From: Jim Klimov <jim@jimklimov.com>
Date: Sun, 14 Aug 2022 22:03:57 +0200
Subject: [PATCH] configure.ac, scripts/Solaris/Makefile.am: introduce
WITH_SOLARIS_INIT and depend WITH_SOLARIS_SMF on whether we want packaging
for Solaris/illumos [#1554]
---
configure.ac | 104 ++++++++++++++++++++++++++----------
scripts/Solaris/Makefile.am | 17 +-----
2 files changed, 79 insertions(+), 42 deletions(-)
diff --git a/configure.ac b/configure.ac
index 065fcd76f1..d9b3859c42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2090,34 +2090,8 @@ else
fi
AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}")
-AC_MSG_CHECKING(whether to install Solaris SMF files)
-solarissmf="auto"
-AC_ARG_WITH([solaris-smf],
- AS_HELP_STRING([--with-solaris-smf=(yes|auto|no)], [Enable installation of NUT scripts and manifests for Solaris Service Management Framework (auto)]),
-[
- case "${withval}" in
- auto|"")
- solarissmf="auto"
- ;;
- yes|no)
- solarissmf="${withval}"
- ;;
- *)
- AC_MSG_ERROR([Unexpected argument for --with-solaris-smf=${withval}])
- ;;
- esac
-], [])
-
-if test x"$solarissmf" = xauto ; then
- if test -x /usr/sbin/svcadm && test -x /usr/sbin/svccfg && test -x /usr/bin/svcs ; then
- solarissmf="yes"
- else
- solarissmf="no"
- fi
-fi
-AC_MSG_RESULT([${solarissmf}])
-AM_CONDITIONAL(WITH_SOLARIS_SMF, test x"$solarissmf" = x"yes")
+dnl Options for Solaris/illumos `make install` and `make package`
AC_MSG_CHECKING(whether to make Solaris SVR4 packages)
solarispkg_svr4="auto"
AC_ARG_WITH([solaris-pkg-svr4],
@@ -2146,6 +2120,7 @@ fi
AC_MSG_RESULT([${solarispkg_svr4}])
AM_CONDITIONAL(WITH_SOLARIS_PKG_SVR4, test x"$solarispkg_svr4" = x"yes")
+
AC_MSG_CHECKING(whether to make Solaris IPS packages)
solarispkg_ips="auto"
AC_ARG_WITH([solaris-pkg-ips],
@@ -2174,6 +2149,81 @@ fi
AC_MSG_RESULT([${solarispkg_ips}])
AM_CONDITIONAL(WITH_SOLARIS_PKG_IPS, test x"$solarispkg_ips" = x"yes")
+
+dnl NOTE: Be sure to customize e.g. --datarootdir=/usr/share/nut to install
+dnl these scripts not into default location as e.g. /usr/share/solaris-smf
+AC_MSG_CHECKING(whether to install Solaris SMF files)
+solarissmf="auto"
+AC_ARG_WITH([solaris-smf],
+ AS_HELP_STRING([--with-solaris-smf=(yes|auto|no)], [Enable installation of NUT scripts and manifests for Solaris Service Management Framework (auto)]),
+[
+ case "${withval}" in
+ auto|"")
+ solarissmf="auto"
+ ;;
+ yes|no)
+ solarissmf="${withval}"
+ ;;
+ *)
+ AC_MSG_ERROR([Unexpected argument for --with-solaris-smf=${withval}])
+ ;;
+ esac
+], [])
+
+if test x"$solarissmf" = xauto ; then
+ if test -x /usr/sbin/svcadm && test -x /usr/sbin/svccfg && test -x /usr/bin/svcs ; then
+ solarissmf="yes"
+ else
+ case "${solarispkg_ips}${solarispkg_svr4}" in
+ *yes*) solarisinit="yes" ;; dnl Want to install so we can generally package
+ *) solarissmf="no" ;; dnl Target not solarish
+ esac
+ fi
+fi
+AC_MSG_RESULT([${solarissmf}])
+AM_CONDITIONAL(WITH_SOLARIS_SMF, test x"$solarissmf" = x"yes")
+
+
+AC_MSG_CHECKING(whether to install Solaris SVR4 (legacy) init-script files)
+solarisinit="auto"
+AC_ARG_WITH([solaris-init],
+ AS_HELP_STRING([--with-solaris-init=(yes|auto|no)], [Enable installation of NUT legacy init-scripts for Solaris/illumos (auto)]),
+[
+ case "${withval}" in
+ auto|"")
+ solarisinit="auto"
+ ;;
+ yes|no)
+ solarisinit="${withval}"
+ ;;
+ *)
+ AC_MSG_ERROR([Unexpected argument for --with-solaris-init=${withval}])
+ ;;
+ esac
+], [])
+
+if test x"$solarisinit" = xauto ; then
+ dnl Depends on usability of SMF or making for packaging
+ case "${solarispkg_ips}${solarispkg_svr4}" in
+ *yes*) solarisinit="yes" ;; dnl Want to install so we can generally package
+ *)
+ case ${target_os} in
+ solaris*|sunos*|SunOS*|illumos*)
+ if test "$solarissmf" = x"yes" ; then
+ dnl no need on modern OSes
+ solarisinit="no"
+ else
+ solarisinit="yes"
+ fi
+ ;;
+ *) solarisinit="no" ;; dnl Some other OS
+ esac
+ ;;
+ esac
+fi
+AC_MSG_RESULT([${solarisinit}])
+AM_CONDITIONAL(WITH_SOLARIS_INIT, test x"$solarisinit" = x"yes")
+
dnl Note: Currently there is no reliable automatic detection -
dnl users have to ask they want systemd units installed, or
dnl risk auto-detection like seen below.
diff --git a/scripts/Solaris/Makefile.am b/scripts/Solaris/Makefile.am
--- a/scripts/Solaris/Makefile.am 2022-04-23 13:56:07.000000000 +0200
+++ b/scripts/Solaris/Makefile.am 2023-01-25 19:46:38.925491136 +0100
@@ -29,8 +29,10 @@ sbin_SCRIPTS = ../upsdrvsvcctl/upsdrvsvc
SOLARIS_CHECK_TARGETS += check-local-solaris-smf
endif
+if WITH_SOLARIS_INIT
solarisinitscriptdir = @datadir@/solaris-init
solarisinitscript_SCRIPTS = nut
+endif
SOLARIS_PACKAGE_TARGETS =

View File

@ -1,8 +1,7 @@
Index: nut-2.7.4/docs/Makefile.am
===================================================================
--- nut-2.7.4.orig/docs/Makefile.am
+++ nut-2.7.4/docs/Makefile.am
@@ -165,8 +165,8 @@ packager-guide.html packager-guide.chunk
diff -purN a/docs/Makefile.am b/docs/Makefile.am
--- a/docs/Makefile.am 2023-10-16 10:06:18.000000000 +0200
+++ b/docs/Makefile.am 2023-11-03 19:40:55.360576893 +0100
@@ -248,8 +248,8 @@ solaris-usb.html solaris-usb.chunked sol
A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) \
--attribute=icons \
--xsltproc-opts="--nonet" \
@ -11,13 +10,12 @@ Index: nut-2.7.4/docs/Makefile.am
+ --xsltproc-opts "--stringparam nut.localdate \"`TZ=UTC date +%Y-%m-%d -r $(top_srcdir)/ChangeLog`\"" \
+ --xsltproc-opts "--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S -r $(top_srcdir)/ChangeLog`\"" \
--xsltproc-opts="--stringparam nut.nutversion \"@PACKAGE_VERSION@\"" \
--attribute=docinfodir="$(builddir)" \
--attribute=iconsdir="$(srcdir)/images" \
--attribute=badges \
Index: nut-2.7.4/docs/man/Makefile.am
===================================================================
--- nut-2.7.4.orig/docs/man/Makefile.am
+++ nut-2.7.4/docs/man/Makefile.am
@@ -924,8 +924,8 @@ if HAVE_ASCIIDOC
diff -purN a/docs/man/Makefile.am b/docs/man/Makefile.am
--- a/docs/man/Makefile.am 2023-10-24 10:45:21.000000000 +0200
+++ b/docs/man/Makefile.am 2023-11-03 19:41:55.114481978 +0100
@@ -999,8 +999,8 @@ DOCBUILD_END = { \
echo " DOC-MAN-HTML Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(ASCIIDOC) --backend=xhtml11 $${A2X_VERBOSE} \
@ -26,5 +24,5 @@ Index: nut-2.7.4/docs/man/Makefile.am
+ --attribute localdate=`TZ=UTC date +%Y-%m-%d -r $(top_srcdir)/ChangeLog` \
+ --attribute localtime=`TZ=UTC date +%H:%M:%S -r $(top_srcdir)/ChangeLog` \
--attribute nutversion="@PACKAGE_VERSION@" \
--attribute srcdir="$(abs_srcdir)" \
--attribute builddir="$(abs_builddir)" \
--attribute srcdir="$(abs_srcdir)/" \
--attribute builddir="$(abs_builddir)/" \

View File

@ -1,10 +1,10 @@
--- a/conf/upsmon.conf.sample.in
+++ b/conf/upsmon.conf.sample.in
@@ -312,6 +312,15 @@
# IGNORE - Don't do anything
diff -purN a/conf/upsmon.conf.sample.in b/conf/upsmon.conf.sample.in
--- a/conf/upsmon.conf.sample.in 2023-10-28 23:36:02.000000000 +0200
+++ b/conf/upsmon.conf.sample.in 2023-11-03 19:38:24.015393331 +0100
@@ -364,6 +364,15 @@ POWERDOWNFLAG "@POWERDOWNFLAG@"
#
# If you use IGNORE, don't use any other flags on the same line.
+#
+NOTIFYFLAG ONLINE SYSLOG
+NOTIFYFLAG COMMOK SYSLOG
+NOTIFYFLAG SHUTDOWN SYSLOG
@ -13,6 +13,7 @@
+NOTIFYFLAG FSD SYSLOG+WALL
+NOTIFYFLAG NOCOMM SYSLOG+WALL
+NOTIFYFLAG COMMBAD SYSLOG+WALL
+
# --------------------------------------------------------------------------
# RBWARNTIME - replace battery warning time in seconds
# OFFDURATION - put "OFF" state into effect if it persists for this many seconds
#

View File

@ -1,41 +1,45 @@
--- a/conf/hosts.conf.sample
+++ b/conf/hosts.conf.sample
diff -purN a/conf/hosts.conf.sample b/conf/hosts.conf.sample
--- a/conf/hosts.conf.sample 2023-02-28 13:49:32.000000000 +0100
+++ b/conf/hosts.conf.sample 2023-11-03 19:28:46.048488997 +0100
@@ -27,3 +27,5 @@
# MONITOR myups@localhost "Local UPS"
# MONITOR su2200@10.64.1.1 "Finance department"
# MONITOR matrix@shs-server.example.edu "Sierra High School data room #1"
+
+MONITOR myups@localhost "Local UPS"
--- a/conf/ups.conf.sample
+++ b/conf/ups.conf.sample
@@ -200,3 +200,8 @@
diff -purN a/conf/ups.conf.sample b/conf/ups.conf.sample
--- a/conf/ups.conf.sample 2023-10-28 23:02:42.000000000 +0200
+++ b/conf/ups.conf.sample 2023-11-03 19:29:35.641548694 +0100
@@ -214,3 +214,8 @@ maxretry = 3
#
# To find out if your driver supports any extra settings, start it with
# the -h option and/or read the driver's documentation.
+
+[myups]
+ driver = undefined
+ port = /dev/undefined
+ desc = "Local UPS"
--- a/conf/upsd.users.sample
+++ b/conf/upsd.users.sample
@@ -73,3 +73,11 @@
#
# See comments in the upsmon.conf(.sample) file for details about this
# keyword and the difference of NUT secondary and primary systems.
+ driver = undefined
+ port = /dev/undefined
+ desc = "Local UPS"
diff -purN a/conf/upsd.conf.sample b/conf/upsd.conf.sample
--- a/conf/upsd.conf.sample 2023-09-17 16:34:05.000000000 +0200
+++ b/conf/upsd.conf.sample 2023-11-03 19:30:18.374644467 +0100
@@ -183,3 +183,11 @@
# or CLI options, regardless of older logging level being higher or lower
# than the newly found number; a missing (or commented away) value however
# does not change the previously active logging verbosity.
+
+[upsmaster]
+ password = @UPSD_INITIAL_MASTER_PASSWORD@
+ upsmon master
+ password = @UPSD_INITIAL_MASTER_PASSWORD@
+ upsmon master
+
+[upsslave]
+ password = @UPSD_INITIAL_SLAVE_PASSWORD@
+ upsmon slave
--- a/conf/upsmon.conf.sample.in
+++ b/conf/upsmon.conf.sample.in
@@ -116,6 +116,8 @@
# MONITOR su700@server.example.com 1 upsmon secretpass secondary
# MONITOR myups@localhost 1 upsmon pass primary # (or secondary)
+ password = @UPSD_INITIAL_SLAVE_PASSWORD@
+ upsmon slave
diff -purN a/conf/upsmon.conf.sample.in b/conf/upsmon.conf.sample.in
--- a/conf/upsmon.conf.sample.in 2023-10-28 23:36:02.000000000 +0200
+++ b/conf/upsmon.conf.sample.in 2023-11-03 19:25:57.482732658 +0100
@@ -117,6 +117,8 @@
# MONITOR su700@server.example.com 1 monuser secretpass secondary
# MONITOR myups@localhost 1 monuser pass primary # (or secondary)
+MONITOR myups@localhost 1 upsmaster @UPSD_INITIAL_MASTER_PASSWORD@ master
+

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sat Nov 4 16:30:32 UTC 2023 - Arjen de Korte <suse+build@de-korte.org>
- Update to version 2.8.1
For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
(the list of changes is too long to list).
- Remove obsolete patch:
* nut-Solaris-init-files.patch
-------------------------------------------------------------------
Thu Jul 6 20:29:12 UTC 2023 - Antonio Teixeira <antonio.teixeira@suse.com>

View File

@ -55,7 +55,7 @@
%bcond_with libfreeipmi
%endif
Name: nut
Version: 2.8.0
Version: 2.8.1
Release: 0
Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring)
License: GPL-2.0-or-later
@ -71,8 +71,6 @@ Patch0: nut-preconfig.patch
Patch1: nut-notifyflag.patch
# PATCH-FEATURE-OPENSUSE nut-doc-fixed-date.patch sbrabec@suse.cz -- Make doc builds reproducible.
Patch2: nut-doc-fixed-date.patch
# PATCH-FIX-UPSTREAM - do not install Solaris init files uninvited
Patch3: nut-Solaris-init-files.patch
Patch10: harden_nut-driver.service.patch
Patch11: harden_nut-monitor.service.patch
Patch12: harden_nut-server.service.patch
@ -92,6 +90,7 @@ BuildRequires: pkgconfig(avahi-core)
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(gdlib)
BuildRequires: pkgconfig(libgpiod) >= 1.0.0
BuildRequires: pkgconfig(libpowerman)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libusb-1.0)
@ -369,7 +368,6 @@ ln -s service %{buildroot}%{_sbindir}/rcnut-driver
ln -s service %{buildroot}%{_sbindir}/rcnut-server
ln -s service %{buildroot}%{_sbindir}/rcnut-monitor
rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample
mv %{buildroot}%{_tmpfilesdir}/nut-common.{tmpfiles,conf}
install -D -m 750 %{SOURCE6} %{buildroot}%{systemdsystemdutildir}/system-sleep/%{name}.sh
install -D -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
@ -419,7 +417,7 @@ fi
# And finally trigger udev to set permissions according to newly installed rules files.
udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%service_add_post nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target
%tmpfiles_create %{_tmpfilesdir}/%{name}-common.conf
%tmpfiles_create %{_tmpfilesdir}/%{name}-common-tmpfiles.conf
%preun
%service_del_preun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target
@ -444,7 +442,7 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%endif
%files
%doc AUTHORS ChangeLog MAINTAINERS NEWS README README.SUSE UPGRADING
%doc AUTHORS ChangeLog MAINTAINERS NEWS.adoc README.adoc README.SUSE UPGRADING.adoc
%license COPYING
%config %{_sysconfdir}/logrotate.d/*
%{_bindir}/*
@ -455,6 +453,7 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%exclude %{_mandir}/man8/snmp-ups*.*
%dir %{_libexecdir}/ups
%{_libexecdir}/nut-driver-enumerator.sh
%python_sitearch/PyNUT.py
%{_sbindir}/*
%{_udevrulesdir}/*.rules
%config(noreplace) %{CONFPATH}/hosts.conf
@ -477,9 +476,9 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{systemdsystemdutildir}/system-shutdown/*
%{systemdsystemdutildir}/system-sleep/%{name}.sh
%{bashcompletionsdir}/*
%{_tmpfilesdir}/%{name}-common.conf
%{_tmpfilesdir}/%{name}-common-tmpfiles.conf
%ghost %{_rundir}/%{name}
%ghost %attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}/%{name}
%ghost %attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}/upssched
%files drivers-net
%{MODELPATH}/snmp-ups
@ -509,7 +508,9 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_includedir}/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_libexecdir}/sockdebug
%{_mandir}/man3/*%{ext_man}
%python_sitearch/test_nutclient.py
%files doc-asciidoc
%doc %dir %{_docdir}/%{name}{,/cables}
@ -520,8 +521,10 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_docdir}/%{name}/developer-guide.html
%files doc-html
%{_docdir}/%{name}/ChangeLog.html
%{_docdir}/%{name}/FAQ.html
%{_docdir}/%{name}/cables.html
%{_docdir}/%{name}/release-notes.html
%{_docdir}/%{name}/solaris-usb.html
%{_docdir}/%{name}/user-manual.html
%{_docdir}/%{name}/*.css