Accepting request 1062385 from home:adkorte:branches:hardware

- Update to version 2.8.0
  For more see NEWS and UPGRADING in /usr/share/doc/packages/nut.
  * NUT now supports more i2c and modbus devices, as well as libusb-1.0
    support as an alternative to earlier libusb-0.1 (so new
    dependency-based categories of packages for drivers may be due).
  * NUT Python modules and scripts (e.g. NUT-Monitor variants) should
    work with python-2.7 and with python-3.x, so covering historic
    distro releases as well as new ones (and so your distro can deliver
    one or both, probably in several packages with different
    dependencies in the latter case).
  * NUT provides revised reference systemd and SMF service unit
    definitions, including support of drivers wrapped into individual
    service instances with varying dependencies based on different
    media required (networked stack, USB stack, etc.), and many daemons
    include -F option for running "in foreground" to avoid extra
    forking after one already done by a service framework - you may
    want to use those in your packaged deliverables.
  * NUT newly provides the "nut-driver-enumerator" script and service,
    which allows it to follow edition of ups.conf and dynamically
    define+(re)start and stop+undefine service instances for drivers -
    there are several ways it can be integrated for different
    use-cases.
  * Yhere are several new configuration keywords and CLI options - so
    while new NUT builds should work with old configs and scripts, the
    opposite is not necessarily true (old binaries may reject
    configurations taking advantage of new features).
  * There are several new protocol keywords - but old and new NUT
    daemons (data server and clients) should be able to communicate
    both ways.
  * It is assumed that API/ABI changes may require third-party NUT
    clients (library consumers of libnutclient, libupsclient,
    libnutscan... -- their version info was bumped accordingly) to get
    rebuilt, in order to work with the new NUT release in a stable
    fashion.
  * The dummy-ups driver used in automated testing now processes *.dev
    filename patterns once and does not loop, like it still does for
    *.seq and other files (by default).
  * USB code is now more strict about logical minimum/maximum ranges
    for data reported from devices, and some devices were already found
    to make mistakes - so there is also a mechanism for turning a blind
    eye to known issues and fix-up such report descriptors to produce
    intended sane values.
  * New documentation page docs/config-prereqs.txt highlights packaged
    dependencies installable on a large range of platforms to build as
    much of NUT as possible (incidentally, ones NUT CI farm uses to
    test every iteration).
- Remove upstreamed and obsolete patches:
  * nut-doc-cables.patch
  * nut-systemd-dirs.patch
  * nut-upssched.patch
  * nutscanner-ftbfs.patch
  * openssl-1_1.patch
  * reproducible.patch
  * use-pkg-config-gdlib.diff
- Source is no longer GPG signed, so keyring is not needed anymore
  * nut.keyring
- Unused additional source file removed (was added as a source, but
  not packaged)
  * nut.sleep
- Don't install Solaris init files univited (PR#
  * nut-Solaris-init-files.patch

OBS-URL: https://build.opensuse.org/request/show/1062385
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=101
This commit is contained in:
Sascha Weber 2023-02-06 16:03:16 +00:00 committed by Git OBS Bridge
parent 55c707f53d
commit f2f4762950
23 changed files with 422 additions and 616 deletions

View File

@ -1,9 +1,9 @@
Index: nut-2.7.4/scripts/systemd/nut-driver.service.in
===================================================================
--- nut-2.7.4.orig/scripts/systemd/nut-driver.service.in
+++ nut-2.7.4/scripts/systemd/nut-driver.service.in
@@ -4,6 +4,17 @@ After=local-fs.target network.target
StopWhenUnneeded=yes
--- a/scripts/systemd/nut-driver@.service.in
+++ b/scripts/systemd/nut-driver@.service.in
@@ -38,6 +38,17 @@
# Finally note that "nut-driver-enumerator.service" should take care of this.
[Service]
+# added automatically, for details please see
@ -17,6 +17,6 @@ Index: nut-2.7.4/scripts/systemd/nut-driver.service.in
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
ExecStart=@SBINDIR@/upsdrvctl start
ExecStop=@SBINDIR@/upsdrvctl stop
Type=forking
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,9 +1,9 @@
Index: nut-2.7.4/scripts/systemd/nut-monitor.service.in
===================================================================
--- nut-2.7.4.orig/scripts/systemd/nut-monitor.service.in
+++ nut-2.7.4/scripts/systemd/nut-monitor.service.in
@@ -3,6 +3,17 @@ Description=Network UPS Tools - power de
After=local-fs.target network.target nut-server.service
--- a/scripts/systemd/nut-monitor.service.in
+++ b/scripts/systemd/nut-monitor.service.in
@@ -3,6 +3,17 @@
PartOf=nut.target
[Service]
+# added automatically, for details please see
@ -17,6 +17,6 @@ Index: nut-2.7.4/scripts/systemd/nut-monitor.service.in
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
ExecStart=@SBINDIR@/upsmon
PIDFile=@PIDPATH@/upsmon.pid
Type=forking
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
ExecStart=@SBINDIR@/upsmon -F

View File

@ -2,8 +2,8 @@ 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
@@ -8,6 +8,17 @@ Wants=nut-driver.service
Before=nut-monitor.service
@@ -18,6 +18,17 @@
PartOf=nut.target
[Service]
+# added automatically, for details please see
@ -17,6 +17,6 @@ Index: nut-2.7.4/scripts/systemd/nut-server.service.in
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
ExecStart=@SBINDIR@/upsd
Type=forking
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
# Note: foreground mode by default skips writing a PID file (and

