-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2813 from sshambar/master
scripts/external_apis: add example external protocol script
- Loading branch information
Showing
12 changed files
with
1,403 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5465,6 +5465,39 @@ dnl Use these at best for tests (e.g. nutconf), not production code: | |
AC_DEFINE_UNQUOTED([ABS_TOP_SRCDIR], ["${ABS_TOP_SRCDIR}"], [NUT source directory when the build was configured]) | ||
AC_DEFINE_UNQUOTED([ABS_TOP_BUILDDIR], ["${ABS_TOP_BUILDDIR}"], [NUT build directory when the build was configured]) | ||
|
||
AC_MSG_CHECKING([whether to install External API integration script: Enphase Monitor]) | ||
nut_with_extapi_enphase="no" | ||
AC_ARG_ENABLE([extapi-enphase], | ||
AS_HELP_STRING([--enable-extapi-enphase=(yes|auto|no)], [Enable installation of integration script for External API: Enphase Monitor (default: no)]), | ||
[ | ||
case "${enableval}" in | ||
yes|"") | ||
nut_enable_extapi_enphase="auto" | ||
;; | ||
auto|no) | ||
nut_enable_extapi_enphase="${enableval}" | ||
;; | ||
*) | ||
AC_MSG_ERROR([Unexpected argument for --enable-extapi-enphase=${enableval}]) | ||
;; | ||
esac | ||
], []) | ||
|
||
if test x"$nut_enable_extapi_enphase" != xno ; then | ||
dnl Depends on usability of further programs and bash version | ||
dnl Luckily the script checks that itself, before handling CLI args | ||
/usr/bin/env bash "${ABS_TOP_SRCDIR}/scripts/external_apis/enphase/enphase-monitor.in" --help >/dev/null \ | ||
&& nut_can_extapi_enphase="yes" \ | ||
|| nut_can_extapi_enphase="no" | ||
|
||
if test x"$nut_enable_extapi_enphase" = xyes && x"$nut_can_extapi_enphase" = xno ; then | ||
AC_MSG_ERROR([Caller required installation --enable-extapi-enphase but the system can not run it]) | ||
fi | ||
nut_enable_extapi_enphase="${nut_can_extapi_enphase}" | ||
fi | ||
AC_MSG_RESULT([${nut_enable_extapi_enphase}]) | ||
AM_CONDITIONAL(ENABLE_EXTAPI_ENPHASE, test x"$nut_enable_extapi_enphase" = x"yes") | ||
|
||
AC_MSG_CHECKING([whether to customize ${TOP_BUILDDIR}/scripts/systemd/nut-common-tmpfiles.conf.in for this system]) | ||
dnl TOTHINK: Some distributions make the directories below owned | ||
dnl by "root:${RUN_AS_GROUP}" with 77x permissions. Is it safer?.. | ||
|
@@ -5685,6 +5718,8 @@ AC_CONFIG_FILES([ | |
scripts/augeas/nutupssetconf.aug | ||
scripts/avahi/nut.service | ||
scripts/devd/Makefile | ||
scripts/external_apis/Makefile | ||
scripts/external_apis/enphase/[email protected] | ||
scripts/hotplug/Makefile | ||
scripts/hotplug/libhidups | ||
scripts/HP-UX/nut.psf | ||
|
@@ -5738,9 +5773,10 @@ m4_foreach_w([SCRIPTFILE], [ | |
scripts/HP-UX/postinstall | ||
scripts/RedHat/upsd | ||
scripts/RedHat/upsmon | ||
scripts/augeas/gen-nutupsconf-aug.py | ||
scripts/external_apis/enphase/enphase-monitor | ||
scripts/python/app/NUT-Monitor-py2gtk2 | ||
scripts/python/app/NUT-Monitor-py3qt5 | ||
scripts/augeas/gen-nutupsconf-aug.py | ||
scripts/python/module/test_nutclient.py | ||
scripts/upsdrvsvcctl/nut-driver-enumerator.sh | ||
scripts/upsdrvsvcctl/upsdrvsvcctl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Network UPS Tools: scripts/external_apis | ||
|
||
EXTRA_DIST = \ | ||
README.adoc \ | ||
enphase/README.adoc \ | ||
enphase/enphase-monitor.in \ | ||
enphase/[email protected] | ||
|
||
SPELLCHECK_SRC = README.adoc enphase/README.adoc | ||
|
||
# Handle optional installation: | ||
if ENABLE_EXTAPI_ENPHASE | ||
|
||
extapi_enphase_datadir = @datadir@/external_apis/enphase | ||
extapi_enphase_data_DATA = enphase/README.adoc | ||
|
||
extapi_enphase_execdir = @libexec@ | ||
extapi_enphase_exec_SCRIPTS = enphase/enphase-monitor | ||
|
||
if HAVE_SYSTEMD | ||
|
||
systemdsystemunit_DATA = \ | ||
enphase/[email protected] | ||
|
||
endif HAVE_SYSTEMD | ||
|
||
endif ENABLE_EXTAPI_ENPHASE | ||
|
||
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. | ||
# We also have to export some variables that may be tainted by relative | ||
# paths when parsing the other makefile (e.g. MKDIR_P that may be defined | ||
# via expanded $(top_builddir)/install-sh): | ||
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) | ||
# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ | ||
|
||
# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here | ||
# by a wildcard target in case the make implementation can put the two together. | ||
*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) | ||
|
||
.sample.sample-spellchecked: | ||
+$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ | ||
|
||
.in.in-spellchecked: | ||
+$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ | ||
|
||
spellcheck spellcheck-interactive spellcheck-sortdict: | ||
+$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) 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)" $@ | ||
|
||
CLEANFILES = *-spellchecked enphase/*-spellchecked \ | ||
enphase/enphase-monitor \ | ||
enphase/[email protected] | ||
|
||
MAINTAINERCLEANFILES = Makefile.in .dirstamp |
Oops, something went wrong.