Skip to content

Commit d4484eb

Browse files
committed
Merge remote-tracking branch 'upstream/master' as of 2025-12-22 into FTY
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
2 parents 4b13791 + 783d2fa commit d4484eb

File tree

8 files changed

+87
-4
lines changed

8 files changed

+87
-4
lines changed

NEWS.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ several `FSD` notifications into one executed action. [PR #3097]
303303
provided 'confargs' etc.) [#3140]
304304
* Added configure script options for 'libregex' tuning, just so it is on par
305305
with our other optional dependencies. [#3140]
306+
* Changed `--enable-extapi-enphase` to not default to `auto` and then get
307+
installed on every system capable of using it; this is a niche capability
308+
for users of specific devices via a cloud portal. [follow-up to PR #2813
309+
for issue #2807]
306310

307311
- Fixed CI recipes for PyPI publication of PyNUT(Client) module to also
308312
include the source distribution (was posted for NUT v2.8.1 and v2.8.2

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7173,7 +7173,7 @@ nut_with_extapi_enphase="no"
71737173
NUT_ARG_ENABLE([extapi-enphase], [(yes|no|auto)], [Enable installation of integration script for External API: Enphase Monitor], [no])
71747174

71757175
AS_CASE([${nut_enable_extapi_enphase}],
7176-
[yes|""], [nut_enable_extapi_enphase="auto"],
7176+
[""], [nut_enable_extapi_enphase="yes"],
71777177
[auto|no], [],
71787178
[AC_MSG_ERROR([Unexpected argument for --enable-extapi-enphase=${nut_enable_extapi_enphase}])]
71797179
)

docs/configure.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,3 +1285,13 @@ If system doesn't have `pkg-config` or it fails to provides hints for
12851285
some of the settings that are needed to set it up properly and the
12861286
build in defaults are not right, you can specify the correct values
12871287
for your system here.
1288+
1289+
External API integrations
1290+
~~~~~~~~~~~~~~~~~~~~~~~~~
1291+
1292+
--enable-extapi-enphase
1293+
1294+
For users of Enphase solar inverters and the Enlighten portal to monitor
1295+
them in the cloud, this option adds a service and script to poll the portal
1296+
and feed the information into the NUT linkman:dummy-ups[8] driver to see it
1297+
as any other device.

docs/nut.dict

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3649 utf-8
1+
personal_ws-1.1 en 3652 utf-8
22
AAC
33
AAS
44
ABI
@@ -1028,6 +1028,7 @@ Powervar
10281028
Powervar's
10291029
Powerwell
10301030
Prachi
1031+
Preinstall
10311032
Prereqs
10321033
PresentStatus
10331034
Priv
@@ -2020,6 +2021,7 @@ drvpath
20202021
drwxr
20212022
drwxrwx
20222023
ds
2024+
dsc
20232025
dsi
20242026
dsr
20252027
dsssl
@@ -2921,6 +2923,7 @@ pragma
29212923
pragmas
29222924
pre
29232925
preLaunchTask
2926+
preinstallimage
29242927
prepend
29252928
prepended
29262929
preprocess

scripts/obs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_preinstallimage

scripts/obs/Makefile.am

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,57 @@ EXTRA_DIST += \
9696

9797
SPELLCHECK_SRC = README.adoc
9898

99+
# Produce an OBS preinstallimage recipe file from our SPEC and DSC resources,
100+
# to speed up PR and stable branch iteration builds (output of this processing
101+
# should be stored as a sibling OBS project "preinstallimage-nut" in the OBS
102+
# server). Note that syntax for "one-of-options" installation accepted by deb
103+
# and rpm tooling differs: for DEB we need to list them without parentheses
104+
# and without spaces around the pipe character. Parentheses around version
105+
# constraints seem to be confusing, but spaces around comparison operators
106+
# seem to be optional, at least for the recipe syntax parser.
107+
# You can debug stacks of calls here by adding `| tee -a /dev/stderr \` layers
108+
_preinstallimage: nut.spec nut.dsc Makefile
109+
@echo " GENERATE-RECIPE $@" ; \
110+
(echo 'Name: preinstallimage-@PACKAGE_NAME@' ; \
111+
echo '### Start of "if RPM"'; \
112+
echo '%if 0%{?rhel_version} || 0%{?rhel} || 0%{?sle_version} || 0%{?suse_version} || 0%{?centos_version} || 0%{?centos} || 0%{?fedora_version} || 0%{?fedora} || 0%{?opensuse_version}' ; \
113+
cat nut.spec \
114+
| $(EGREP) '(% *(if|else|endif|define)|Requires:|Ignore:|Prefer:)' \
115+
| $(EGREP) -v '(%{name} = %{version}|%{_s*bindir}/|python-base)' \
116+
| $(SED) -e 's/^Requires:/BuildRequires:/' ; \
117+
echo '%endif' ; \
118+
echo '### End of "if RPM"'; \
119+
echo '# ---- blank ----'; \
120+
echo '### Start of "if DEB"'; \
121+
echo '%if 0%{?debian_version} || 0%{?debian} || 0%{?ubuntu_version} || 0%{?ubuntu}'; \
122+
awk ' \
123+
/^Build-Depends(-Indep)?:/ { \
124+
inBD=1; \
125+
sub(/^Build-Depends(-Indep)?:[[:space:]]*/, ""); \
126+
buf = (buf ? buf "," : "") $$0; \
127+
next; \
128+
}; \
129+
inBD && /^[[:space:]]+/ { \
130+
buf = buf " " $$0; \
131+
next; \
132+
}; \
133+
inBD { inBD=0; next; }; \
134+
END { print buf }; \
135+
' nut.dsc \
136+
| $(SED) \
137+
-e 's/[[:space:]]*//g' \
138+
-e 's/,/\n/g' \
139+
-e 's/(\([^)][^)]*\)\(>\|<\|=\|>=\|<=\|==\|!=\)\([^)][^)]*\))/\1\2\3/g' \
140+
-e 's/\[[^]]*\]//g' \
141+
-e 's/<[^>]*>//g' \
142+
-e 's/:any\|:native//g' \
143+
| $(GREP) -v '^\$$' \
144+
| awk 'NF { printf "BuildRequires: %s\n", $$0 }'; \
145+
echo '%endif' ; \
146+
echo '### End of "if DEB"'; \
147+
) > '$@'.tmp && [ -s '$@'.tmp ] && mv -f '$@'.tmp '$@'
148+
149+
99150
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension.
100151
# We also have to export some variables that may be tainted by relative
101152
# paths when parsing the other makefile (e.g. MKDIR_P that may be defined
@@ -117,5 +168,6 @@ spellcheck spellcheck-interactive spellcheck-sortdict:
117168
+$(MAKE) $(AM_MAKEFLAGS) -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@
118169

119170
CLEANFILES = *-spellchecked
171+
CLEANFILES += _preinstallimage
120172

121173
MAINTAINERCLEANFILES = Makefile.in .dirstamp

scripts/obs/README.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ For some historical and/or practical details see:
4848

4949
* https://github.com/networkupstools/nut/issues/1209
5050

51+
== Preinstall images
52+
53+
OBS builds can be sped up by use of `preinstallimage` recipes seen in the
54+
sibling or "upstream" build dependency repositories for a built project,
55+
if such image contains a subset of the packages that the current build
56+
aims to use.
57+
58+
TODO: Document actually getting PR builds to see such prepared images.
59+
60+
A recipe can be generated from current `nut.spec` and `nut.dsc` files
61+
via `make _preinstallimage` and uploaded into a dedicated package near
62+
the `nut` package in an OBS project.
63+
5164
== Other notes
5265

5366
The recipe files themselves would likely cross-pollinate with popular

scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ smf_registerInstance() {
810810
drivers=*|*,drivers=*)
811811
OTHERLIST="`upsconf_list_dev_drv_socket_checksum`" || OTHERLIST=""
812812
# Not double-quoting here to iterate the string tokens:
813-
for DEPDRV in `echo "${_MED}" | $SED -e 's/^\(.*,d\|d\)rivers=//' -e 's/,/ /g'` ; do
813+
for DEPDRV in `echo "${_MED}" | $SED -e 's/^drivers=//' -e 's/^.*,drivers=//' -e 's/,/ /g'` ; do
814814
case "${DEPDRV}" in
815815
*-*) # May be "drivername-upsname", where either sub-string
816816
# may have dashes inside too; try to find the right one:
@@ -1096,7 +1096,7 @@ systemd_registerInstance() {
10961096
drivers=*|*,drivers=*)
10971097
OTHERLIST="`upsconf_list_dev_drv_socket_checksum`" || OTHERLIST=""
10981098
# Not double-quoting here to iterate the string tokens:
1099-
for DEPDRV in `echo "${_MED}" | $SED -e 's/^\(.*,d\|d\)rivers=//' -e 's/,/ /g'` ; do
1099+
for DEPDRV in `echo "${_MED}" | $SED 's/^drivers=//' -e 's/^.*,drivers=//' -e 's/,/ /g'` ; do
11001100
case "${DEPDRV}" in
11011101
*-*) # May be "drivername-upsname", where either sub-string
11021102
# may have dashes inside too; try to find the right one:

0 commit comments

Comments
 (0)