View File

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

Binary file not shown.

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

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

1
nut-2.8.0.tar.gz.sha256 Normal file
View File

@ -0,0 +1 @@
c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5 nut-2.8.0.tar.gz

View File

@ -0,0 +1,156 @@
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,18 +0,0 @@
Index: nut-2.7.4/docs/Makefile.am
===================================================================
--- nut-2.7.4.orig/docs/Makefile.am
+++ nut-2.7.4/docs/Makefile.am
@@ -46,11 +46,13 @@ EXTRA_DIST = $(ALL_TXT_SRC) $(SHARED_DEP
ASCIIDOC_HTML_SINGLE = user-manual.html \
developer-guide.html \
packager-guide.html \
+ cables.html \
FAQ.html
ASCIIDOC_HTML_CHUNKED = user-manual.chunked \
developer-guide.chunked \
packager-guide.chunked \
+ cables.html \
FAQ.html
ASCIIDOC_PDF = user-manual.pdf \

View File

@ -2,29 +2,29 @@ Index: nut-2.7.4/docs/Makefile.am
===================================================================
--- nut-2.7.4.orig/docs/Makefile.am
+++ nut-2.7.4/docs/Makefile.am
@@ -92,8 +92,8 @@ packager-guide.html packager-guide.chunk
# $ ASCIIDOC_VERBOSE=-v make
A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) --attribute icons \
--xsltproc-opts "--nonet" \
- --xsltproc-opts "--stringparam nut.localdate \"`TZ=UTC date +%Y-%m-%d`\"" \
- --xsltproc-opts "--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S`\"" \
@@ -165,8 +165,8 @@ packager-guide.html packager-guide.chunk
A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) \
--attribute=icons \
--xsltproc-opts="--nonet" \
- --xsltproc-opts="--stringparam nut.localdate \"`TZ=UTC date +%Y-%m-%d`\"" \
- --xsltproc-opts="--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S`\"" \
+ --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 iconsdir=$(srcdir)/images \
--xsltproc-opts="--stringparam nut.nutversion \"@PACKAGE_VERSION@\"" \
--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
@@ -591,8 +591,8 @@ if HAVE_ASCIIDOC
.txt.html:
$(ASCIIDOC) --backend=xhtml11 \
- --attribute localdate=`TZ=UTC date +%Y-%m-%d` \
- --attribute localtime=`TZ=UTC date +%H:%M:%S` \
@@ -924,8 +924,8 @@ if HAVE_ASCIIDOC
echo " DOC-MAN-HTML Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(ASCIIDOC) --backend=xhtml11 $${A2X_VERBOSE} \
- --attribute localdate="`TZ=UTC date +%Y-%m-%d`" \
- --attribute localtime="`TZ=UTC date +%H:%M:%S`" \
+ --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@" \
-o $@ $<
--attribute srcdir="$(abs_srcdir)" \
--attribute builddir="$(abs_builddir)" \

View File

@ -1,6 +1,6 @@
--- conf/upsmon.conf.sample.in
+++ conf/upsmon.conf.sample.in
@@ -243,6 +243,15 @@
--- a/conf/upsmon.conf.sample.in
+++ b/conf/upsmon.conf.sample.in
@@ -312,6 +312,15 @@
# IGNORE - Don't do anything
#
# If you use IGNORE, don't use any other flags on the same line.

View File

@ -1,14 +1,14 @@
--- conf/hosts.conf.sample
+++ conf/hosts.conf.sample
--- a/conf/hosts.conf.sample
+++ b/conf/hosts.conf.sample
@@ -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"
--- conf/ups.conf.sample
+++ conf/ups.conf.sample
@@ -102,3 +102,8 @@
--- a/conf/ups.conf.sample
+++ b/conf/ups.conf.sample
@@ -200,3 +200,8 @@
#
# To find out if your driver supports any extra settings, start it with
# the -h option and/or read the driver's documentation.
@ -17,12 +17,12 @@
+ driver = undefined
+ port = /dev/undefined
+ desc = "Local UPS"
--- conf/upsd.users.sample
+++ conf/upsd.users.sample
@@ -62,3 +62,11 @@
# The matching MONITOR line in your upsmon.conf would look like this:
--- a/conf/upsd.users.sample
+++ b/conf/upsd.users.sample
@@ -73,3 +73,11 @@
#
# MONITOR myups@localhost 1 upsmon pass master (or slave)
# See comments in the upsmon.conf(.sample) file for details about this
# keyword and the difference of NUT secondary and primary systems.
+
+[upsmaster]
+ password = @UPSD_INITIAL_MASTER_PASSWORD@
@ -31,11 +31,11 @@
+[upsslave]
+ password = @UPSD_INITIAL_SLAVE_PASSWORD@
+ upsmon slave
--- conf/upsmon.conf.sample.in
+++ conf/upsmon.conf.sample.in
@@ -84,6 +84,8 @@
# MONITOR su700@server.example.com 1 upsmon secretpass slave
# MONITOR myups@localhost 1 upsmon pass master (or 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)
+MONITOR myups@localhost 1 upsmaster @UPSD_INITIAL_MASTER_PASSWORD@ master
+

View File

@ -1,18 +0,0 @@
Index: nut-2.7.3/configure.ac
===================================================================
--- nut-2.7.3.orig/configure.ac
+++ nut-2.7.3/configure.ac
@@ -1065,7 +1065,12 @@ dnl Override installation directory, wit
dnl prefix. This is needed for 'distcheck*' targets, otherwise
dnl files will try to get intalled to the actual system directories
if test -n "${systemdsystemunitdir}"; then
- systemdsystemshutdowndir="${libdir}/systemd/system-shutdown"
+ systemdutildir=`$PKG_CONFIG --variable=systemdutildir systemd`
+ if test -n "${systemdutildir}"; then
+ systemdsystemshutdowndir="${systemdutildir}/system-shutdown"
+ else
+ systemdsystemshutdowndir="${systemdsystemunitdir}/system-shutdown"
+ fi
AC_MSG_RESULT(using ${systemdsystemunitdir})
else
AC_MSG_RESULT(no)

View File

@ -1,13 +0,0 @@
diff --git a/clients/upssched.c b/clients/upssched.c
index 97b3ed42..3fdf118e 100644
--- a/clients/upssched.c
+++ b/clients/upssched.c
@@ -794,7 +794,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd,
}
if (!strcmp(cmd, "EXECUTE")) {
- if (ca1 == '\0') {
+ if (*ca1 == '\0') {
upslogx(LOG_ERR, "Empty EXECUTE command argument");
return;
}

View File

@ -1,3 +1,68 @@
-------------------------------------------------------------------
Mon Jan 23 22:09:31 UTC 2023 - Arjen de Korte <suse+build@de-korte.org>
- Update to version 2.8.0
For more see NEWS and UPGRADING in /usr/share/doc/packages/nut.
* NUT now supports more i2c and modbus devices, as well as libusb-1.0
support as an alternative to earlier libusb-0.1 (so new
dependency-based categories of packages for drivers may be due).
* NUT Python modules and scripts (e.g. NUT-Monitor variants) should
work with python-2.7 and with python-3.x, so covering historic
distro releases as well as new ones (and so your distro can deliver
one or both, probably in several packages with different
dependencies in the latter case).
* NUT provides revised reference systemd and SMF service unit
definitions, including support of drivers wrapped into individual
service instances with varying dependencies based on different
media required (networked stack, USB stack, etc.), and many daemons
include -F option for running "in foreground" to avoid extra
forking after one already done by a service framework - you may
want to use those in your packaged deliverables.
* NUT newly provides the "nut-driver-enumerator" script and service,
which allows it to follow edition of ups.conf and dynamically
define+(re)start and stop+undefine service instances for drivers -
there are several ways it can be integrated for different
use-cases.
* Yhere are several new configuration keywords and CLI options - so
while new NUT builds should work with old configs and scripts, the
opposite is not necessarily true (old binaries may reject
configurations taking advantage of new features).
* There are several new protocol keywords - but old and new NUT
daemons (data server and clients) should be able to communicate
both ways.
* It is assumed that API/ABI changes may require third-party NUT
clients (library consumers of libnutclient, libupsclient,
libnutscan... -- their version info was bumped accordingly) to get
rebuilt, in order to work with the new NUT release in a stable
fashion.
* The dummy-ups driver used in automated testing now processes *.dev
filename patterns once and does not loop, like it still does for
*.seq and other files (by default).
* USB code is now more strict about logical minimum/maximum ranges
for data reported from devices, and some devices were already found
to make mistakes - so there is also a mechanism for turning a blind
eye to known issues and fix-up such report descriptors to produce
intended sane values.
* New documentation page docs/config-prereqs.txt highlights packaged
dependencies installable on a large range of platforms to build as
much of NUT as possible (incidentally, ones NUT CI farm uses to
test every iteration).
- Remove upstreamed and obsolete patches:
* nut-doc-cables.patch
* nut-systemd-dirs.patch
* nut-upssched.patch
* nutscanner-ftbfs.patch
* openssl-1_1.patch
* reproducible.patch
* use-pkg-config-gdlib.diff
- Source is no longer GPG signed, so keyring is not needed anymore
* nut.keyring
- Unused additional source file removed (was added as a source, but
not packaged)
* nut.sleep
- Don't install Solaris init files univited (PR#
* nut-Solaris-init-files.patch
-------------------------------------------------------------------
Wed May 11 23:01:34 UTC 2022 - Stanislav Brabec <sbrabec@suse.com>

View File

@ -1,135 +0,0 @@
pub 1024D/204DDF1B 2002-07-15
uid [ unknown] Arnaud Quette <aquette@debian.org>
uid [ unknown] Arnaud Quette <aquette.dev@gmail.com>
uid [ unknown] Arnaud Quette <arnaud.quette@free.fr>
uid [ unknown] Arnaud Quette <arnaud.quette@debian.org>
uid [ unknown] Arnaud Quette <arnaud.quette@mgeups.com>
uid [ unknown] Arnaud Quette <ArnaudQuette@Eaton.com>
sub 1024g/D8B1B6B4 2002-07-15
pub 4096R/55CA5976 2014-04-22
uid [ unknown] Arnaud Quette <arnaud.quette@free.fr>
uid [ unknown] Arnaud Quette <aquette@debian.org>
sub 4096R/F3AA7FEA 2014-04-22
sub 4096R/0E515A22 2014-04-22
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQGiBD0y56QRBACYMNr6RbAfj3T7ZoAyUWjofb/n5HalrHo7utL8V5qpbF0U95dJ
5KNXMzkSe79qviz5O8Np4UJdyzjbb1JSKdSiH56a08E/siJkwJ3c9b4eWCHB7Rq3
2nWWyeF2um/Sk9OqFPDp/3YPJIGxAYCNXMJWYDjVSRmyTkyt7q0cY+uZmwCgxxwv
r8LoVOXfRfSeG41wp/3tIeMD/iuUmvpr9yRWKDlbAuhLEFRhzzcmWFezIUN8a1fW
BmKxnbEcUkdOyrQMypXURWEnr2tYPOoGyq670xrwoWMCS7DhfQnUeFV0IANOvUZA
SOCY8EsiiD3r05LjGEudbnvP2Ol0G5G46IEC2gwNsQlvFZhf+lGG2obFGnIFTi2o
RhmxBACPemrbn3DoiPKwTpxoLsg5+s75InMDsPVe15TfxrDrXotsoT7rya5wjAIu
aCqPlwI/RLweii1EZLFuBS9T1VO4k3uFXn8Ud9RuqhZnL45Ghw5dDPNnB8zTgqBP
h9H1zNl+zPgN0DEZUTg9HZWfVFEfdEu/U6cr48tGk8gWefOB9rQiQXJuYXVkIFF1
ZXR0ZSA8YXF1ZXR0ZUBkZWJpYW4ub3JnPohhBBMRAgAhAhs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/HtP
fEyLhA4AVBWfpsrHq7wuszujNeUPDBHbgGzRfGbHAf9DWjT7hzh5d+R6s5Q1avrp
lhUxvX4kBkjkk56cSqWb7CbBYM6iX+acnLwAmsbNhAHkB1rzQQq+KsRRwBGE0qDy
TLTnQaDcKCVmzNQIYPD0JnHhtrHRtVpbuXQCUzv42OA4ztME1TYs+xGhzK25AA9b
uWgVOonVp6LCCeeBkrsUSxuTZOZ6RNWz/cYDOMQAVfEx/tNWLBUT2uzDIyRfSzzZ
8HUycO9Cj6vY+JQf+TAi0KSDKXUK4p6C3NloeEt4cDpSkPgzNGHFqXBgWLTpv+GA
1Fl1SNx/VNIXb2ScB4cMtnHgIs9z4d7t
=H4gS
-----END PGP PUBLIC KEY BLOCK-----

6
nut.rpmlintrc Normal file
View File

@ -0,0 +1,6 @@
addFilter("binary-or-shlib-calls-gethostbyname /usr/libexec/ups/driver/apcupsd-ups")
addFilter("logrotate-log-dir-not-packaged /var/log$")
addFilter("obsolete-not-provided nut-devel-doc-pdf")
addFilter("obsolete-not-provided nut-doc-pdf")
addFilter("obsolete-not-provided nut-hal")
addFilter("potential-bashisms /usr/libexec/nut-driver-enumerator.sh")

View File

@ -1,22 +0,0 @@
#!/bin/bash
. /usr/lib/pm-utils/functions
case "$1" in
hibernate)
stopservice upsd
sleep 2
if test -n "$POWERDOWNFLAG" -a -f "$POWERDOWNFLAG" ; then
export UPSD_POWERDOWN_CONDITION=1
/etc/init.d/upsd try-powerdown
fi
;;
suspend)
stopservice upsd
;;
thaw|resume)
restartservice upsd
;;
*)
;;
esac

241
nut.spec
View File

@ -1,7 +1,7 @@
#
# spec file for package nut
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,10 +16,8 @@
#
%bcond_with texdoc
%define CGIPATH %{apache_serverroot}/cgi-bin/nut
%define HTMLPATH %{apache_serverroot}/htdocs/nut
%define CGIPATH %{apache_serverroot}/cgi-bin/%{name}
%define HTMLPATH %{apache_serverroot}/htdocs/%{name}
%define MODELPATH %{_libexecdir}/ups/driver
%define STATEPATH %{_localstatedir}/lib/ups
%define CONFPATH %{_sysconfdir}/ups
@ -35,57 +33,67 @@
%define USBNONHIDDRIVERS %(zcat %{SOURCE0} | tr a-z A-Z | grep -a -A1 _USB | sed -n 's/.*ATTR{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, ATTR{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ')
%define systemdsystemdutildir %(pkg-config --variable=systemdutildir systemd)
%define bashcompletionsdir %(pkg-config bash-completion --variable=completionsdir)
%bcond_with texdoc
%if 0%{?suse_version} >= 1500
%bcond_without libi2c
%else
%bcond_with libi2c
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
%bcond_without libmodbus
%else
%bcond_with libmodbus
%endif
%if 0%{?suse_version} == 1500
%bcond_without libnsl
%else
%bcond_with libnsl
%endif
%ifarch %{ix86} x86_64 ia64
%bcond_without libfreeipmi
%else
%bcond_with libfreeipmi
%endif
Name: nut
Version: 2.7.4
Version: 2.8.0
Release: 0
Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring)
License: GPL-2.0-or-later
Group: Hardware/UPS
URL: http://www.networkupstools.org/
Source: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz
URL: https://www.networkupstools.org/
Source0: https://github.com/networkupstools/nut/releases/download/v2.8.0/%{name}-%{version}.tar.gz
Source1: https://github.com/networkupstools/nut/releases/download/v2.8.0/%{name}-%{version}.tar.gz.sha256
Source2: README.SUSE
Source3: nut.rpmlintrc
Source6: nut.system-sleep
Source7: nut.sleep
Source8: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz.sig
Source9: %{name}.keyring
Patch0: nut-preconfig.patch
Patch3: nut-notifyflag.patch
# PATCH-FIX-UPSTREAM nut-systemd-dirs.patch sbrabec@suse.cz -- Fix systemd targets.
Patch7: nut-systemd-dirs.patch
Patch1: nut-notifyflag.patch
# PATCH-FEATURE-OPENSUSE nut-doc-fixed-date.patch sbrabec@suse.cz -- Make doc builds reproducible.
Patch8: nut-doc-fixed-date.patch
# PATCH-FIX-UPSTREAM nut-doc-cables.patch sbrabec@suse.cz -- Build HTML documentation of cables.
Patch9: nut-doc-cables.patch
# PATCH-FIX-UPSTREAM use-pkg-config-gdlib.diff alarrosa@suse.com -- Use pkg-config to obtain CFLAGS and LDFLAGS to use when building with gd
Patch10: use-pkg-config-gdlib.diff
Patch11: openssl-1_1.patch
Patch12: nut-upssched.patch
Patch13: reproducible.patch
Patch14: nutscanner-ftbfs.patch
Patch15: harden_nut-driver.service.patch
Patch16: harden_nut-monitor.service.patch
Patch17: harden_nut-server.service.patch
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
BuildRequires: apache-rpm-macros
BuildRequires: asciidoc
BuildRequires: avahi-devel
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libcppunit-devel
BuildRequires: libtool
%if 0%{?suse_version} >= 1500
BuildRequires: libnsl-devel
%endif
BuildRequires: libusb-devel
BuildRequires: libxml2-tools
BuildRequires: libxslt-tools
BuildRequires: net-snmp-devel
BuildRequires: pkgconfig
BuildRequires: source-highlight
BuildRequires: tcpd-devel
BuildRequires: pkgconfig(avahi-client)
BuildRequires: pkgconfig(avahi-core)
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(gdlib)
BuildRequires: pkgconfig(libpowerman)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(neon)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(udev)
@ -101,12 +109,17 @@ Provides: nut-classic = %{version}
Obsoletes: nut-classic < %{version}
Obsoletes: nut-hal < %{version}
%{?systemd_requires}
BuildRequires: pkgconfig(bash-completion)
%ifarch %{ix86} x86_64 ia64
%if %{with libfreeipmi}
BuildRequires: pkgconfig(libfreeipmi)
%endif
%if 0%{?suse_version} >= 1500
Requires(pre): user(upsd)
%if %{with libi2c}
BuildRequires: libi2c0-devel
%endif
%if %{with libmodbus}
BuildRequires: pkgconfig(libmodbus)
%endif
%if %{with libnsl}
BuildRequires: pkgconfig(libnsl)
%endif
%if %{with texdoc}
BuildRequires: asciidoc-latex-backend
@ -115,6 +128,10 @@ BuildRequires: asciidoc-latex-backend
Obsoletes: %{name}-devel-doc-pdf <= %{version}
Obsoletes: %{name}-doc-pdf <= %{version}
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: source-highlight
Requires(pre): user(upsd)
%endif
%description
Core package of Network UPS Tools.
@ -135,34 +152,45 @@ together with nut to provide UPS networking support.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libnutclient0
%package -n libnutclient2
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libnutclient0
%description -n libnutclient2
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libnutscan1
%package -n libnutscan2
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libnutscan1
%description -n libnutscan2
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libupsclient4
%package -n libupsclient6
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libupsclient4
%description -n libupsclient6
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libnutclientstub1
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libnutclientstub1
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
@ -173,7 +201,7 @@ Summary: Network UPS Tools Web Server Support (UPS Status Pages)
Group: Hardware/UPS
Requires: %{name} = %{version}
Enhances: %{name}
Supplements: packageand(%{name}:apache2)
Supplements: (%{name} and apache2)
%description cgi
Web server support package for the Network UPS Tools.
@ -186,10 +214,11 @@ interface for monitoring and administering UPS hardware.
%package devel
Summary: Network UPS Tools (Uninterruptible Power Supply Monitoring)
Group: Development/Libraries/C and C++
Requires: libnutclient0 = %{version}-%{release}
Requires: libnutscan1 = %{version}-%{release}
Requires: libupsclient4 = %{version}-%{release}
Requires: openssl-devel
Requires: libnutclient2 = %{version}-%{release}
Requires: libnutclientstub1 = %{version}-%{release}
Requires: libnutscan2 = %{version}-%{release}
Requires: libupsclient6 = %{version}-%{release}
Requires: pkgconfig(openssl)
%description devel
Network UPS Tools is a collection of programs which provide a common
@ -280,87 +309,72 @@ Developer manual in PDF format.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%endif
%prep
%setup -q
cp -a %{SOURCE2} %{SOURCE6} %{SOURCE7} .
%patch0
%patch3
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%autosetup -p1
cp -a %{SOURCE2} .
sed -i s/@now@/`date -r ChangeLog +%%Y-%%m-%%d`/g docs/docinfo.xml.in
%patch15 -p1
%patch16 -p1
%patch17 -p1
sed -i s:%{_prefix}/local/ups/bin:/bin: conf/upssched.conf.sample.in
%build
autoreconf -fvi
%if 0%{?suse_version} > 1500
export CXXFLAGS="%{optflags} -std=gnu++14"
%endif
%configure \
--disable-static \
--sysconfdir=%{CONFPATH} \
--datadir=%{_datadir}/nut \
--datadir=%{_datadir}/%{name} \
--with-all \
%if %{with texdoc}
--with-doc \
--with-doc="man html-single html-chunked pdf" \
%else
--with-doc="html-single html-chunked" \
--with-doc="man html-single html-chunked" \
%endif
--with-ssl \
--with-openssl \
--without-nss \
%if %{without libmodbus}
--without-modbus \
%endif
%if %{with libnsl}
--with-wrap \
%ifnarch %{ix86} x86_64 ia64
%endif
%if %{without libfreeipmi}
--without-ipmi \
%endif
%if %{without libi2c}
--without-i2c
%endif
--with-htmlpath=%{HTMLPATH} \
--with-cgipath=%{CGIPATH} \
--with-statepath=%{STATEPATH} \
--with-drvpath=%{MODELPATH} \
--with-pidpath=%{PIDPATH} \
--with-pidpath=%{PIDPATH} \
--with-user=%{NUT_USER} \
--with-group=%{NUT_GROUP} \
--with-udev-dir=%{_udevrulesdir}/.. \
--enable-option-checking=fatal
# does not create reproducible output with parallelism
make -j1
%make_build -j1
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p %{buildroot}%{STATEPATH}
# initscript
mkdir -p %{buildroot}%{_docdir}/%{name}
mkdir -p %{buildroot}%{_sbindir}
# initscript
ln -s service %{buildroot}%{_sbindir}/rcnut-driver
ln -s service %{buildroot}%{_sbindir}/rcnut-server
ln -s service %{buildroot}%{_sbindir}/rcnut-monitor
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/nut
mkdir -p %{buildroot}%{STATEPATH}
rename .sample "" %{buildroot}%{_sysconfdir}/ups/*.sample
mv %{buildroot}%{_tmpfilesdir}/nut-common.{tmpfiles,conf}
install -d %{buildroot}/usr/lib/systemd/system-sleep
install nut.system-sleep %{buildroot}/usr/lib/systemd/system-sleep/%{name}.sh
mkdir -p %{buildroot}%{bashcompletionsdir}
install -m0644 scripts/misc/nut.bash_completion %{buildroot}%{bashcompletionsdir}/nut
install -D -m 750 %{SOURCE6} %{buildroot}%{systemdsystemdutildir}/system-sleep/%{name}.sh
install -D -m 644 scripts/logrotate/nutlogd %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -D -m 644 scripts/misc/nut.bash_completion %{buildroot}%{bashcompletionsdir}/%{name}
# Documentation
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -a docs/*.txt docs/cables docs/images %{buildroot}%{_docdir}/%{name}/
cp -a docs/*.css docs/*.html %{buildroot}%{_docdir}/%{name}/
%if %{with texdoc}
@ -368,7 +382,8 @@ cp -a docs/*.pdf %{buildroot}%{_docdir}/%{name}/
%endif
# Not needed for packaged contents:
rm %{buildroot}%{_docdir}/%{name}/packager-guide.*
rm -f %{buildroot}%{_docdir}/%{name}/packager-guide.*
rm -f %{buildroot}%{_docdir}/%{name}/cables/Makefile.am
# Create symlinks for man pages
%fdupes -s %{buildroot}%{_mandir}
@ -377,7 +392,7 @@ rm %{buildroot}%{_docdir}/%{name}/packager-guide.*
%if 0%{?suse_version} < 1330
getent passwd %{NUT_USER} >/dev/null || useradd -r -g %{NUT_GROUP} -s /bin/false -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null
%endif
%service_add_pre nut-driver.service nut-server.service nut-monitor.service
%service_add_pre nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target
%post
# Generate initial passwords.
@ -402,32 +417,43 @@ if grep "powersave -U" %{_sysconfdir}/ups/upsmon.conf ; then
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-driver.service nut-server.service nut-monitor.service
%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
%preun
%service_del_preun nut-driver.service nut-server.service nut-monitor.service
%service_del_preun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target
%postun
%service_del_postun nut-driver.service nut-server.service nut-monitor.service
%service_del_postun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target
%post -n libnutclient0 -p /sbin/ldconfig
%postun -n libnutclient0 -p /sbin/ldconfig
%post -n libnutscan1 -p /sbin/ldconfig
%postun -n libnutscan1 -p /sbin/ldconfig
%post -n libupsclient4 -p /sbin/ldconfig
%postun -n libupsclient4 -p /sbin/ldconfig
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
%ldconfig_scriptlets -n libnutclient2
%ldconfig_scriptlets -n libnutclientstub1
%ldconfig_scriptlets -n libnutscan2
%ldconfig_scriptlets -n libupsclient6
%else
%post -n libnutclient2 -p /sbin/ldconfig
%postun -n libnutclient2 -p /sbin/ldconfig
%post -n libnutclientstub1 -p /sbin/ldconfig
%postun -n libnutclientstub1 -p /sbin/ldconfig
%post -n libnutscan2 -p /sbin/ldconfig
%postun -n libnutscan2 -p /sbin/ldconfig
%post -n libupsclient6 -p /sbin/ldconfig
%postun -n libupsclient6 -p /sbin/ldconfig
%endif
%files
%doc AUTHORS ChangeLog MAINTAINERS NEWS README README.SUSE UPGRADING
%license COPYING
%config %{_sysconfdir}/logrotate.d/*
%{_bindir}/*
%{_datadir}/nut
%{_datadir}/%{name}
%{_mandir}/man5/*%{ext_man}
%{_mandir}/man8/*%{ext_man}
%exclude %{_mandir}/man8/netxml-ups*.*
%exclude %{_mandir}/man8/snmp-ups*.*
%dir %{_libexecdir}/ups
%{_libexecdir}/nut-driver-enumerator.sh
%{_sbindir}/*
%{_udevrulesdir}/*.rules
%config(noreplace) %{CONFPATH}/hosts.conf
@ -443,11 +469,16 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{MODELPATH}/*
%exclude %{MODELPATH}/snmp-ups
%exclude %{MODELPATH}/netxml-ups
%attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}
%dir %attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}
%{_unitdir}/*.path
%{_unitdir}/*.target
%{_unitdir}/*.service
%{systemdsystemdutildir}/system-shutdown/*
/usr/lib/systemd/system-sleep/%{name}.sh
%{systemdsystemdutildir}/system-sleep/%{name}.sh
%{bashcompletionsdir}/*
%{_tmpfilesdir}/%{name}-common.conf
%ghost %{_rundir}/%{name}
%ghost %attr(700,%{NUT_USER},%{NUT_GROUP}) %{STATEPATH}/%{name}
%files drivers-net
%{MODELPATH}/snmp-ups
@ -455,13 +486,16 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_mandir}/man8/netxml-ups*%{ext_man}
%{_mandir}/man8/snmp-ups*%{ext_man}
%files -n libnutclient0
%files -n libnutclient2
%{_libdir}/libnutclient.so.*
%files -n libnutscan1
%files -n libnutclientstub1
%{_libdir}/libnutclientstub.so.*
%files -n libnutscan2
%{_libdir}/libnutscan.so.*
%files -n libupsclient4
%files -n libupsclient6
%{_libdir}/libupsclient.so.*
%files cgi
@ -487,6 +521,7 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%files doc-html
%{_docdir}/%{name}/FAQ.html
%{_docdir}/%{name}/cables.html
%{_docdir}/%{name}/solaris-usb.html
%{_docdir}/%{name}/user-manual.html
%{_docdir}/%{name}/*.css
@ -499,12 +534,12 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/FAQ.pdf
%{_docdir}/%{name}/cables.pdf
%{_docdir}/%{name}/solaris-usb.pdf
%{_docdir}/%{name}/user-manual.pdf
%files devel-doc-pdf
%doc %dir %{_docdir}/%{name}
%{_docdir}/%{name}/developer-guide.pdf
%endif
%changelog

View File

@ -1,33 +0,0 @@
commit 5d98d5536699222bc93c58c1e6f6df43dc9bfcff
Author: Arnaud Quette <arnaud.quette@free.fr>
Date: Thu Mar 10 14:41:40 2016 +0100
Fix nut-scanner compilation in some environments
Following the commits 5187dab (common: add some string-related functions) and
e767df5 (common: consolidate some string-related functions), the build rules of
nut-scanner were not updated to also use str.c. Since the libcommon.la
dependency was still there, some environments managed to build cleanly, while
other are failing. Update build dependencies to fix this situation
diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am
index 558cb23b..db85c682 100644
--- a/tools/nut-scanner/Makefile.am
+++ b/tools/nut-scanner/Makefile.am
@@ -14,14 +14,14 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \
scan_avahi.c scan_eaton_serial.c nutscan-serial.c \
../../drivers/serial.c \
../../drivers/bcmxcp_ser.c \
- ../../common/common.c
+ ../../common/common.c ../../common/str.c
libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS)
libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0
libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL_CFLAGS) -I$(top_srcdir)/drivers
nut_scanner_SOURCES = nut-scanner.c
nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include
-nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la
+nut_scanner_LDADD = libnutscan.la
if WITH_SSL
libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS)

View File

@ -1,147 +0,0 @@
diff --git a/clients/upsclient.c b/clients/upsclient.c
index b90587b0..b7dd8f42 100644
--- a/clients/upsclient.c
+++ b/clients/upsclient.c
@@ -299,11 +299,6 @@ int upscli_init(int certverify, const char *certpath,
{
#ifdef WITH_OPENSSL
int ret, ssl_mode = SSL_VERIFY_NONE;
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- const SSL_METHOD *ssl_method;
-#else
- SSL_METHOD *ssl_method;
-#endif
#elif defined(WITH_NSS) /* WITH_OPENSSL */
SECStatus status;
#endif /* WITH_OPENSSL | WITH_NSS */
@@ -315,22 +310,35 @@ int upscli_init(int certverify, const char *certpath,
}
#ifdef WITH_OPENSSL
+
+ SSL_load_error_strings();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init();
- SSL_load_error_strings();
- ssl_method = TLSv1_client_method();
+ ssl_ctx = SSL_CTX_new(SSLv23_client_method());
+#else
+ OPENSSL_init_ssl(0, NULL);
- if (!ssl_method) {
- return 0;
- }
+ ssl_ctx = SSL_CTX_new(TLS_client_method());
+#endif
- ssl_ctx = SSL_CTX_new(ssl_method);
if (!ssl_ctx) {
upslogx(LOG_ERR, "Can not initialize SSL context");
return -1;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ /* set minimum protocol TLSv1 */
+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
+#else
+ ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION);
+ if (ret != 1) {
+ upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1");
+ return -1;
+ }
+#endif
+
if (!certpath) {
if (certverify == 1) {
upslogx(LOG_ERR, "Can not verify certificate if any is specified");
@@ -737,7 +745,7 @@ static int upscli_sslinit(UPSCONN_t *ups, int verifycert)
switch(res)
{
case 1:
- upsdebugx(3, "SSL connected");
+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl));
break;
case 0:
upslog_with_errno(1, "SSL_connect do not accept handshake.");
diff --git a/m4/nut_check_libopenssl.m4 b/m4/nut_check_libopenssl.m4
index 1b875077..5f29f4a3 100644
--- a/m4/nut_check_libopenssl.m4
+++ b/m4/nut_check_libopenssl.m4
@@ -57,8 +57,9 @@ if test -z "${nut_have_libopenssl_seen}"; then
AC_MSG_RESULT([${LIBS}])
dnl check if openssl is usable
- AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT])
- AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no])
+ AC_CHECK_FUNCS(OPENSSL_init_ssl, [nut_have_openssl=yes], [nut_have_openssl=no])
+ AC_CHECK_FUNCS(SSL_library_init, [nut_have_openssl=yes], [])
+ AC_CHECK_HEADERS(openssl/ssl.h, [], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT])
if test "${nut_have_openssl}" = "yes"; then
nut_with_ssl="yes"
diff --git a/server/netssl.c b/server/netssl.c
index c2f40989..6ae13e8d 100644
--- a/server/netssl.c
+++ b/server/netssl.c
@@ -275,7 +275,7 @@ void net_starttls(nut_ctype_t *client, int numarg, const char **arg)
{
case 1:
client->ssl_connected = 1;
- upsdebugx(3, "SSL connected");
+ upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl));
break;
case 0:
@@ -371,13 +371,7 @@ void ssl_init(void)
{
#ifdef WITH_NSS
SECStatus status;
-#elif defined(WITH_OPENSSL)
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- const SSL_METHOD *ssl_method;
-#else
- SSL_METHOD *ssl_method;
-#endif
-#endif /* WITH_NSS|WITH_OPENSSL */
+#endif /* WITH_NSS */
if (!certfile) {
return;
@@ -388,17 +382,31 @@ void ssl_init(void)
#ifdef WITH_OPENSSL
SSL_load_error_strings();
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init();
- if ((ssl_method = TLSv1_server_method()) == NULL) {
+ ssl_ctx = SSL_CTX_new(SSLv23_server_method());
+#else
+ OPENSSL_init_ssl(0, NULL);
+
+ ssl_ctx = SSL_CTX_new(TLS_server_method());
+#endif
+
+ if (!ssl_ctx) {
ssl_debug();
- fatalx(EXIT_FAILURE, "TLSv1_server_method failed");
+ fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
}
- if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ /* set minimum protocol TLSv1 */
+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
+#else
+ if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) {
ssl_debug();
- fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
+ fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)");
}
+#endif
if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) {
ssl_debug();

View File

@ -1,43 +0,0 @@
PATCH-FIX-UPSTREAM https://github.com/networkupstools/nut/pull/528
From d1372910ccc449edb5f447b04a5fd50c5423b314 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Tue, 20 Feb 2018 13:40:18 +0100
Subject: [PATCH] Sort input file list
so that nut builds in a reproducible way
in spite of indeterministic filesystem readdir order
and http://bugs.python.org/issue30461
See https://reproducible-builds.org/ for why this is good.
---
tools/nut-snmpinfo.py | 2 +-
tools/nut-usbinfo.pl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/nut-snmpinfo.py b/tools/nut-snmpinfo.py
index 32d17784e..0649ef5a3 100755
--- a/tools/nut-snmpinfo.py
+++ b/tools/nut-snmpinfo.py
@@ -80,7 +80,7 @@ def expand_define(filename,constant):
output_file.write( "/* SNMP IDs device table */\n" )
output_file.write( "static snmp_device_id_t snmp_device_table[] = {\n" )
-for filename in glob.glob('../drivers/*-mib.c'):
+for filename in sorted(glob.glob('../drivers/*-mib.c')):
list_of_line = open(filename,'r').read().split(';')
for line in list_of_line:
if "mib2nut_info_t" in line:
diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl
index 2c0dd055b..a8638769b 100755
--- a/tools/nut-usbinfo.pl
+++ b/tools/nut-usbinfo.pl
@@ -76,7 +76,7 @@
################# MAIN #################
-find(\&find_usbdevs,$scanPath);
+find({wanted=>\&find_usbdevs, preprocess=>sub{sort @_}}, $scanPath);
&gen_usb_files;
################# SUB METHOD #################

View File

@ -1,28 +0,0 @@
Index: nut-2.7.4/m4/nut_check_libgd.m4
===================================================================
--- nut-2.7.4.orig/m4/nut_check_libgd.m4
+++ nut-2.7.4/m4/nut_check_libgd.m4
@@ -19,8 +19,8 @@ if test -z "${nut_have_libgd_seen}"; the
LDFLAGS="-L/usr/X11R6/lib"
LIBS="-lgd -lpng -lz -ljpeg -lfreetype -lm -lXpm -lX11"
- AC_MSG_CHECKING(for gd version via gdlib-config)
- GD_VERSION=`gdlib-config --version 2>/dev/null`
+ AC_MSG_CHECKING(for gd version via pkg-config)
+ GD_VERSION=`pkg-config --modversion gdlib 2>/dev/null`
if test "$?" != "0" -o -z "${GD_VERSION}"; then
GD_VERSION="none"
fi
@@ -34,9 +34,9 @@ if test -z "${nut_have_libgd_seen}"; the
AC_MSG_WARN([[If gd detection fails, upgrade gd or use --with-gd-includes and --with-gd-libs]])
;;
*)
- CFLAGS="`gdlib-config --includes 2>/dev/null`"
- LDFLAGS="`gdlib-config --ldflags 2>/dev/null`"
- LIBS="`gdlib-config --libs 2>/dev/null`"
+ CFLAGS="`pkg-config gdlib --cflags 2>/dev/null`"
+ LDFLAGS="`pkg-config gdlib --libs 2>/dev/null`"
+ LIBS=""
;;
esac